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

Tests in bmm/src/tests/test_smc.py fail with AttributeError #3

Closed
matt-graham opened this issue Sep 21, 2021 · 2 comments
Closed

Tests in bmm/src/tests/test_smc.py fail with AttributeError #3

matt-graham opened this issue Sep 21, 2021 · 2 comments

Comments

@matt-graham
Copy link

Submitting as part of JOSS review openjournals/joss-reviews/issues/3651

Running

python bmm/src/tests/test_smc.py

results in two test failures in TestUpdateParticlesPF.test_update and TestUpdateParticlesBSi.test_update, in both cases due to similar AttributeError instances

Traceback (most recent call last):
  File "bmm/bmm/src/tests/test_smc.py", line 102, in test_update
    updated_particles = smc.update_particles_flbs(self.graph,
  File "bmm/bmm/src/inference/smc.py", line 250, in update_particles_flbs
    out_particles.time_intervals = np.append(out_particles.time_intervals, time_interval)
AttributeError: 'MMParticles' object has no attribute 'time_intervals'
Traceback (most recent call last):
  File "/bmm/bmm/src/tests/test_smc.py", line 102, in test_update
    updated_particles = smc.update_particles_flbs(self.graph,
  File "bmm/bmm/src/inference/smc.py", line 250, in update_particles_flbs
    out_particles.time_intervals = np.append(out_particles.time_intervals, time_interval)
AttributeError: 'MMParticles' object has no attribute 'time_intervals'
@SamDuffield
Copy link
Owner

Thanks - fixed to create an empty time_intervals if it hasn't been initiated yet (as is common at the start of a trip)

@matt-graham
Copy link
Author

All tests now run successfully and pass for me.

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

No branches or pull requests

2 participants