Skip to content

Conversation

@mhvk
Copy link
Contributor

@mhvk mhvk commented Oct 10, 2013

An annoyance in Quantity has been that one cannot import dimensionless_unscaled on top, since it needs the registry to be set up. By defining it instead as CompositeUnit(1, [], []) (as is done when one does Unit('')), this is avoided. Hence, all the local imports in quantity.py and quantity_helpers.py could be removed.

Note that I need this for an upcoming PR for MaskedQuantity -- which in turn should help make Table/Quantity integration easier.

@mdboom
Copy link
Contributor

mdboom commented Oct 10, 2013

👍 I think this means we can also removed the definition of dimensionless_unscaled in astropy/units/__init__.py, correct?

@mhvk
Copy link
Contributor Author

mhvk commented Oct 10, 2013

@mdboom - Thanks! Had actually made that change but had forgotten to add it.

@astrofrog
Copy link
Member

👍

astrofrog added a commit that referenced this pull request Oct 12, 2013
Define dimensionless_unscaled differently so it can be imported more easily
@astrofrog astrofrog merged commit 82fc4b9 into astropy:master Oct 12, 2013
@mhvk mhvk deleted the units-no-import-dimensionless branch October 12, 2013 16:53
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.

3 participants