Skip to content

support numpy>=2 #490

Closed
Closed

Description

@phi-friday

Is your feature request related to a problem? Please describe.
not yet support numpy>=2

Describe the solution you'd like
in pyproject.toml, numpy = "^1.9.0" -> numpy = ">=1.25"
(Since version 1.25, numpy does not support python<=3.8.)

References or alternative approaches
If this feature was described in literature, please add references here. Additionally, feel free to add descriptions of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Are you able and willing to implement this feature yourself and open a pull request?

  • Yes, I can provide this feature.

Activity

  1. t-muser commented on Jul 8, 2024

    @t-muser
    Member

    Hi @phi-friday,

    thanks for creating this issue. I'm a bit confused, the title of the issue refers to numpy 2.0.0 but the content is about supporting numpy <1.9.0. Can you clear this up for me maybe?

    • Regarding the former, I haven't had the time to check what, if any, adjustments would need to be made to the code.
    • Regarding the latter, I think we intentionally dropped python 3.8 support. @bwheelz36 do you remember why?
  2. bwheelz36 commented on Jul 8, 2024

    @bwheelz36
    Collaborator

    I think numpy or some other dependency was no longer supporting it. But I don't remember very clearly tbh.

    • changes to be made: maybe none. So far the only issues I've had switching to numpy 2 has been in typing (they dropped some deprecated types). someone could check quickly if all our tests pass with numpy 2
    • BUT. I'm not sure it's a good idea to be supporting both numpy 1.x and 2.x as is proposed by @phi-friday. There presumably will be breaking changes between these versions even if they don't currently break this code. Eventually we will have to move to 2, but at that point we should drop support for 1, which will be breaking for most users.

    It's definitely possible right now for users to use this package with numpy 2 with a bit of fiddling. I'd probably prefer to hold off a little longer until upgrading to 2. But I'm open to counter arguments.

  3. bwheelz36 commented on Jul 8, 2024

    @bwheelz36
    Collaborator

    Oh, just saw that indeed all tests are passing. Thanks @phi-friday!

  4. t-muser commented on Jul 8, 2024

    @t-muser
    Member

    Found it!

    I think it's probably not necessary to support 3.8. IF we want to enable numpy 2.0.0, I would opt for numpy = ">1.9.0".

    I'd probably prefer to hold off a little longer until upgrading to 2.

    I agree.

  5. phi-friday commented on Jul 8, 2024

    @phi-friday
    ContributorAuthor

    Hi @phi-friday,

    thanks for creating this issue. I'm a bit confused, the title of the issue refers to numpy 2.0.0 but the content is about supporting numpy <1.9.0. Can you clear this up for me maybe?

    • Regarding the former, I haven't had the time to check what, if any, adjustments would need to be made to the code.
    • Regarding the latter, I think we intentionally dropped python 3.8 support. @bwheelz36 do you remember why?

    According to https://python-poetry.org/docs/dependency-specification/,
    ^1.9 does not support >=2.0.0.

    Found it!

    I think it's probably not necessary to support 3.8. IF we want to enable numpy 2.0.0, I would opt for numpy = ">1.9.0".

    I'd probably prefer to hold off a little longer until upgrading to 2.

    I agree.

    If you're not going to support python<=3.8, why not limit it to >=1.25?

  6. phi-friday commented on Jul 8, 2024

    @phi-friday
    ContributorAuthor

    I think numpy or some other dependency was no longer supporting it. But I don't remember very clearly tbh.

    • changes to be made: maybe none. So far the only issues I've had switching to numpy 2 has been in typing (they dropped some deprecated types). someone could check quickly if all our tests pass with numpy 2
    • BUT. I'm not sure it's a good idea to be supporting both numpy 1.x and 2.x as is proposed by @phi-friday. There presumably will be breaking changes between these versions even if they don't currently break this code. Eventually we will have to move to 2, but at that point we should drop support for 1, which will be breaking for most users.

    It's definitely possible right now for users to use this package with numpy 2 with a bit of fiddling. I'd probably prefer to hold off a little longer until upgrading to 2. But I'm open to counter arguments.

    numpy>=2 has been in the works for a very long time. If you haven't encountered a DeprecationWarning, you should be fine in most cases.

    However, just in case, if you plan to support both v1 and v2, it seems like a good idea to add an action for each.

  7. brendan-whelan-seetreat commented on Jul 8, 2024

    @brendan-whelan-seetreat

    agreed @phi-friday , I think if both versions are being explicitly tested via CI we could support both.

    If we just change to numpy = ">=1.25" as proposed, I think we'd have to do some manual fiddling to make sure numpy <2.0.0 is tested, since I think poetry would install 2.0 for every python version > 3.8.

    So, we could:

    • run the tests as normal
    • then pip uninstall numpy
    • pip install "numpy<2.0.0"
    • then run the tests again

    note that I haven't checked that would work but I think it would

  8. t-muser commented on Jul 8, 2024

    @t-muser
    Member

    You can handle different version with a matrix. There's actually an example for exactly this case in snok/install-poetry's docs.

  9. phi-friday commented on Jul 8, 2024

    @phi-friday
    ContributorAuthor

    You can handle different version with a matrix. There's actually an example for exactly this case in snok/install-poetry's docs.

    #491 (comment)

    I added new action, and it passed all tests.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions