Skip to content

Add a hydrogel builder #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 45 commits into from
May 9, 2025
Merged

Conversation

1234somesh
Copy link
Contributor

@1234somesh 1234somesh commented Nov 17, 2024

Added

  • New benchmark for hydrogels, including scripts to reproduce the data samples/Landsgesell2022/run_simulations.py and samples/Landsgesell2022/plot_pH_vs_alpha.py and samples/Landsgesell2022/plot_P_vs_V.py
  • New sample scripts for hydrogels samples/build_hydrogel.py and samples/weak_polyacid_hydrogel_grxmc.py
  • New methods to support building hydrogels with pyMBE pmb.define_hydrogel, pmb.create_hydrogel, pmb.initialize_lattice_builder, pmb.create_chain, pmb.create_node.

adding hydrogel feature

pyMBE.py - not sure why it was left out
@pm-blanco pm-blanco added the enhancement New feature or request label Nov 18, 2024
@pm-blanco pm-blanco changed the title hydrogel feature in pyMBE.py draft: hydrogel feature in pyMBE.py Nov 18, 2024
@pm-blanco pm-blanco changed the title draft: hydrogel feature in pyMBE.py draft: add a hydrogel builder Nov 18, 2024
Copy link
Collaborator

@pm-blanco pm-blanco left a comment

Choose a reason for hiding this comment

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

In general, I really like the shape this feature is taking. Currently, it is restricted to only diamond lattice topologies. However, this implementation already allows to build many interesting systems, so I think that we can keep it like this for this PR and work to generalize in further steps. I have several minor comments in specific lines and some other more conceptual ones that we can discuss during our dev meeting. Thank you for your work @1234somesh!

@pm-blanco pm-blanco added this to the pyMBE 1.0.0 milestone Jan 10, 2025
@1234somesh 1234somesh changed the title draft: add a hydrogel builder Add a hydrogel builder Feb 12, 2025
Copy link
Collaborator

@pm-blanco pm-blanco left a comment

Choose a reason for hiding this comment

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

@1234somesh I think that we are getting closer to merging this PR. Apart from the remaining changes that I commented on above, we only need to:

  1. Finish the functional test and try to optimize it so it runs as fast as possible
  2. Fix the issue with the read and write from the pmb.df
    Point number 2 can be done in a different PR if you finish number 1 before we are able to solve the issue.

@pm-blanco pm-blanco added the documentation Improvements or additions to documentation label Mar 6, 2025
pm-blanco
pm-blanco previously approved these changes May 9, 2025
Copy link
Collaborator

@pm-blanco pm-blanco left a comment

Choose a reason for hiding this comment

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

The new feature is now fully functional and meeting our coding standards. Further developments will be addressed in specific PRs. @jngrad @paobtorres @kosovan just to notify you that this PR is now merged.

@pm-blanco pm-blanco merged commit cb42cc5 into pyMBE-dev:main May 9, 2025
3 checks passed
1234somesh added a commit to 1234somesh/pyMBE that referenced this pull request May 21, 2025
* hydrogel feature in pyMBE.py

adding hydrogel feature

pyMBE.py - not sure why it was left out

* hydrogels-feature refactored

* removed unused variables

* lattice_builder.py - new testsuite WIP

* lattice_builder modified

* new testuites for hydrogel builder

* Fix R installation issue in testsuite.yml

* removed unused variables in hydrogel_builder.py

* refactoring hydrogel builder testsuite for code coverage

* refactoring hydrogel builder testsuite for code coverage

* refactoringhydrogel builder testsuite for code coverage

* refactoringhydrogel builder testsuite for code coverage

* chain_labels and node_labels to identify chains and nodes

* chain_labels and node_labels to identify chains and nodes

* benchmarking Landsgessel's result

* benchmarking Landsgessel's result

* separated analysis and plot scripts

* separated analysis and plot scripts

* remove time series, solve issues during merging

* clean-up unit test, get rid of numpy deprecation warnings

* clean up, add missing refs, start organizing data

* add support to standarize Landsgesell2022 data, small fixes in weak gel

* clean up alpha vs pH plotting script

* clean up Landsgesell scripts and data

* avoid repeated reference data for monovalent salt solution, simply parsing of data

* reorder scripts in samples to comply with the current structure

* improve docs for the reference data, fix issues with new paths, small changes in attributes of the lattice builder library

* improve documentation, finish refactoring the script

* update changelog

* small fixes

* modify points to simulate exactly at the same conditions as Landsgesell

* functional tests

* fix broken line in compaction of the hydrogel

* update code for current routines in main, remove print statements, fix docs, make pylint happy

* functional test refactored

* fix coverage issues, smooth hydrogel compresion in sample

* substitute deprecated np.testing.assert by standard assert

* change method names for clarity

* remove excesive equilibration in hydrogel sample, functional test now runs in 35 min

* update readme to advertise hydrogels

---------

Co-authored-by: Pablo M. Blanco <75744061+pm-blanco@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants