Skip to content

EquationWriter includes imports of variables, but this can lead to error #100

Description

@schymans

In https://github.com/environmentalscience/essm/blob/master/essm/_generator.py, EquationWriter automatically includes imports of variables contained in equations, but if the variables were defined locally in the same notebook, these imports point to __local__ and the resulting .py file cannot be imported. A way around is to first create a .py file with the exported variable definitions, then re-import all variables from that file, before running EquationWriter, but this again does not work if the files are not in the same folder, so there should be an option to exclude automatic import statements for variables in EquationWriter, so that the user can import the variables from a custom file beforehand. The downside is that equations only make sense in combination with the correct variable definitions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions