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

Test particle selections #2577

Closed

Conversation

matthewturk
Copy link
Member

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.

@matthewturk matthewturk added bug demeshening Removing the global mesh for particles index: particle labels May 5, 2020
@matthewturk matthewturk added this to the 4.0 milestone May 5, 2020
@matthewturk matthewturk added this to In progress in yt-4.0 release via automation May 5, 2020
Copy link
Member

@munkm munkm left a 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.

yt/frontends/gadget/tests/test_outputs.py Outdated Show resolved Hide resolved
yt/testing.py Show resolved Hide resolved
yt/testing.py Show resolved Hide resolved
@matthewturk
Copy link
Member Author

Fido should show errors on these, but it doesn't seem to be running!

@matthewturk
Copy link
Member Author

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)
Copy link
Member

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)
Copy link
Member

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?

Copy link
Member Author

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.

@matthewturk
Copy link
Member Author

This adds a few more failing tests and I'm working on an update to #2575 to address them.

@matthewturk
Copy link
Member Author

I'm going to merge this into #2575 to manage it all together.

@matthewturk matthewturk closed this May 7, 2020
yt-4.0 release automation moved this from In progress to Done May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug demeshening Removing the global mesh for particles index: particle
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants