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

Fix missing AstropyDeprecationWarning import #5006

Merged
merged 1 commit into from
Jun 2, 2016

Conversation

saimn
Copy link
Contributor

@saimn saimn commented Jun 1, 2016

Missing AstropyDeprecationWarning in astropy.io.fits.column.

In [33]: coldefs = fits.ColDefs([c1], tbtype='BinTableHDU')
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-33-844778bb414c> in <module>()
----> 1 coldefs = fits.ColDefs([c1], tbtype='BinTableHDU')

/home/simon/lib/astropy/astropy/io/fits/column.py in __new__(cls, input, tbtype, ascii)
   1156                 'inferred from the formats of the supplied columns.  Use the '
   1157                 '``ascii=True`` argument to ensure that ASCII table columns '
-> 1158                 'are used.', AstropyDeprecationWarning)
   1159         else:
   1160             tbtype = 'BinTableHDU'  # The old default

NameError: global name 'AstropyDeprecationWarning' is not defined

I guess this tbtype arguments is not widely used ;-). The docstring says it was deprecated in Astropy 0.4, so maybe it is time to remove it ?

@pllim pllim added the io.fits label Jun 2, 2016
@pllim
Copy link
Member

pllim commented Jun 2, 2016

According to APE2, "Furthermore, when possible, a backwards incompatible change should generate an AstropyDeprecationWarning for at least one feature release version before actually making the change permanent, to allow codes to transition to the new interface."

That means 0.4 was several feature releases ago, so I am for removing the deprecated feature.

@astrofrog
Copy link
Member

Let's go ahead and merge this fix for now, and it would be great if someone could go through and look for all such deprecation warnings that could be removed (I think if they were added before 1.0 they can definitely be removed) - @saimn @pllim, feel free to do this if you like! :)

@astrofrog astrofrog added this to the v1.0.10 milestone Jun 2, 2016
@astrofrog astrofrog merged commit 878c386 into astropy:master Jun 2, 2016
astrofrog added a commit that referenced this pull request Jun 2, 2016
Fix missing AstropyDeprecationWarning import
astrofrog added a commit that referenced this pull request Jun 2, 2016
Fix missing AstropyDeprecationWarning import
@saimn
Copy link
Contributor Author

saimn commented Jun 3, 2016

Yep, I will take a look later at deprecated stuff, there are many in the fits module.

@saimn saimn deleted the fix-coldef-import branch June 3, 2016 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants