matplotlib / matplotlib/cmocean

Submodule plots is in `__all__` but not imported in `__init__.py`

Open
#109 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
269
Forks
54
PR merge metrics
No merged PRs in 30d

Description

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:

```python
import cmocean
cmocean.plots.plot_gallery()
```

Which currently gives:

```python
AttributeError: module 'cmocean' has no attribute 'plots'
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the package __init__.py and compare its __all__ entry for plots with the documented import example. Verify the current behavior of `import cmocean` followed by `cmocean.plots.plot_gallery()`. Done means the documented access no longer raises AttributeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.