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

Submodule plots is in __all__ but not imported in __init__.py #109

Open
SkirOwen opened this issue Jun 14, 2024 · 1 comment
Open

Submodule plots is in __all__ but not imported in __init__.py #109

SkirOwen opened this issue Jun 14, 2024 · 1 comment

Comments

@SkirOwen
Copy link

Hi,

This might be deliberate but it seems that the submodule plots is not imported in the __init__.py but is included in __all__.
I can see there are some optional dependencies for some of the functions but their imports are only inside the concerned functions.

That means that if someone wants to use the plots submodule they would need to explicitly import it, which seems a bit strange when the documentation has this:

import cmocean
cmocean.plots.plot_gallery()

Which currently gives:

AttributeError: module 'cmocean' has no attribute 'plots'
@kthyng
Copy link
Contributor

kthyng commented Jul 5, 2024

I'm sorry I saw these come in initially but forgot to reply!

It was intentional to not import plots in __init__ since it has extra dependencies. However, you are correct that then the docs don't demonstrate the you'd need to explicitly import it. If you can untangle how to build the docs, I'd appreciate you fixing that! It'll probably be awhile before I get to it otherwise, but I'll do it next time I'm working on them.

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

2 participants