brightway-lca / brightway2-data

Tools for the management of inventory databases and impact assessment methods. Part of the Brightway LCA framework.
https://docs.brightway.dev/
BSD 3-Clause "New" or "Revised" License
8 stars 21 forks source link

`np.bool` dropped in numpy version 1.24 #117

Closed Zoophobus closed 1 year ago

Zoophobus commented 1 year ago

Okay, this is an annoying but gratefully simple issue. The guys behind numpy have just released version 1.24 and in this version they've dropped numpy.bool. So on new installs all references to numpy.bool break, this should probably be reverted to use the standard library version, but in the mean time we (the guys over at the Activity Browser) are just pegging the numpy version to 1.23.5.

marc-vdm commented 1 year ago

@cmutel, I wanted to start fixing this, but it seems this repo is not up to date (latest tag is 3.6.1 while the latest conda version is 3.6.5 and no np.bool is used anywhere).

Where can we find the repo, or what do I understand wrong here?

michaelweinold commented 1 year ago

...it seems this repo is not up to date (latest tag is 3.6.1 while the latest conda version is 3.6.5 and no np.bool is used anywhere).

It seems the GitHub release tags for bw2data, and the PyPi version (on which the conda-forge release is based) are out of sync.

@cmutel, can you add the proper release tags to the GitHub repository?

cmutel commented 1 year ago

I added the tag 3.6.5 to the latest commit which already had the commit message 3.6.5 (make sure you are working on the legacy branch). Hope this makes everyone happy, the systematic use of tags is a new thing for Brightway and so there shouldn't be an expectation that they will appear across all libraries and branches.

marc-vdm commented 1 year ago

Are you still taking PRs to the legacy branch?

Without either fixing numpy=1.23.5 or replacing np.bool with bool Brightway2 is unuseable (out of the box at least). It's no hassle for me to make the PR, just one question:

Should I then also bump the tag to 3.6.6 and would that work with Brightway2, or would I need to make changes there too? Just occured to me: I don't have write permissions, so I don't even know if I can bump tags, perhaps @michaelweinold would need to do that.

cmutel commented 1 year ago

Are you still taking PRs to the legacy branch?

Yes, of course, and still making 3.X releases.

Should I then also bump the tag to 3.6.6

No, but I can add the 3.6.6 tag; you should change the version in __init__.py, and we will also make a new release of brightway2 on pypi and anaconda.

cmutel commented 1 year ago

Fixed in 3.6.6 release

massimopizzol commented 6 months ago

Just tried a fresh installation of bw2 using instructions from website (MacOs) conda create -n bw -c cmutel -c conda-forge brightway2_nosolver jupyterlab scikit-umfpack After install when doing import brightway2 as bw got the np.bool error. Found this page, downgraded the environement numpy with conda install numpy=1.23.5. and problem was solved. It's weird that one gets an error immediately after a fresh install. Would be good to flag this on the main bw page or change the installation line so it specifies directly the right numpy version for the environment - in my experience other less python-savvy users might not solve this so easily.

marc-vdm commented 6 months ago

The install instructions for brightway 2 environments are currently broken according to one of our users (https://github.com/LCA-ActivityBrowser/activity-browser/issues/1232)

conda create -n ENV_NAME -c conda-forge brightway2=2.4 did still work last time I tried.

michaelweinold commented 6 months ago

@massimopizzol, you're right - it does seem that this has not been resolved (but I found out what the issue is 🔮✨)

Installing the environment according to your conda command, we end up with the 3.6.5 version of bw2data (where the np.bool data type is still present): deptree.txt

This is odd, because the requirements.txt of the brightway2 metapackage does not specify a version. The recipe.yaml of the conda feedstock does pin bw2data to 3.6.6...

...except this new recipe did not make it into the conda repository. My guess is that the auto-build failed.

So all that @cmutel needs to do is to trigger the conda build - then we're good!

PGjedde commented 6 months ago

Hi bright people, I am the AB user who couldn't install. Thank you for looking into it :)