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

Strict dependencies could be problematic for larger project #1147

Closed
benoit-cty opened this issue Aug 3, 2022 · 5 comments
Closed

Strict dependencies could be problematic for larger project #1147

benoit-cty opened this issue Aug 3, 2022 · 5 comments

Comments

@benoit-cty
Copy link
Contributor

Hi there!

I really enjoy OpenFisca, but I recently encountered an issue.

Here is what I did:

import plotly to made a plot in a project using OpenFisca-France.

Here is what I expected to happen:

Importing work.

Here is what actually happened:

TypeError: <class 'numpy.typing._dtype_like._SupportsDType'> is not a generic class

Here is data (or links to it) that can help you reproduce this issue:

This is not directly an OpenFisca issue as it comes from xarray (See pydata/xarray#6818) that as a problem with NumPy 1.20.

But it is due to the OpenFisca directive 'numpy >= 1.11, < 1.21', resulting to installation of 1.20.3 from may 2021.

I understand that fixing version is safer for OpenFisca, but when using it

There is no emergency as I solved my problem by downgrading xarray. I just want to let the team know that it can cause problem.

Context

I identify more as a:

  • Developer (I create tools that use the existing OpenFisca code).
@bonjourmauko
Copy link
Member

Hi @benoit-cty , we've been working to update numpy :) All help is welcome. Take a look at #1161

@MattiSG
Copy link
Member

MattiSG commented Dec 13, 2022

Thanks @benoit-cty for taking the time to document this issue.

For the specific case described, I believe indeed the main issue is the severely outdated version of numpy. Upgrades have been stuck after issues cropped up like in #954, and then concerns by major reusers of having to adapt their code. We are now considering specifying that older numpy versions are only supported within either a time (e.g. 18 months) or versions (e.g. last 3) constraint, leaving it to reusers to decide of their own upgrade path, since the current system is not sustainable considering how outdated dependencies are getting.

Through discussion with @maukoquiroga, I believe the best way forward is to have a one-off transition to numpy ≥ 1.20, which will bring typing support and enable easier systematic typing in the codebase. #1168 is a first step in this direction, dropping support for numpy < 1.20 to bring Python 3.8 compatibility.

However, the title of your issue seems to be for a wider set of issues. If you have other suggestions than the ones outlined above for increasing compatibility, please share them here! 😃

@benoit-cty
Copy link
Contributor Author

In #1168 I see that we still restrict to numpy < 1.21 (according to https://pypi.org/project/numpy/#history it's june 2021) why not allow 1.23 for example ? Does it break OpenFisca ?

@bonjourmauko
Copy link
Member

In #1168 I see that we still restrict to numpy < 1.21 (according to https://pypi.org/project/numpy/#history it's june 2021) why not allow 1.23 for example ? Does it break OpenFisca ?

It does. #1168 introduces a way to manually run workflows with newer versions to NumPy, to encourage contributions, and #1161 is a work in progress to support NumPy 1.23.

@benoit-cty
Copy link
Contributor Author

OK, so I think we could close this issue now that it is clear that OpenFisca will try to keep up-to-date max version.

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

No branches or pull requests

3 participants