Skip to content

Conversation

@pm-blanco
Copy link
Collaborator

@pm-blanco pm-blanco commented Nov 7, 2025

Solves #117

Changed

  • Methods that interact directly with the pyMBE dataframe are now private and stored in a dedicated module in storage/df_management. These methods also have been refactored to be stateless methods, i.e. making it impossible for them to change behavior during the pyMBE object lifetime or for the user to change the pyMBE dataframe unless explicitely calling them. This includes the methods: add_bond_in_df, add_value_to_df, assign_molecule_id, check_if_df_cell_has_a_value, check_if_name_is_defined_in_df, check_if_multiple_pmb_types_for_name, clean_df_row, clean_ids_in_df_row, copy_df_entry, create_variable_with_units, convert_columns_to_original_format, convert_str_to_bond_object, delete_entries_in_df, find_bond_key, setup_df.
  • define_particle_entry_in_df is now a private method in pyMBE, as it is a convenience method for internal use.
  • The custom NumpyEncoder is now a private class in the private module storage/df_management because it is only internally used in pyMBE for serialization/deserialization.

@jngrad this PR implies changes in many lines since I moved a lot of functions to the new module dedicated to the management of the pyMBE dataframe, but otherwise I have not changed the behaviour of pyMBE.

@pm-blanco pm-blanco added this to the pyMBEv2.0.0 milestone Nov 7, 2025
@pm-blanco pm-blanco requested a review from jngrad November 7, 2025 18:28
@pm-blanco pm-blanco self-assigned this Nov 7, 2025
@pm-blanco pm-blanco changed the title Df management Hide internal methods for df management from the API and make them stateless Nov 7, 2025
jngrad
jngrad previously approved these changes Nov 10, 2025
Copy link
Member

@jngrad jngrad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Co-authored-by: Jean-Noël Grad <jgrad@icp.uni-stuttgart.de>
pm-blanco and others added 4 commits November 10, 2025 12:01
Co-authored-by: Jean-Noël Grad <jgrad@icp.uni-stuttgart.de>
Co-authored-by: Jean-Noël Grad <jgrad@icp.uni-stuttgart.de>
Co-authored-by: Jean-Noël Grad <jgrad@icp.uni-stuttgart.de>
Co-authored-by: Jean-Noël Grad <jgrad@icp.uni-stuttgart.de>
@pm-blanco pm-blanco merged commit bde39e0 into pyMBE-dev:main Nov 10, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants