Skip to content
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

Updating synchronous dynamics #6

Closed
wants to merge 1 commit into from

Conversation

Vitineth
Copy link

@Vitineth Vitineth commented Mar 9, 2021

A friend currently taking the GD5302 was having some trouble getting some examples using SynchronousDynamics to work from the book and asked if I could take a look. I've tried to update synchronous dynamics to match the implementation given in the Epidemic Modelling book and it seems to work successfully on my machine (but will need to wait for continuous integration tests to prove that).
I've updated the calls for perElementEventDistribution and fixedRateEventDistribution to be called against the dynamics of a process instead of the process directly and to pass them the process used to determine the events instead of the current time step. This seems to resolve the attribute errors currently occurring in unit tests and begins to produce successful results for simple models. 83/83 unit tests pass.
While I don't fully understand everything about how this library works, it seems like a fascinating project and look forward to seeing the future developments on it.

In the previous implementation, the calls were being made against `proc` which is the Process which doesn't implement that function. It seems to need to be accessed through the dynamics on this process which resolves an Attribute Error which prevent tests from running. Additionally, the function was previously passed `t` which is the current time step of the simulation but as events are generated from the dynamics on a per-process basis, it needs to be passed the process instead to retrieve the correct set of results.
83 unit tests pass
@Vitineth
Copy link
Author

Vitineth commented Mar 9, 2021

Continuous integration tests against pypy3 seem to be failing but appears to be unrelated to my change? Seems to be a case of missing dependencies on the build environment (h5py/h5py#1461). Seems like hdf5 needs added to the pypy3 environment:

addons:
  apt:
    packages:
      - libhdf5-serial-dev

(copied this from here https://github.com/h5py/h5py/blob/master/.travis.yml#L8-L11 so I don't 100% know if its relevant) but I don't know enough of how travis CI python tests work to confirm any of this

@simoninireland
Copy link
Owner

simoninireland commented Mar 10, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants