Skip to content

Commit

Permalink
Document NumPy 2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
jngrad committed Nov 29, 2024
1 parent 7c6e1d6 commit 7502091
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `lib.analysis.get_dt` now raises a ValueError if the two first two rows of the dataframe have the same values for the time, which break the subsequent code. (#95)
- Removed global state variables, instead they are now created by the constructor of `pyMBE.pymbe_library`. This prevents two instances of the pyMBE library to share the same memory address for their attributes. (#89)
- Required Python dependency versions compatible with ESPResSo 4.2 (#84)
- NumPy 2, Pandas 2 and the development version of ESPResSo are now fully supported. (#106)
- Fixed several deprecated paths and function names in `tutorials/pyMBE_tutorial.ipynb`. (#77, #78, #79, #80, #81)

## [0.8.0] - 2024-06-18
Expand Down
22 changes: 9 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,21 @@ To set up pyMBE, users need to configure a virtual environment. This is achieved
```sh
python3 -m venv pymbe # create a local folder named pymbe containing the environment files
source pymbe/bin/activate # activate the virtual environment
python3 -m pip install -r requirements.txt
python3 -m pip install -r requirements.txt "numpy<2.0" "pandas<2.0"
python3 maintainer/configure_venv.py --espresso_path=/home/user/espresso/build # please adapt the espresso path accordingly
python3 simulation_script.py # run a simulation script
deactivate # deactivate the virtual environment
```

NumPy 2 users should adapt the pip command as follows:

```sh
python3 -m pip install -r requirements.txt "numpy>=2.1" "pandas>=2.0"
```

We highlight that the path `/home/user/espresso/build` is just an example of a possible path to the ESPResSo build folder.
The user should change this path to match the local absolute path were ESPResSo was installed.
The user should change this path to match the local absolute path where ESPResSo was built.
Also, ESPResSo must be built with the same NumPy version as the one installed in the environment to avoid API version mismatch.
For more details on how to install ESPResSo, please consult the [ESPResSo installation guide](https://espressomd.github.io/doc4.2.2/installation.html).

The pyMBE virtual environment can be deactivated at any moment as follows:
Expand All @@ -107,17 +114,6 @@ module purge
Please note the module files need to be loaded before every activation
of the virtual environment.

NumPy 2 users need to override the version requirements as follows:

```sh
sed -i "/numpy/d" requirements.txt
python3 -m pip install -r requirements.txt "numpy==2.1" "pandas>=2"
```

Please note that for NumPy 2 to be supported, ESPResSo needs to be built
against NumPy 2 too, otherwise it will complain about API version mismatch.
Be aware the testsuite of ESPResSo 4.2 is known to be flaky with NumPy 2.

Now you can use pyMBE and ESPResSo by activating the virtual environment:

```sh
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
numpy>=1.23,<2.0
numpy>=1.23
pandas>=1.5.3
pint>=0.20.01
pint-pandas>=0.3
Expand Down

0 comments on commit 7502091

Please sign in to comment.