mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Fix doc build for metaclassed Polynomials
This commit is contained in:
parent
88ce91502c
commit
5b219fd6aa
2 changed files with 8 additions and 8 deletions
|
|
@ -28,6 +28,9 @@ MOCK_MODULES = ['numpy', 'numpy.polynomial', 'numpy.polynomial.polynomial',
|
|||
'h5py', 'pandas', 'opencg']
|
||||
sys.modules.update((mod_name, MagicMock()) for mod_name in MOCK_MODULES)
|
||||
|
||||
import numpy as np
|
||||
np.polynomial.Polynomial = MagicMock
|
||||
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
from abc import ABCMeta, abstractmethod
|
||||
from collections import Iterable, Callable
|
||||
from numbers import Real, Integral
|
||||
from six import with_metaclass
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
|
@ -10,14 +11,11 @@ INTERPOLATION_SCHEME = {1: 'histogram', 2: 'linear-linear', 3: 'linear-log',
|
|||
4: 'log-linear', 5: 'log-log'}
|
||||
|
||||
|
||||
class Function1D(object):
|
||||
class Function1D(with_metaclass(ABCMeta, object)):
|
||||
"""A function of one independent variable with HDF5 support."""
|
||||
|
||||
def __init__(self): pass
|
||||
|
||||
def __call__(self):
|
||||
raise NotImplemented('Subclasses of Function1D should overwrite the '
|
||||
'__call__ and to_hdf5 methods')
|
||||
@abstractmethod
|
||||
def __call__(self): pass
|
||||
|
||||
@abstractmethod
|
||||
def to_hdf5(self, group, name='xy'):
|
||||
|
|
@ -31,8 +29,7 @@ class Function1D(object):
|
|||
Name of the dataset to create
|
||||
|
||||
"""
|
||||
raise NotImplemented('Subclasses of Function1D should overwrite the '
|
||||
'__call__ and to_hdf5 methods')
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def from_hdf5(cls, dataset):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue