environmentalscience / essm

This package contains helpers to deal with physical variables and units.
https://environmentalscience.github.io/essm/
GNU General Public License v2.0
12 stars 5 forks source link

Add supplementary_imports and test #96

Closed schymans closed 3 years ago

schymans commented 3 years ago

When using EquationWriter and VariableWriter to create .py files, re-import of those files fails if variables or equations use functions that are not in the standard imports. Therefore, I created a new input option for both functions, supplementary_imports, which takes a dictionary with additional imports to be embedded in the .py files. I updated the docstrings to provide examples and also a new test in test_equations.py.