GithubHelp home page GithubHelp logo

Comments (4)

embray avatar embray commented on June 8, 2024

I'm somewhat inclined to agree, but clearly somebody wanted it. If it's a problem you can always disable it: http://docs.astropy.org/en/stable/warnings.html

from pyfits.

ycopin avatar ycopin commented on June 8, 2024

Indeed I could disable all astropy's UserWarning's, but at the price of all other rightful warnings.

Is it true that somebody explicitly wanted it, or just used warning.warn as a standard way to print out confirmation information?

from pyfits.

embray avatar embray commented on June 8, 2024

Yes, that's pretty normal. It's useful for user applications, but for libraries you can just disable them entirely or filter as needed. You can disable specific warnings with a filter: http://docs.python.org/2/library/warnings.html#warning-filter

That said, I'll ask around about it. I found when it was originally added, some nine years ago: 67ac28d#diff-8b4ff7071b289a061e4717473affeb6b
Originally it was just a print statement to stdout so at least that's been fixed ;) I agree that if you've already asked to overwrite existing files maybe you don't need to know about it. Though perhaps one could make a case that it's there so that programs that use PyFITS can use the "clobber" functionality, but the users of those programs don't necessarily know that it will overwrite existing files, so it's informing end-users of that fact...

from pyfits.

ycopin avatar ycopin commented on June 8, 2024

I can indeed encapsulate all calls to writeto in the proper warning management, thanks for the tip (yet not very appealing...). Maybe an alternative would be to define an explicit IOwarning which could be specifically filtered when needed.

from pyfits.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.