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

Bug: Not possible to import only single variable or equation #81

Open
schymans opened this issue Apr 17, 2020 · 1 comment
Open

Bug: Not possible to import only single variable or equation #81

schymans opened this issue Apr 17, 2020 · 1 comment

Comments

@schymans
Copy link
Collaborator

For some reason, from essm.variables.physics.thermodynamics import lambda_E not only imports lambda_E but also all other variables in that module. This looks like a bug.

@schymans
Copy link
Collaborator Author

schymans commented Feb 9, 2021

Actually, from essm.variables.physics.thermodynamics import lambda_E only imports lambda_E, but all other variables in the same module are added to Variable.__registry__, and then show up when using generate_metadata_table (see #97).
Example:

from essm.variables import Variable
from essm.variables.utils import generate_metadata_table
class var1(Variable):
    """Test variable"""
print(Variable.__registry__)
from essm.variables.physics.thermodynamics import lambda_E
print(Variable.__registry__)

The first print command correctly only returns var1, but the second returns all variables from the thermodynamics module.
@jirikuncar, do you know how to fix this?

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

No branches or pull requests

1 participant