plumed / plumed2

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

Changing pycv into a proper python package #1134

Open Iximiel opened 1 month ago

Iximiel commented 1 month ago
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

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


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
Tests
Iximiel commented 1 month ago

It works, but I do not understand and I cannot reproduce locally the segmentation faults that are present in the fedora CI.