UCL / rsd-engineeringcourse

Course materials for Research Software Engineering course.
http://github-pages.ucl.ac.uk/rsd-engineeringcourse/
Other
108 stars 97 forks source link

Monte Carlo example issues #88

Open mattagape opened 5 years ago

mattagape commented 5 years ago
  1. what do we mean by density?

  2. In MonteCarlo::random_agent(), what does enumerate() do?

  3. In energy(), what is the coefficient for? It doesn't seem to be Beta, the coefficient mentioned above.

  4. In accept_change(), how do we know that we should implement the following line? return exp(-(successor - prior) / self.temperature) > uniform()

  5. What does this do? import sys sys.path.append('DiffusionExample')

  6. In def test_move_particle_one_over(): "change" should be "changed"

  7. In same function, what does multiply.reduce do?

  8. In def test_equal_probability(): energy = MagicMock() But in def test_accept_change(): energy = MagicMock Do the missing brackets matter?

  9. In def test_equal_probability(): It looks like changes_at_zero is a list of booleans. I'm not sure what the next line is doing or how: assert count_nonzero(changes_at_zero),etc.

  10. In def test_accept_change(): please explain the final assertion.

NB Maybe some of this code isn't essential to be understood line-by-line??

  1. In def test_main_algorithm(): I don't really understand what the Mocks are doing with their side effects This relates to issue 86

  2. Error at end of page - UsageError: Cell magic %%cmd not found. - presumably it should be %%bash, although if we're not going to be using notebooks I guess this error doesn't matter

ageorgou commented 5 years ago