Pull requests

#11 Merged
Repository
ngoldbaum/yt-mattfork yt-mattfork
Branch
yt-3.0
Repository
MatthewTurk/yt yt
Branch
yt-3.0

Misc fixes + Fixes and tests for operations that combine YTArray and YTQuantity

Author
  1. Nathan Goldbaum
Reviewers
Description

This includes four changesets. Like Britton found earlier today, there seems to be a bitbucket bug related to branch PRs so this will need to be reviewed by hand as I can't PR into the correct branch from the PR interface.

The first change fixes a circular import in physical_constants.py by defining a new file, physical_ratios.py that does not import anything. Everything in this new file is imported into the physical_constants.py namepace to avoid breaking imports elsewhere in yt. This is necessary because physical_constants.py uses YTQuantity but the ratios that this PR puts in physical_ratios.py are used in the unit subsystem which is used in the definition for YTQuantity. The weird thing about this is it was working when I originally moved everything around and seemed to be working for you guys. Not sure what changed. In any case, this fixes it.

Second, I've added the new code_velocity unit and velocity_unit attribute to the stream frontend. This fixes a huge number of unit tests, since load_uniform_grid was failing.

I've fixed an issue that John ZuHone pointed out that caused some operations to return a YTQuantity when they should have returned a YTArray. I've added some new logic in __array_wrap__ that catches this and fixes it.

Last, I've added a new test that checks the type of the object returned from some common mixed YTArray/YTQuantity operations and verifies that we get a YTArray or YTQuantity as appropriate.

Update: added reviewers. Keep in mind the diff below is garbage, only look at the last four commits.

  • Learn about pull requests

Comments (0)