GithubHelp home page GithubHelp logo

Comments (5)

timj avatar timj commented on July 23, 2024

Sorry about that. I'll take a look.

from starlink-pyast.

timj avatar timj commented on July 23, 2024

I've had a quick look and I think I would be inclined to fix the Atl interface so that it does something like:

try:
    import starlink.Grf as Grf
except ImportError:
    Grf = None

and then raise an exception in the plotframeset routine if Grf is None. Ideally we would have put the ATL plot routines in a different support package but it's a bit late to do that now.

from starlink-pyast.

rmjarvis avatar rmjarvis commented on July 23, 2024

I suppose that would solve the problem, but it seems less than ideal from an end user's perspective, since it swallows the traceback for the ImportError. If the user thought they had matplotlib installed, this wouldn't give them any feedback as to why import starlink.Grf is failing.

Why not just put import starlink.Grf in the plotframeset function itself? Is this just to conform to PEP8, or is there a more concrete reason to prefer putting this at the top?

Remember, "A foolish consistency is..." not always the best choice. :)

from starlink-pyast.

timj avatar timj commented on July 23, 2024

Hmmm. Yes, I tend to prefer imports at the top of code files rather than buried in the middle, but in this case, given that the failure mode is identical (you get an unexpected error some time after your program starts rather than at import time), I guess having the real error trigger inside plotframeset is better than an error we make up ourselves when plotframeset is called.

from starlink-pyast.

timj avatar timj commented on July 23, 2024

Ok, I'm sleep-addled but I've put in an attempted fix in #15.

from starlink-pyast.

Related Issues (10)

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.