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

Initialization of result in NDData methods _arithmetic and convert_unit_to prevents subclasses from requiring units #2300

Closed
mwcraig opened this issue Apr 8, 2014 · 0 comments · Fixed by #2301
Labels

Comments

@mwcraig
Copy link
Member

mwcraig commented Apr 8, 2014

Briefly, the NDData._arithmetic currently initializes its result with

        result = self.__class__(data)  # in case we are dealing with an inherited type

and then goes on to set result.unit, etc. That causes an issue for subclasses that want to require units.

A PR that fixes this (and a similar issue in NDData.convert_unit_to) is on its way.

mwcraig added a commit to mwcraig/astropy that referenced this issue Apr 8, 2014
mwcraig added a commit to mwcraig/astropy that referenced this issue Apr 14, 2014
ktchrn pushed a commit to ktchrn/astropy that referenced this issue Oct 28, 2014
ktchrn pushed a commit to ktchrn/astropy that referenced this issue Oct 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants