Skip to content

Replace the pyMBE Pandas dataframe for a canonical pyMBE database#147

Open
pm-blanco wants to merge 55 commits intopyMBE-dev:mainfrom
pm-blanco:change_storage
Open

Replace the pyMBE Pandas dataframe for a canonical pyMBE database#147
pm-blanco wants to merge 55 commits intopyMBE-dev:mainfrom
pm-blanco:change_storage

Conversation

@pm-blanco
Copy link
Collaborator

@pm-blanco pm-blanco commented Feb 10, 2026

Fixes #146, #123 and #18 :

Added

  • Introduced a canonical pyMBE database backend replacing the previous monolithic Pandas DataFrame storage approach. This lays the foundation for more robust, extensible, and normalized data handling across pyMBE.
  • Added support to define reaction templates in the pyMBE database.
  • Utility functions to cast information about templates and instances in the pyMBE database into pandas dataframe pmb.get_templates_df, pmb.get_instances_df and pmb.get_reactions_df.
  • Utility functions to load and save the new database via the pyMBE API, pmb.save_database and pmb.load_database.
  • Added functions to define particle states: pmb.define_particle_states and pmb.define_monoprototic_particle_states.
  • Added utility functions in lib/handy_functions to define residue and particle templates for aminoacids en peptides .and residues: define_protein_AA_particles, define_protein_AA_residues and define_peptide_AA_residues.

Changed

  • Refactored core modules to use the new database schema based on templates and instances for particles, residues, molecules, hydrogels, proteins and peptides.
  • Particle states now are independent templates and are now disentangled from particle templates.
  • Pka values are now stored as part of chemical reactions and no longer an attribute of particle templates.
  • Amino acid residue templates are no longer defined internally in define_peptide and define_protein. Those definitions are now exposed to the user.
  • Molecule templates now need to be defined to be used as templates for hydrogel chains in hydrogels.

Fixed

  • Utility methods get_particle_id_map, calculate_HH, calculate_net_charge, center_object_in_simulation_box now support all template types in pyMBE, including hydrogels. Some of these methods have been renamed to expose directly in the API this change in behavior.

Removed

  • Method add_bonds_to_espresso has been removed from the API. pyMBE now adds bonds internally to ESPResSo when molecule instances are created into ESPResSo.
  • Tutorial lattice_builder.ipynb has been removed because its content is redundant with sample script build_hydrogel.py.

Documentation

  • Cleaned and standardized documentation.

Tests

  • Modernized molecule tests and LJ tests.

@pm-blanco pm-blanco self-assigned this Feb 10, 2026
@pm-blanco pm-blanco added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request code quality labels Feb 10, 2026
@pm-blanco pm-blanco added this to the pyMBEv2.0.0 milestone Feb 10, 2026
@pm-blanco pm-blanco requested a review from 1234somesh February 10, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working code quality documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The pyMBE dataframe is monolithic Utility functions in pyMBE should support hydrogels Save reactions in the pmb_df

1 participant