-
Notifications
You must be signed in to change notification settings - Fork 0
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
Backends #24
Backends #24
Conversation
Codecov ReportAttention: Patch coverage is
|
Do we want to call the MC algorithm |
With |
Following your logic, for an ECMC simulations, shouldn't we call a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great @leonardogalliano, thanks a lot. Thanks for the advice @dcoslo.
Berfore merging I'll try to rewrite the tests in |
Ok thanks 🙏🏻 |
This PR address #14 (comment). Note that this is a major change which breaks compatibility with previous versions.
The key motivation behind this update comes from Daniele’s suggestion:
Simulation
shouldn't be tied to a specific algorithm. In the future, we should be able to extend the code to Molecular Dynamics, Event Chain Monte Carlo or other algorithms.Key changes
To tackle this, I adapted the code by decoupling
Simulation
from its algorithms. BasicallySimulation
now takes a list of algorithms (that can be used for updating the state ofchains
or for storing data), each with its ownscheduler
(i.e. the time steps at which it should be called). This design is inspired by the "Strategy" pattern, making the code very flexible and modular.Compatibility issues
The old scripts in
ParticlesMC
will no longer work with this version. The simulation object must now be created withand run with
Another important point is that the concept of "burn-in steps" has changed: hese steps are now included in the total number of simulation steps rather than being additional steps. Note that the utility function
scheduler
has been renamed tobuild_schedule
and has been updated accordingly.