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

fix(SlidingWindowFeature): fix PNG render with one feature #97

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

wreald
Copy link

@wreald wreald commented Apr 22, 2024

plt.subplots() when called without explicitly setting the squeeze argument to False will try to squeeze out extra dimensions from the returned axes ndarray. Currently the code relies on this behaviour to get a 1-dimensional array when we pass in a hardcoded value of 1 for ncols, but does not count on this squeezing out all dimensions and returning a single Axes object when the (non-hardcoded) nrows is also 1.

To fix this we set the squeeze argument to False and manually call .flatten() on the returned ndarray, to ensure we always get an exactly 1D array of Axes out.

`plt.subplots()` when called without explicitly setting the `squeeze` argument
to False will try to squeeze out extra dimensions from the returned `axes`
ndarray. Currently the code relies on this behaviour to get a 1-dimensional
array when we pass in a hardcoded value of 1 for `ncols`, but does not count on
this squeezing out *all* dimensions and returning a single `Axes` object when
the (non-hardcoded) `nrows` is also 1.

To fix this we set the `squeeze` argument to False and manually call
`.flatten()` on the returned ndarray, to ensure we always get an exactly 1D
array of Axes out.
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

Successfully merging this pull request may close these issues.

1 participant