Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
schymans opened this issue Jun 18, 2021 · 0 comments · May be fixed by #101
Open

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

schymans opened this issue Jun 18, 2021 · 0 comments · May be fixed by #101

Comments

@schymans
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant