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
Test particle selections #2577
Test particle selections #2577
Conversation
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.
Not quite done with my review but these are my thoughts so far.
Fido should show errors on these, but it doesn't seem to be running! |
So Fido's not testing these after all, so the failures won't show up. But they are real! :) |
hsml = {} | ||
for data_file in ds.index.data_files: | ||
for ptype, pos_arr in ds.index.io._yield_coordinates(data_file): | ||
particles.setdefault(ptype, []).append(pos_arr) |
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.
I haven't come across setdefault
before, nice!
psc = ParticleSelectionComparison(ds) | ||
|
||
sp1 = ds.sphere("c", (0.1, "unitary")) | ||
assert_equal(psc.compare_dobj_selection(sp1) , True) |
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.
Not necessary to change, but this could just be assert psc.compare_dobj_selection(sp1)
, right?
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.
Yes, it could -- I can't remember now why I used this.
This adds a few more failing tests and I'm working on an update to #2575 to address them. |
I'm going to merge this into #2575 to manage it all together. |
This adds a helper function to manually test particle selections. I've also implemented it for the
snapshot_033
dataset.Until #2575 goes in, this will fail. When #2575 goes in, it should pass.