-
Notifications
You must be signed in to change notification settings - Fork 308
Enhancement: WIP: create_profile no longer computes extrema when we provide override_bins
#5184
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
Draft
mabruzzo
wants to merge
4
commits into
yt-project:main
Choose a base branch
from
mabruzzo:improve-create_profile
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
504fee4
refactor error-checking for extrema and override_bins within create_p…
mabruzzo 480333f
create_profile now examines override_bins before extrema
mabruzzo 70e1299
don't compute extrema when we provide override_bins
mabruzzo e72c514
remove a few unused lines of code
mabruzzo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Note to reviewers: This is mostly for posterity. I don't think we should deal with this issue in this PR (since this PR is focused on not changing observable behavior). I plan to make an issue for this after the PR is reviewed
I think we should probably change the if-statement to:
OR
As the comments mention, both choices technically change the behavior when one of the extrema is a
0and the other is aNone, but I think the existing behavior is probably a bug. The former option is more backwards compatible while the latter option is more consistent with the rest of our extrema handling.For more context, the following table whether various choices for the extrema argument are considered valid, when bin_fields is
[("gas", "velocity_x"), ("gas", "density")]{("gas","velocity_x"): (0.0, None)}{("gas","velocity_x"): None, ("gas", "density"): None}{("gas","velocity_x"): (None, None), ("gas", "density"): (None, None)}{("gas","velocity_x"): (0.0, None), ("gas", "density"): (None, None)}{("gas","velocity_x"): None, ("gas", "density"): (1e-27, 1e-23)}{("gas","velocity_x"): (None,None), ("gas", "density"): (1e-27, 1e-23)}Importantly: The starred cases treat are scenarios that the snippets would fix. In those cases, the existing logic totally ignores the fact that the caller specifies that the lower extrema for
("gas","velocity")is 0.0 and acts like it was set toNone. Furthermore, the existing logic causes the function to behave completely differently for the following cases:{("gas","velocity_x"): (-1.0, None)}(this is considered to be invalid){("gas","velocity_x"): (1.0, None), ("gas", "density"): (None, None)}{("gas","velocity_x"): (0.0, None), ("gas", "density"): (None, 1e-20)}.