You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but does not, because configuration settings are read at class definition time:
classAstrometryNetClass(BaseQuery):
""" Perform queries to the astrometry.net service to fit WCS to images or source lists. """URL=conf.serverTIMEOUT=conf.timeoutAPI_URL=url_helpers.join(URL, 'api')
I noticed this on astrometry.net because this is the one that I wanted it to work for, but I noticed this pattern in other classes too. We should instead be reading the configuration at runtime at the last minute when these values are needed.
However, before I open a PR to try and fix this, I wanted to check if there is a deliberate reason why the above was done?
The text was updated successfully, but these errors were encountered:
astrofrog
changed the title
Changing configuration at runtime
Issue changing configuration at runtime
Apr 22, 2024
so I designed modules to support that approach, expecting that configuration changes would be done via configuration files, not modified at runtime, while individual modules would have their URLs updated at runtime. This latter approach is useful if you want to use different URLs with different instances of the module, e.g.:
The following should work to change e.g. the astrometry.net server:
but does not, because configuration settings are read at class definition time:
I noticed this on astrometry.net because this is the one that I wanted it to work for, but I noticed this pattern in other classes too. We should instead be reading the configuration at runtime at the last minute when these values are needed.
However, before I open a PR to try and fix this, I wanted to check if there is a deliberate reason why the above was done?
The text was updated successfully, but these errors were encountered: