Conversation
|
This looks great. As you point out in the pull request description, this does need some way to write out all of the configuration options to a file when first starting up without a configuration file. Note this can't happen exclusively in the An alternate (though less automated approach) is the one matplotlib takes where this template file is maintained by hand. |
|
@mdboom - Thanks for the detailed feedback! Everything that's not commented on above should be fixed in the version I pushed up just now. Regarding the auto-writing of the first file: I'm very much against the by-hand approach, because I'm certain there will be lots of problems with people forgetting to do so. I tried to write this system here so that the output config file is still pretty nice looking with the necessary comments and so on. So yeah, I think the best approach is to do something like |
|
@astrofrog,@iguananaut - you two both had a variety of comments on the last pull request, so I'll wait for you two to either give feedback or say it looks good before merging anything. @hamogu, @phn - you may also be interested, as you both had a few comments in the old pull request. |
|
This are notes mostly for myself, as I will make issues for each of the not-yet-completed items after this pull request is done:
|
astropy/config/configs.py
Outdated
|
I haven't read everything in detail, but it seems fine to me. In any case, I'm sure we will need to tweak things once we start actually making use of the config utilities. |
|
@eteq: As for writing the defaults -- I think I wasn't clear. What I meant to say is that A simpler solution would be to not generate and install a template file, but simply generate it when needed. This has the downside that all of astropy needs to be imported upon first usage -- maybe not a big deal at present, though. |
|
Looks good to me. Once this is merged, there are some places I'd like to start using it :) |
|
@mdboom - ah, I get what you mean now. Given the range of options there, I'll make sure to put it up as an issue and there can be a later pull request to deal with how to actually organize the generation. |
|
The only problem I see with this is that autogenerating a config file means every module has to be imported once to make sure all config options are found. I don't think there's a way around that though. Honestly, I'm not against including a template config file (or files) in the source code--if a new option is added it would just have to be added to the template. There could even be code to generate it. On the other hand, as long as the generation only has to happen once that's fine too. There should be a function (if there isn't already) to update a user's config file with new options while preserving existing settings. |
|
All the remaining changes seem to be targets for later pull requests, so I'll merge this now. Thanks for all the helpful feedback! |
Implementation of config package - includes both configuration file and data-access functionality.
Implementation of config package - includes both configuration file and data-access functionality.
Fix issues when spacing is not a multiple of base spacing
Implementation of config package - includes both configuration file and data-access functionality.
Add spectral-cube to registry
This is a re-work of the remote data and configuration package heavily modified based on feedback in pull request #35 . The important major changes:
get_datafunction as though it were in the localdatadirectory.data.pyin this pull request.Things that are missing but can be easily added later:
astropy.config.configs._generate_all_config_itemsfunction - that basically just has do be plugged into the setup)