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

Writing a FITS file should not warn when clobber is set to True #1963

Closed
anntzer opened this issue Jan 15, 2014 · 9 comments
Closed

Writing a FITS file should not warn when clobber is set to True #1963

anntzer opened this issue Jan 15, 2014 · 9 comments

Comments

@anntzer
Copy link
Contributor

anntzer commented Jan 15, 2014

Currently, a user warning ("Overwriting existing file ...") is raised in astropy.io.fits.file, and in astropy.io.fits.hdu.table when writing a FITS file would overwrite an existing file. But such an overwrite can happen only if the user explicitly passed clobber=True to the writing function; moreover the warning is too late anyways as the file is going to be overwritten (... except if the user can Ctrl-C very quickly).
I know warnings can be silenced but I don't think this situation actually warrants a warning.

@astrofrog
Copy link
Member

I agree, I always find it strange that the warning is emitted when clobber is explicitly set.

@ghost ghost assigned embray Jan 15, 2014
@taldcroft
Copy link
Member

👍

1 similar comment
@pllim
Copy link
Member

pllim commented Jan 15, 2014

👍

@embray
Copy link
Member

embray commented Jan 15, 2014

Note: This is a duplicate of spacetelescope/PyFITS#43 so when it's fixed there the fix will be backported to Astropy.

When the issue first came up I asked around about it a bit and the general consensus seems to be in favor of this change (I wouldn't ask at all except that this behavior has been in PyFITS going back many years!)

@embray
Copy link
Member

embray commented Jan 15, 2014

I should add: The original motivation for this is reasonable: PyFITS is very often used in applications, and in this case the user of that application or other third-party library may not be aware that the developer of that application wrote clobber=True, and so it's helpful to inform the user that this is happening. That said I would agree that this is the applications' job and not the library's.

@pchanial
Copy link

👍

@anntzer
Copy link
Contributor Author

anntzer commented Jul 23, 2014

Any news on that? The patch in itself is quite simple (just remove a call to warn)... Would a PR help?

@embray
Copy link
Member

embray commented Jul 23, 2014

A PR would always help. I agree with this issue but it's pretty low priority for me.

@embray
Copy link
Member

embray commented Jul 24, 2014

Fixed by #2786.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants