Increasing pyMBE interoperability (part I) - #151
Conversation
…ass when the pymbe class is instantiated
… to ParticleInstance class
…le_position,inst._particle_fix to _get_instances_df method
- create_espresso_bond_instance -_create_hydrogel_chain - create_hydrogel -_get_espresso_bond_instance - create_added_salt - create_counterions - create_bond -create_particle -create_residue -create_molecule -create_protein add methods to enable the decoupling: -set_simulation_engine -add_instances_to_engine
- algorithm to add instances to espresso system
…ows to the instance dataframe
…type in config class in order to be able to set the position as NDarrays
…presso from pymbe
_create_hydrogel_chain _delete_particles_from_engine calculate_net_charge center_object_simulation_box create_counterions create_hydrogel create_particle delete_instances_in_system Add methods: change_volume_and_rescale_particles update_instances_ids_according_to_engine_particle_ids
…t the missing particles from pymbe DB and the particles that have not been transferred yet to espresso. Add methods _add_bond, _add_particle,_check_particle_exists_in_espresso,_get_last_particle_id_in_espresso,update_instances_ids_according_to_engine_particles_ids
…ase_csv and _save_database_csv Add added_to_engine for pmb_type bond in _load_database_csv and _save_database_csv. This methods still have to pass the test due float point accuracy between save/load
…e, particle_id,position and added_to_engine. Add pymbe type bond and allowed particle_id1,particle_id2 and added_to_engine
The main modification consists on setting as the simulation engine espresso and adding to the simulation engine the instances (particles and bonds ) to the engine. Also removing espresso as an argument from pymbe methods. Adding box_l as argument to pymbe methods
-reaction_montecarlomethods -determine_reservoir_concentrations Migrate methods the following methods to the manager: -propose_unused_types -get_lj_parameters -get_radius_map -_get_label_id_map
- handy functions - reaction methods
- calculate_center_of_mass -determine_reservoir_concentrations
…ys and lists into the instances dataframe
-get_label_id_map -get_lj_parameters -get_radius_map -propose_unused_type
Add methods descriptions,remove unused import
Modify default value for fix=False. As fix=[False,False,False] is considered as a dangerous default value for pylint. Modify if/else chain ,that raised different exceptions depending on the instantiated simulation Engine, in class pymbe_library methods implemented by espresso by simulation_engine.method
|
@pm-blanco @jngrad For ESPREsSO 4.2.2, all tests are passing, but they last longer than 300s and the last test 26/26 is not being executed. Did this happened before? |
|
There seems to be an issue with how |
|
@jorch28 we have already updated the runner pipeline in the main pyMBE-dev repo, can you merge it here and see if now the tests pass? |
|
Now, for version 5.0.1 seems that there is no error related to import espressomd anymore. Thank you for your very fast answer! I'm going to add the method _check_bond_input to the LammpsSimulationEngine that is missing and therefore is not complying with the contract setup by the interface. |
…0.1 (which is compatible with EspressoSystem5.0.0 version)
|
Here is a blueprint for testing the LAMMPS engine in CI: jngrad/pyMBE@40ad03ca61. One could adapt existing test cases to run with both ESPResSo and LAMMPS (in this case, move the LAMMPS isn't available in foss/2025a yet. |
…eprecation warnings, reach full coverage, add docs to tests
|
@jngrad @jorch28 I addressed all of our review comments and cleaned up a number of other pending issues I found while addressing the others. I think that now it should be close or ready to be merged, but please take a look so we can merge it ASAP. I removed the duplicated functions with the custom deprecation warnings because I do not think that makes sense to maintain an obsolete API when we are close to deploy a new release to pyMBE in any case. |
Summary
Application of the strategy pattern to delegate the responsability of executing the simulation engine to a particular engine class (e.g
EspressoEngine).Added
EspressoEngineClassEspressoSystemProtocolClass to check that an the working engine corresponds to espresso.system instanceEspressoEngineEspressoEnginecalculate_net_charge,change_volume_and_re-scale_particles,enable_motion_of_rigid_object,etc.)add_instances_to_engineto add particles, bonds and angles to EspressoModified
create_particle,create_residue,create_molecule,etc. to avoid an explicit dependence to EspressoFixed
In commit: 217d15a
DiamondLattice. box_l=(self.mpc+1)*self.bond_l.magnitude / (np.sqrt(3)*0.25)_create_hydrogel_chain. backbone vector=vec_between_nodes / (self.lattice_builder.mpc+1)