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

numpy2 support #1912

Closed
joamatab opened this issue Aug 20, 2024 · 7 comments · Fixed by #1913
Closed

numpy2 support #1912

joamatab opened this issue Aug 20, 2024 · 7 comments · Fixed by #1913
Assignees

Comments

@joamatab
Copy link
Contributor

What's the plan for numpy2 support?

@yaugenst-flex
Copy link
Contributor

yaugenst-flex commented Aug 21, 2024

For the most part this is gated by numpy2 support from dependencies, the tidy3d frontend is already numpy2 compatible as far as I can tell (minus two np.trapz calls...). Are there any numpy2-specific features that you need?

@daquinteroflex
Copy link
Collaborator

daquinteroflex commented Aug 21, 2024

Hi Joaquin! Hope you're well.

So if the issue is a packaging/integration one with other packages that require/use 2.0, I'm opening a PR that will loosen the current pyproject.toml requirement. My understanding is the same as Yannick that we already are 2.0 compatible mostly limited by the dependencies on this.

numpy = "<2"

Then just need to make sure tests pass and we'd release it in pypi the next release, either 2.7.3 or 2.8.0 in the next few weeks I believe. If there's anything feature-specific we can also look into that as Yannick mentions.

@momchil-flex
Copy link
Collaborator

I know there was an autograd issue but it seems like they have merged their numpy v2 PR. But yeah we just need to test everything.

@yaugenst
Copy link
Contributor

Note that we would need some logic to call np.trapz or np.trapezoid depending on numpy version.

@agriyakhetarpal
Copy link

Hi there, thanks for the cross-link. We released a new version of Autograd: https://github.com/HIPS/autograd/releases/tag/v1.7.0, which includes NumPy v2 support through the above PR. It will be available via PyPI later in the day.

@jan-david-fischbach
Copy link
Contributor

Hey all,
any other roadblocks, that would need to be addressed?

Regards JD

@yaugenst-flex
Copy link
Contributor

Hey @jan-david-fischbach, this is tracked in #1913 and will (probably?) make it into the next release. However I think current develop should already be fine with numpy 2 (there was only a np.trapz call that was replaced), so if you are willing to install from develop and force upgrade numpy afterward it might just work? No guarantees though 😬

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 a pull request may close this issue.

8 participants