InstituteforDiseaseModeling / laser-measles

Measles model implementations based on LASER toolkit.
MIT License
1 stars 1 forks source link

not a bug? running with numpy 2.0.2 #7

Open krosenfeld-IDM opened 15 hours ago

krosenfeld-IDM commented 15 hours ago

I'm a bit confused whether or not laser-measles is compatible with numpy>=2.0.

I was installing laser-measles from git and numpy 2.0.2 is installed automatically:

@krosenfeld-IDM ➜ /workspaces/laser-measles-nga-state-2024 (main) $ poetry add laser-measles@git+https://github.com/InstituteforDiseaseModeling/laser-measles.git#v0.5.0
Creating virtualenv src-Q961pCLN-py3.12 in /home/vscode/.cache/pypoetry/virtualenvs

Updating dependencies
Resolving dependencies... (20.6s)

Package operations: 29 installs, 0 updates, 0 removals

  - Installing numpy (2.0.2)
  - Installing six (1.16.0)
  - Installing certifi (2024.8.30)
  - Installing contourpy (1.3.0)
  - Installing cycler (0.12.1)
  - Installing fonttools (4.55.0)
  - Installing iniconfig (2.0.0)
  - Installing kiwisolver (1.4.7)
  - Installing llvmlite (0.43.0)
  - Installing packaging (24.2)
  - Installing pillow (11.0.0)
  - Installing pluggy (1.5.0)
  - Installing pyparsing (3.2.0)
  - Installing python-dateutil (2.9.0.post0)
  - Installing pytz (2024.2)
  - Installing tzdata (2024.2)
  - Installing click (8.1.7)
  - Installing matplotlib (3.9.2)
  - Installing numba (0.60.0)
  - Installing pandas (2.2.3)
  - Installing polars (1.14.0)
  - Installing pyogrio (0.10.0)
  - Installing pyproj (3.6.1)
  - Installing pytest (8.3.3)
  - Installing shapely (2.0.6)
  - Installing tqdm (4.67.0)
  - Installing geopandas (1.0.1)
  - Installing laser-core (0.0.3 02b4c43)
  - Installing laser-measles (0.5.0 136ec9c)

However the code seems to be fine running:

src-py3.12@krosenfeld-IDM ➜ /workspaces/laser-measles-nga-state-2024 (main) $ measles
Using `365` for parameter `nticks` from the command line…
Using `20241107` for parameter `seed` from the command line…
Using `False` for parameter `verbose` from the command line…
Using `True` for parameter `viz` from the command line…
Using `False` for parameter `pdf` from the command line…
Using `None` for parameter `output` from the command line…
2024-11-22 01:16:30.600342: Creating the measles model…
Initializing the measles model with 39 patches…
Assigning day of year of birth to agents…
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 21/21 [00:00<00:00, 94.09it/s]
Adding agents to the non-disease death queue…
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 8942/8942 [00:00<00:00, 173977.93it/s]
2024-11-22 01:16:31.723129: Running the measles model for 365 ticks…
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 365/365 [00:07<00:00, 46.71it/s]
Completed the measles model at 2024-11-22 01:16:39.537567…

and I confirm that numpy is 2.0.2

src-py3.12@krosenfeld-IDM ➜ /workspaces/laser-measles-nga-state-2024 (main) $ python -c "import numpy; print(numpy.__version__)"
2.0.2
krosenfeld-IDM commented 11 hours ago

fixed with https://github.com/krosenfeld-IDM/laser-measles/commit/fb082b08e7ea40b5b1191a0a9e1acb4bca44f6ed poetry was having trouble with the declared dependencies (and was even installing the wrong version of laser-core):

laser-measles 0.5.0 Spatial models of measles implemented with the LASER toolkit.
├── click *
│   └── colorama * 
├── geopandas *
│   ├── numpy >=1.22 
│   ├── packaging * 
│   ├── pandas >=1.4.0 
│   │   ├── numpy >=1.22.4 (circular dependency aborted here)
│   │   ├── numpy >=1.23.2 (circular dependency aborted here)
│   │   ├── numpy >=1.26.0 (circular dependency aborted here)
│   │   ├── python-dateutil >=2.8.2 
│   │   │   └── six >=1.5 
│   │   ├── pytz >=2020.1 
│   │   └── tzdata >=2022.7 
│   ├── pyogrio >=0.7.2 
│   │   ├── certifi * 
│   │   ├── numpy * (circular dependency aborted here)
│   │   └── packaging * (circular dependency aborted here)
│   ├── pyproj >=3.3.0 
│   │   └── certifi * (circular dependency aborted here)
│   └── shapely >=2.0.0 
│       └── numpy >=1.14,<3 (circular dependency aborted here)
├── laser-core rev v0.0.3
│   ├── click * 
│   │   └── colorama * 
│   ├── matplotlib * 
│   │   ├── contourpy >=1.0.1 
│   │   │   └── numpy >=1.23 
│   │   ├── cycler >=0.10 
│   │   ├── fonttools >=4.22.0 
│   │   ├── importlib-resources >=3.2.0 
│   │   │   └── zipp >=3.1.0 
│   │   ├── kiwisolver >=1.3.1 
│   │   ├── numpy >=1.23 (circular dependency aborted here)
│   │   ├── packaging >=20.0 
│   │   ├── pillow >=8 
│   │   ├── pyparsing >=2.3.1 
│   │   └── python-dateutil >=2.7 
│   │       └── six >=1.5 
│   ├── numba * 
│   │   ├── llvmlite ==0.43.* 
│   │   └── numpy >=1.22,<2.1 (circular dependency aborted here)
│   ├── numpy * (circular dependency aborted here)
│   ├── pandas * 
│   │   ├── numpy >=1.22.4 (circular dependency aborted here)
│   │   ├── numpy >=1.23.2 (circular dependency aborted here)
│   │   ├── numpy >=1.26.0 (circular dependency aborted here)
│   │   ├── python-dateutil >=2.8.2 (circular dependency aborted here)
│   │   ├── pytz >=2020.1 
│   │   └── tzdata >=2022.7 
│   ├── polars * 
│   ├── pytest * 
│   │   ├── colorama * (circular dependency aborted here)
│   │   ├── exceptiongroup >=1.0.0rc8 
│   │   ├── iniconfig * 
│   │   ├── packaging * (circular dependency aborted here)
│   │   ├── pluggy >=1.5,<2 
│   │   └── tomli >=1 
│   └── tqdm * 
│       └── colorama * (circular dependency aborted here)
├── numpy *
├── pandas *
│   ├── numpy >=1.22.4 
│   ├── numpy >=1.23.2 (circular dependency aborted here)
│   ├── numpy >=1.26.0 (circular dependency aborted here)
│   ├── python-dateutil >=2.8.2 
│   │   └── six >=1.5 
│   ├── pytz >=2020.1 
│   └── tzdata >=2022.7 
└── tqdm *
    └── colorama *