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

[bugfix] Keep units when setting domain edges for frb datasets. #1659

Merged
merged 2 commits into from
Jan 19, 2018

Conversation

brittonsmith
Copy link
Member

@brittonsmith brittonsmith commented Jan 6, 2018

This fixes a bug that shows up when you do:

ds = yt.load("enzo_tiny_cosmology/DD0046/DD0046")
proj = ds.proj("density", "x")
frb = proj.to_frb(1, (1000, 1000))
fn = frb.save_as_dataset(fields=["density"])
nds = yt.load(fn)
print (nds.data["density"])

The units of the domain right/left edges were being clobbered. The added assert tests this functionality.

@ngoldbaum
Copy link
Member

@yt-fido test this please

self.domain_left_edge = \
np.concatenate([self.parameters["left_edge"], [0.]])
self.domain_right_edge = \
np.concatenate([self.parameters["right_edge"], [1.]])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do also have a uconcatenate function that could be used for this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I know. I just found it a bit clunky to ensure everything was in the same units. My solution doesn't actually work, though, so I'll do it like that.

@brittonsmith
Copy link
Member Author

@yt-fido test this please

@ngoldbaum
Copy link
Member

@brittonsmith unfortunately nebula is down at the moment, along with jenkins.

@ngoldbaum
Copy link
Member

@yt-fido test this please

@ngoldbaum
Copy link
Member

The remaining test failures on jenkins are unrelated and will be fixed by #1666.

@ngoldbaum
Copy link
Member

@yt-fido test this please

@ngoldbaum ngoldbaum merged commit 0abf9b6 into yt-project:master Jan 19, 2018
@brittonsmith brittonsmith deleted the ytfrb branch July 1, 2018 01:55
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

Successfully merging this pull request may close these issues.

5 participants