Skip to content

oplot/my.py: vlines() is dead code and still broken (hold= kwarg removed from matplotlib) #10

Description

@thorwhalen

Follow-up from #8's CI migration (PR #7): fixing the module's import nympy as np typo (a copy-paste error) made the file importable again for doctest collection, but the module's one function, vlines, is still broken if actually called.

Problem

`vlines` passes `hold=hold` through to `plt.vlines`:

```python
return plt.vlines(
x, ymin=ymin, ymax=ymax, colors=colors, linestyles=linestyles,
label=label, hold=hold, data=data, **kwargs,
)
```

`hold` was a matplotlib kwarg removed long ago. Verified live against the currently-installed matplotlib (3.11.2):

```python
from oplot.my import vlines
vlines([1, 2, 3])

AttributeError: LineCollection.set() got an unexpected keyword argument 'hold'

```

Scope check

`oplot/my.py` is not imported anywhere: `oplot/init.py` doesn't reference it, and `grep -rn "oplot\.my\|from oplot.my\|from \.my"` across the repo returns nothing. So this doesn't affect any current public API — it's dead code that's now importable-but-still-broken rather than unimportable-and-broken.

Suggested fix

Either drop the `hold=hold` passthrough (and the `hold=None` parameter) entirely, or move the whole module to `scrap/` if it's not meant to be finished.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions