GilsonLabUCSD / pAPRika

Advanced toolkit for binding free energy calculations
BSD 3-Clause "New" or "Revised" License
31 stars 14 forks source link

Progress bars #172

Closed jaketanderson closed 2 years ago

jaketanderson commented 2 years ago

See issue #171.

Here I added progress bars for many functions in analysis. The implementation for the simulation phase is trivial and is demonstrated in the first tutorial. In analysis, many of the for loops were changed to have progress bars. I'm not sure how to include the rich package as a dependency of the pAPRika package... I tried to add it to the paprika-dev conda-env but I assume there's more that needs to be done to make sure the dependency is added.

jaketanderson commented 2 years ago

Looks like the tests are failing due to multiple-live-display errors. To my knowledge, the track function can only be run for one progress bar at a time. I wonder if this is an error that is encountered because the tests are trying to run the functions in analysis.py in a different way than linear way they would be called during normal use. I didn't encounter any issues running multiple sequential progress bars in my experimenting but if the tests suggest otherwise it should be looked into.

slochower commented 2 years ago

Is this because we print out things inside one of the track loops? Do you get the same error if you run it locally?

jaketanderson commented 2 years ago

Is this because we print out things inside one of the track loops? Do you get the same error if you run it locally?

I made the incorrect assumption that each function in the analysis.py file was independent; I added progress bars to functions like run_mbar assuming they would be only called directly by the user, but they are called inside compute_free_energy. The code now has one separate progress bar for each phase of the analysis in compute_free_energy, which is the only function in analysis.py with a progress bar.

This might be a silly questions, but is it possible to run the repository's tests locally?

codecov-commenter commented 2 years ago

Codecov Report

Merging #172 (cc78024) into master (5376f44) will decrease coverage by 0.00%. The diff coverage is 100.00%.

jeff231li commented 2 years ago

This might be a silly questions, but is it possible to run the repository's tests locally?

@jaketanderson yes, you can run the tests locally using pytest. For example, to run the test for analysis modules you run pytest test_analysis.py, or if you want to run a specific test in the test file: pytest test_analysis.py::test_reference_state_work.