plumed / plumed2

Development version of plumed 2
https://www.plumed.org
GNU Lesser General Public License v3.0
324 stars 269 forks source link

PyCV - calling python within plumed #996

Closed Iximiel closed 6 months ago

Iximiel commented 7 months ago
Description

The original work and ideas for PyCV are of @tonigi

This is the (draft) PR for PyCV.

PyCV gives the user the possibility to write a CV or a function in Python, with the possibility to use Python packages (like jax, sci-kit, etc..), while having access to some capability of plumed.

PyCV is a plug-in that can be LOADed in plumed.

Before setting this PR as ready to review some checks are needed:

Target release

I would like my code to appear in release 2.10

Type of contribution
Copyright
Tests
codecov-commenter commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (ee93ec2) 84.11% compared to head (1486479) 84.10%. Report is 91 commits behind head on master.

:exclamation: Current head 1486479 differs from pull request most recent head 2111ea0. Consider uploading reports for the commit 2111ea0 to get more accurate results

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #996 +/- ## ========================================== - Coverage 84.11% 84.10% -0.02% ========================================== Files 602 602 Lines 56092 56230 +138 ========================================== + Hits 47183 47291 +108 - Misses 8909 8939 +30 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Iximiel commented 7 months ago

I have modified the CI to also run the PyCV tests, but only for the linux test:

I do not know if adding another identical compilation to the linux wf is a good idea, but was the fastest set up possible.

I tried to be the less invasive possible, but as you can see Rocky linux has been changed a bit: yum insalls a python that cannot be linked with pithon3-config --ldflags --embed and so I modified the container recipe to install it.

Both for Fedora and Rocky I modified the the CI by adding a new Docker recipe that uses the previously compiled image to run pycv with the tests, this is more portable and the CI will be more clear if only PyCV fails

I see there are some conflict that are not possible to solve in the online editor, I will rebase this branch on master and then propose a non-draft PR. Also, the merging https://github.com/plumed/plumed2/tree/autoconf-dladdr of makes the use of LOAD GLOBAL obsolete