This should solve #1133, the TL;DR is "calling pycv from the python implementation gives problems"
I rewrote the building part of pyCV to look like a python package.
To install it you need plumed available in your path and you just need to use
pip install .
in the pycv dir.
To use it, it is slightly less straightforward (these solution do not work if you installed with pip install -e .):
calling plumed from the shell
When you install with pip you get an extra pycv executable in the bin of the environment. Calling it will print on the shell the path of the .so that contains the pycv actions.
You can copy-paste that path to your plumed.dat and you are ready to go.
calling plumed from python
If you are using plumed in a python script you'll need to have pycv available in the python environment. Then you can get the pycv object to load with:
from pycv import getPythonCVInterface
from plumed import Plumed
...
plmd = Plumed()
...
plmd.cmd("readInputLine",f"LOAD FILE={getPythonCVInterface()}")
...
I need to
[ ] refine this to compile 100% correctly (aka write a "findPLUMED.cmake")
[x] find if there is a more robust way of passing the path
[ ] update the readme
[ ] rewrite its part of the CI (both for the plumed-that-calls-python tests and for the python-calling-plumed-that-calls-python tests)
This will unlikely pass the CI for the first few commits
@GiovanniBussi @tonigi, what do you think?
Target release
I would like my code to appear in release 2.10 or 2.11?
Type of contribution
[ ] changes to code or doc authored by PLUMED developers, or additions of code in the core or within the default modules
[x] changes to a module not authored by you
[ ] new module contribution or edit of a module authored by you
Copyright
[x] I agree to transfer the copyright of the code I have written to the PLUMED developers or to the author of the code I am modifying.
[ ] the module I added or modified contains a COPYRIGHT file with the correct license information. Code should be released under an open source license. I also used the command cd src && ./header.sh mymodulename in order to make sure the headers of the module are correct.
Tests
[x] I added a new regtest or modified an existing regtest to validate my changes.
[ ] I verified that all regtests are passed successfully on GitHub Actions.
Description
This should solve #1133, the TL;DR is "calling pycv from the python implementation gives problems"
I rewrote the building part of pyCV to look like a python package.
To install it you need plumed available in your path and you just need to use
in the pycv dir.
To use it, it is slightly less straightforward (these solution do not work if you installed with
pip install -e .
):calling plumed from the shell
When you install with pip you get an extra
pycv
executable in the bin of the environment. Calling it will print on the shell the path of the .so that contains the pycv actions. You can copy-paste that path to your plumed.dat and you are ready to go.calling plumed from python
If you are using plumed in a python script you'll need to have pycv available in the python environment. Then you can get the pycv object to load with:
I need to
A good number of important projects use scikit-build-core, among them LAMMPS and Cmake, so it is a project destined to remain.
This will unlikely pass the CI for the first few commits
@GiovanniBussi @tonigi, what do you think?
Target release
I would like my code to appear in release 2.10 or 2.11?
Type of contribution
Copyright
COPYRIGHT
file with the correct license information. Code should be released under an open source license. I also used the commandcd src && ./header.sh mymodulename
in order to make sure the headers of the module are correct.Tests