Closed rcaneill closed 2 years ago
Oh! I haven't used those "grouped" modules for a very long time... will need to look into how to solve this.
Looks like the only reliable/non "hack" way is by just replicating the submodule structure of the upstream gsw library. That is the files like density.py need to actually exist.
The docs for GSW-Python state:
When importing functions in a module or script, however, it is safer to import them directly from the gsw namespace; it is more concise and future-proof; the organization of the subpackages is subject to change.
So we should indeed discourage this type of usage, but upstream compat is more important for this project.
See #4
Comment on the test
test_func_standard_module
: it fails. This means that gsw can only be used when importing function from gsw, and not from the modules (likefrom gsw.density import sigma0
). This is a problem... I do not know how to solve it (I am not used to using the__dir__
and__getattr__
).