From 651ee4240b24fa476bd8ba47606f9d89f9d317f7 Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Wed, 10 Aug 2016 11:29:32 -0500 Subject: [PATCH] Address #698 comments --- docs/source/io_formats/fission_energy.rst | 4 ++-- openmc/data/function.py | 10 +++++----- scripts/openmc-ace-to-hdf5 | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/source/io_formats/fission_energy.rst b/docs/source/io_formats/fission_energy.rst index 1d3231ee34..768db56ebb 100644 --- a/docs/source/io_formats/fission_energy.rst +++ b/docs/source/io_formats/fission_energy.rst @@ -9,8 +9,8 @@ ENDF-102_ for details). It gives the information needed to compute the energy carried away from fission reactions by each reaction product (e.g. fragment nuclei, neutrons) which depends on the incident neutron energy. OpenMC is distributed with one of these files under -openmc/data/fission_Q_data_endfb71.h5. More files of this format can be -created from ENDF files with the +data/fission_Q_data_endfb71.h5. More files of this format can be created from +ENDF files with the ``openmc.data.write_compact_458_library`` function. They can be read with the ``openmc.data.FissionEnergyRelease.from_compact_hdf5`` class method. diff --git a/openmc/data/function.py b/openmc/data/function.py index 798aa18cdd..0d4fd3b1d8 100644 --- a/openmc/data/function.py +++ b/openmc/data/function.py @@ -13,12 +13,11 @@ INTERPOLATION_SCHEME = {1: 'histogram', 2: 'linear-linear', 3: 'linear-log', class Function1D(object): """A function of one independent variable with HDF5 support.""" - __metaclass__ = ABCMeta - def __init__(self): pass - @abstractmethod - def __call__(self): pass + def __call__(self): + raise NotImplemented('Subclasses of Function1D should overwrite the ' + '__call__ and to_hdf5 methods') @abstractmethod def to_hdf5(self, group, name='xy'): @@ -32,7 +31,8 @@ class Function1D(object): Name of the dataset to create """ - pass + raise NotImplemented('Subclasses of Function1D should overwrite the ' + '__call__ and to_hdf5 methods') @classmethod def from_hdf5(cls, dataset): diff --git a/scripts/openmc-ace-to-hdf5 b/scripts/openmc-ace-to-hdf5 index 90031f0faa..2051de00b6 100755 --- a/scripts/openmc-ace-to-hdf5 +++ b/scripts/openmc-ace-to-hdf5 @@ -124,7 +124,7 @@ for filename in ace_libraries: # Fission energy release data, if available if args.fission_energy_release is not None: fer = openmc.data.FissionEnergyRelease.from_compact_hdf5( - args.fission_energy_release, neutron) + args.fission_energy_release, neutron) if fer is not None: neutron.fission_energy = fer