Repository navigation
Remove mention for clobber from all FITS functions - #6381
Conversation
|
Hi there @drdavella 👋 - thanks for the pull request! I'm just a friendly 🤖 that checks for issues related to the changelog and making sure that this pull request is milestoned and labelled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part 😃. Everything looks good from my point of view! 👍 |
|
Wow, you are ahead of the game. 😅 |
|
Whoops, I guess that's what the |
| astropy.io.fits | ||
| ^^^^^^^^^^^^^^^ | ||
|
|
||
| - Support for previously deprecated ``clobber`` keyword has been removed. Use |
There was a problem hiding this comment.
Usually we mention the deprecations and removal of previous deprecations in the API change section below.
There was a problem hiding this comment.
Oops, my bad. Just fixed it.
f69d134 to
f4bfeb4
Compare
|
I'm not sure this really has to be last before release? (unlike the Python 2 removal which we do want to delay) |
|
I am a bit traumatized by the backlash of just deprecating it for 1.3, now we are talking about complete removal. Anyway, feel free to remove the tag if you feel otherwise. |
|
@drdavella - While we may not want to wait with this until the very last moment, I suspect it won't get merged much before the python2 removal. |
|
Maybe a new label called "wait a little bit but not last minute"? 😅 |
|
@astrofrog - I think it's still a good idea to give it a bit more time. Deprecationwarnings are already been issued and should fail their CIs (assuming they have opted in, but not everyone does), but probably there are still packages out there that use |
|
Didn't mean to stir anything up here; I've just been looking for bite-sized FITS-related issues to get my feet wet with |
|
@drdavella - Not at all, thank you very much for working on io.fits. I'm sure most of us can't wait for the moment to hit merge on these and remove all the deprecated stuff including python2 :) |
|
The directives ( |
| >>> import warnings | ||
| >>> from astropy.io import fits | ||
| >>> warnings.filterwarnings('ignore', category=UserWarning, append=True) | ||
| >>> fits.writeto(filename, data, clobber=True) |
There was a problem hiding this comment.
Good catch. 👍
These should've been changed when clobber was deprecated.
There was a problem hiding this comment.
Maybe it is out of scope here but I argue that overwrite (or clobber) is not needed altogether. The doctest is skipped here, so having that keyword or not does not make any difference as far as the example is concerned. We should not encourage people to overwrite their data blindly by default.
There was a problem hiding this comment.
That also seems reasonable. I haven't checked the context :)
There was a problem hiding this comment.
Unless I'm mistaken, I think the point of these examples is to show how to suppress warnings from astropy if necessary. The overwrite=True flag is being used in the examples since it will cause a warning which could be suppressed.
There was a problem hiding this comment.
This could also cover other kinds of warnings too though, for example FITS validation warnings for the header values? We definitely can't use clobber anymore if it's being removed.
There was a problem hiding this comment.
@astrofrog, that's a good point and maybe I misunderstood. I thought the point of the example was that overwriting a file, even when using the newer overwrite keyword, caused a warning of some sort. But maybe that's mistaken, in which case the overwrite argument should just be removed from the examples altogether.
There was a problem hiding this comment.
I didn't check but this example probably predates the clobber/overwrite change, and is here to show how to filter warnings typically from an invalid FITS file. So replacing clobber by overwrite is fine for me (or you can also remove this argument).
| report_as_string = diffobj.report() | ||
| with catch_warnings(AstropyDeprecationWarning) as warning_lines: | ||
| # Clobber argument is no longer supported | ||
| with pytest.raises(TypeError): |
There was a problem hiding this comment.
I don't think we need to keep the tests that test for a removed argument. I don't quite remember but is the clobber warning the only purpose of this test?
There was a problem hiding this comment.
It appears to be. I can remove the tests altogether if you want.
There was a problem hiding this comment.
If the tests are obsolete then yes, please remove them :)
|
re: the |
Seems reasonable. Is this too verbose? .. versionchanged:: 1.3
``overwrite`` replaces the deprecated ``clobber`` argument.
.. versionchanged:: 3.0
``clobber`` is no longer supported; Use ``overwrite``. |
|
What about: On reflection it probably should've been a But some kind of directive should be kept, just so people investigating a failure using the docs find a note about |
f4bfeb4 to
00ba09f
Compare
Would it make sense to have some kind of decorator equivalent to the deprecated one but for actual deleted arguments? |
|
@astrofrog Just to modify the documentation? That doesn't sound very robust (I actually needed to remove the doc-changing part of |
|
Looks good for me in terms of code, but I think this change should be delayed for at least one version (and probably more). The deprecated warning was just added in 2.0, and I already encountered a few codes that emit it. |
|
I feel that since there will be big changes in 3.0, it's OK to get this in there, too. However if we decide to delay it further, then it would be nice to create a new milestone for the decided version making sure this doesn't slip through. |
|
I think we can merge this soon before coordination meeting, unless someone objects? @MSeifert04 and @saimn , is the code still okay to merge? |
|
Code-wise this has been ready for a while. But I would've preferred to keep it until 3.1 or 4.0 because it's really used a lot in scripts/downstream packages and there is simply no pressing need to remove it as soon as possible... and one minor release is just short for a deprecation. |
|
Okay, maybe that came off too strong. I would like to have a longer deprecation period but I don't care too much. |
|
As explained above I think this should wait for at least one major version. There is no urgency here and the amount of code involved (in Astropy) is small, so I don't see any issue to keep this longer. Give people time, |
|
Should we re-milestone then? |
|
If it's ok for you and @bsipocz 😌 . Which milestone, 3.1 (next major version) or 4.0 (next LTS) ? And these milestones should be created. |
|
isn't it "major.minor.micro"? 😄 |
|
Are we doing semantic versioning ? (I was referring to this roadmap: https://github.com/astropy/astropy-APEs/blob/master/APE10.rst#roadmap) |
|
We're not doing strict semantic versioning (https://github.com/astropy/astropy-APEs/blob/master/APE2.rst), so next major (or feature) release will be 3.1, then 3.2, 3.3 and 4.0. The 3.0 is super major in term of being an exception of not being an LTS, but tons of code will be removed (thus we expect some roughness, that warrant it to be a 3.0, and also not being LTS). |
|
Also, I'm happy to create a 3.1 milestone, but would rather avoid doing a 4.0 and tip-toe around PRs that are planned to be opened for another 2 years. Although the appendum hasn't been formally merged (astropy/astropy-APEs#20), there was an agreement (or seemed to be one), that deprecations should not be too long. People are given the LTS option, they should really make up there mind whether to use the cutting edge or the super stable version. |
|
I'd have to say I was with @saimn on this originally as there is a lot of legacy code that uses clobber and not everyone has time to maintain their code. But the argument about 2.x -> 3.x by @bsipocz kind of wins me over. Since the next version is going to break a lot of codes as it is, there would be sense to have users only get mad at us with one update rather than twice. But it would be good to further discuss this next week. |
|
@eteq @adrn @taldcroft and I discussed this further at the CC meeting in NY today and we think that deprecating things is fine but we should only remove them if it gets in the way of future development. A LOT of people use clobber in existing code and we will annoy a lot of users if we merge this. So we think this should not be merged for the foreseeable future, potentially ever. |
|
So if others agree with our assessment, this PR should be updated to just include the documentation fixes (basically clobber shouldn't be mentioned in any documentation) |
|
for the record: I was also there, and see the logic behind the decision. |
00ba09f to
7cdeab2
Compare
|
I just rebased and updated with documentation-only changes. I don't think this needs a changelog update any more. |
7cdeab2 to
7bebd3d
Compare
|
If people are going to switch to v3 without PY2 support, lack of |
|
Good news, and thanks @drdavella for the quick update. |
|
I've cancelled all but docs builds. |
|
Thanks @drdavella! |
This close #5774. (EDITED)