Skip to content

Conversation

@kosovan
Copy link
Collaborator

@kosovan kosovan commented Sep 13, 2024

… removed some examples of bad practice (not all of them yet)

@pm-blanco
Copy link
Collaborator

Solves #92, and partially #94

  • samples/peptide.py: Removed completely legacy logic, running over different pH values. Now it stores the time series for a single input pH value
  • samples/analysis.py: Added a new sample script to post-process time series.
  • testsuite/samples_tests.py: Added a new functional test that triggers samples/peptide.py and samples/analysis.py.
  • lib/analysis.py: Added a new functionality in analyze_time_series, an optional argument that allows ignoring filenames for the analysis.

@pm-blanco pm-blanco changed the title adopted peptide.py to work with the current version of block_analyze,… refactor sample scripts Oct 22, 2024
@pm-blanco
Copy link
Collaborator

pm-blanco commented Oct 22, 2024

Solves #92 and #94

Changed

  • The sample script plot_HH.py has been replaced for specific examples on how to plot data post-processed with pyMBE: plot_branched_polyampholyte.py, plot_peptide.py, and plot_peptide_mixture_grxmc_ideal.py.
  • Sample scripts now take the pH as an argparse input instead of looping over several pH values. This enables paralization of the sample scripts and avoids conflicts with the current post-processing pipeline.

Added

  • New sample script showing how to use the analysis tools in pyMBE for post-processing time series from the sample scripts analyze_time_series.py.
  • A new optional argument ignore_files for lib.analysis.analyze_time_series, enabling to provide a list of files to be ignored for post-processing of time series.
  • Functional testing for all sample scripts.

Fixed

  • lib.analysis.get_dt now raises a ValueError if the two first two rows of the dataframe have the same values for the time, which break the subsequent code.

IMO, this PR is now ready to be merged @kosovan. However, I am no longer qualified to be the reviewer of this PR because I have done a significant portion of the code so I will ask someone else from our dev. team to co-review it.

@pm-blanco pm-blanco requested review from pm-blanco and removed request for pm-blanco October 22, 2024 09:48
@pm-blanco
Copy link
Collaborator

@Zitzeronion if you have the time to take a look into this PR, I would appreciate your comments regarding if the current pipeline works and it is clear to you. I also wrote a README file in the samples folder explaining how to use the sample scripts.

@pm-blanco pm-blanco added documentation Improvements or additions to documentation code quality labels Oct 22, 2024
@pm-blanco pm-blanco added this to the pyMBE 1.0.0 milestone Oct 22, 2024
@pm-blanco pm-blanco added ci-improvement bug Something isn't working labels Oct 22, 2024
@Zitzeronion
Copy link
Contributor

Zitzeronion commented Oct 22, 2024

Hi @pm-blanco and @kosovan, I don't know if I'm the right person to give qualified feedback (I'm a fluid dynamics person with little knowledge on polymers, proteins and constant pH simulations), but I had a look at the changes. I overall like the new samples folder. The split into plotting and computing scripts make sense and run time arguments are a good choice. It is however maybe worth to write a section in the documentation on how use these new scripts (e.g. first compute with script X then plot with script Y).

There are just three things maybe worth changing:

  • In samples/README.md the reference is a footnote while in samples/Beyer2024/README.md it is not.
  • In lib/analysis.py inside the get_dt() function, it is maybe worth to raise an error if time[0] == time[1]. I don't know if that will ever happen, but it would prevent dividing by 0.
  • Last point is more a question, what is the difference between samples/peptide.py and samples/Beyer2024/peptide.py, is it the inclusion of the hydrodynamic radius in the latter? Is it that you need both scripts as one serves as a sample and the other one is referenced in the publication?

I haven't run the scripts but could do that tomorrow if I should.

@pm-blanco
Copy link
Collaborator

@Zitzeronion thank you very much for your quick feedback! Actually, we really appreciate your feedback. As a completely "outsider" to our community, your feedback serves as a very good indicator to see if our documentation and scripts are clear enough to be understandable by the broader community. I will improve the scripts with the changes you suggested.

Regarding your question, you are correct, we have decided to store stable versions of the scripts designed to reproduce the data from our publication in the folder /samples/Beyer2024, both for data reproducibility and for testing. The scripts in samples are meant to be just examples on how to use pyMBE but do not need to reproduce any specific data and therefore we have the flexibility of change samples/peptide.py in the future if we decide to have some more complex model than the one showcased in Beyer2024.

@pm-blanco pm-blanco removed their request for review October 23, 2024 09:49
@pm-blanco pm-blanco requested a review from davidbbeyer October 23, 2024 14:19
@pm-blanco pm-blanco assigned kosovan and pm-blanco and unassigned pm-blanco Oct 23, 2024
@pm-blanco
Copy link
Collaborator

@kosovan @davidbbeyer could you please finish the review of this PR by this week? We need to continue to make progress with the other issues in the library 😄

@davidbbeyer
Copy link
Contributor

@pm-blanco Yes, I was waiting for the review by @kosovan, but the two-week time frame we agreed on will be done by tomorrow. Then I will take care myself.

Copy link
Contributor

@davidbbeyer davidbbeyer left a comment

Choose a reason for hiding this comment

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

Looks good to me apart from some small points. I ran all the tests and it works.

Copy link
Contributor

@davidbbeyer davidbbeyer left a comment

Choose a reason for hiding this comment

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

Looks good!

@pm-blanco pm-blanco merged commit 8b9811c into pyMBE-dev:main Nov 12, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ci-improvement code quality documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants