Exemple #1
0
    sys.stdout.write(
        warnings.formatwarning(message, category, filename, lineno))


warnings.showwarning = customwarn
warnings.filterwarnings('always', category=HydPyDeprecationWarning)
warnings.filterwarnings('ignore', r'All-NaN (slice|axis) encountered')
warnings.filterwarnings('error', category=integrate.IntegrationWarning)

# Numpy introduced new string representations in version 1.14 affecting
# our doctests.  Hence, the old style is selected for now:
try:
    # pylint: disable=unexpected-keyword-arg
    numpy.set_printoptions(legacy='1.13')
except TypeError:
    pass

substituter = prepare_mainsubstituter()

__all__ = [
    'builtins', 'pandas', 'pyplot', 'pub', 'Auxfiler', 'Element', 'Elements',
    'Node', 'Nodes', 'HydPy', 'prepare_model', 'reverse_model_wildcard_import',
    'print_values', 'round_', 'Selection', 'Selections', 'Date', 'Period',
    'Timegrid', 'Timegrids', 'IntegrationTest', 'Open', 'UnitTest', 'ARMA',
    'MA', 'ANN', 'ann', 'SeasonalANN', 'LinearStorageCascade',
    'TranslationDiffusionEquation', 'RiverBasinNumber', 'RiverBasinNumbers',
    'RiverBasinNumbers2Selection', 'nan', 'bias_abs', 'bias_rel',
    'calc_mean_time', 'calc_mean_time_deviation', 'corr', 'evaluationtable',
    'hsepd', 'hsepd_manual', 'hsepd_pdf', 'nse', 'prepare_arrays', 'std_ratio'
]
Exemple #2
0
sequence2alias: Dict[sequencetools.InOutSequenceTypes, str] = {}

if config.USEAUTODOC:
    with warnings.catch_warnings():
        warnings.filterwarnings(
            action="ignore",
            category=FutureWarning,
        )
        from hydpy import auxs
        from hydpy import core
        from hydpy import cythons
        from hydpy import exe
        from hydpy.core import autodoctools

        substituter = autodoctools.prepare_mainsubstituter()
        for subpackage in (auxs, core, cythons, exe):
            subpackagepath = subpackage.__path__[0]
            for filename in sorted(os.listdir(subpackagepath)):
                if filename.endswith(".py") and not filename.startswith("_"):
                    module = importlib.import_module(
                        f"{subpackage.__name__}.{filename[:-3]}"
                    )
                    autodoctools.autodoc_module(module)
        autodoctools.autodoc_module(importlib.import_module("hydpy.examples"))
        modelpath: str = models.__path__[0]
        for filename in sorted(os.listdir(modelpath)):
            path = os.path.join(modelpath, filename)
            if os.path.isdir(path) and not filename.startswith("_"):
                module = importlib.import_module(f"{models.__name__}.{filename}")
                autodoctools.autodoc_basemodel(module)