-
-
Notifications
You must be signed in to change notification settings - Fork 400
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
Changing config items at runtime is broken #2291
Comments
@eteq has already provided an explanation of the problem together with an outline of a solution in #544. See also https://docs.astropy.org/en/stable/config/index.html#usage-tips |
Indeed. As you can see here: astroquery/astroquery/simbad/core.py Line 274 in 08e57d7
p.s. Or maybe a |
Hmm. I hoped that delaying the import of the class does the trick, but you're absolutely right that it shouldn't. This brings us back to the same discussion we had recently of what should be on the class and what on the instance level. Maybe even the URLs should be instance, at least when there is an option to choose between the mirrors? Do you see any downside of having them as a property instead? OTOH, I would be down for the idea of not allowing changing the mirror at runtime but only doing that at the config level. |
Since Python does not have true "private" attributes, personally, I think property vs config is just a matter of preference. If this Simbad server is used throughout |
Again, a very good point. Not much atm, but indeed the simbad module is cross used in other modules so for that use case the config system has to be used and there is no runtime way to change the url. |
The |
Hello, I wanted to add a method to switch between the two simbad mirrors. How do I get the second one from the configuration of astropy? So far, I have this: >>> from astroquery.simbad import conf
>>> next(conf.items())
('server', <ConfigItem: name='server' value='simbad.cds.unistra.fr' at 0x7f1b2c26a9d0>) And I was wondering how I could access the url of the other mirror from that? Am I looking in the wrong place? |
Changing config values at runtime should be possible, yet it's not working: https://docs.astropy.org/en/stable/config/index.html#changing-values-at-runtime
The text was updated successfully, but these errors were encountered: