Skip to content

Use positional argument name for np.reshape: newshape. #3043

Merged
jgostick merged 5 commits into
PMEAL:devfrom
TKlokgieters:patch-2
Apr 16, 2026
Merged

Use positional argument name for np.reshape: newshape. #3043
jgostick merged 5 commits into
PMEAL:devfrom
TKlokgieters:patch-2

Conversation

@TKlokgieters

@TKlokgieters TKlokgieters commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

in Numpy 2.1 the variable is changed from newshape into shape and from Numpy 2.4 the variable newshape is expired.
#api

#3042

Numpy 2.1 changed variable name to shape. In Numpy 2.4 newshape is definitely removed
Required for newshape name change to shape in np.reshape

Possibly later versions also allowed
@TKlokgieters TKlokgieters marked this pull request as ready for review April 15, 2026 14:24
@TKlokgieters

Copy link
Copy Markdown
Contributor Author

It is possible that a higher version than Numpy 2.2 is allowed, but I do not know how to check for it.

@gerlero

gerlero commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

I'd suggest simply using the argument positionally as:

np.reshape(temp, [len(edges), 2], order="F")

That way it will work regardless of the NumPy version.

Due to positional reshape argument no version constraint necessary
@TKlokgieters

Copy link
Copy Markdown
Contributor Author

Thanks @gerlero that is indeed a cleaner solution. I changed the proposal to follow your suggestion.

@TKlokgieters TKlokgieters changed the title Change variable name of np.reshape, newshape into shape Use positional argument name for np.reshape: newshape. Apr 16, 2026
@jgostick

Copy link
Copy Markdown
Member

Does anyone know why github only ran 2 checks, and none of the tests? It is not showing me an option to 'allow tests' or anything. Must be a setting somewhere?

@jgostick

Copy link
Copy Markdown
Member

Although, since only one line was changed, I'd say it might be safe to skip the tests.

@jgostick jgostick merged commit 90d747b into PMEAL:dev Apr 16, 2026
2 checks passed
@jgostick

Copy link
Copy Markdown
Member

Interestingly, the tests did run, as they are visible in the Actions tab, but the results are just not being reported in this thread. It seems one of the example runs did not pass. I will fix that before merging into release.

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.

3 participants