Repository navigation
ENH: Allow discovery of available config items - #10139
Conversation
|
Seems like a good idea! And from the example I can see why you felt this might be useful...... Somewhat separately, it would be really good if searching for "astropy configuration" didn't just return how to do configuration, but also all possible things one can configure. It should be possible to auto-generate a nice list... Which probably should be a new issue... Will generate one. |
|
@mhvk , I did have to use this feature for |
|
Just to be clear, I think this really is independent of my other request/wishlist - and I am all for getting it in! But better let @eteq have a look first... |
|
please do rebase |
ce90846 to
3c934e8
Compare
3c934e8 to
bd1876c
Compare
|
Rebased and I added dict-like iterators. |
mhvk
left a comment
There was a problem hiding this comment.
I think this is all OK, though it needs a rebase and one might as well fix a nitpick in the process. One of those little things that makes stuff just that bit better!
|
|
||
| def values(self): | ||
| """Iterate over configuration item values.""" | ||
| for key, val in self.__class__.__dict__.items(): |
There was a problem hiding this comment.
I'd iterate over __dict__.values() here, but not essential.
| for item in self.__class__.__dict__.values(): | ||
| if isinstance(item, ConfigItem): | ||
| item.reload() | ||
| for item in self.values(): |
bd1876c to
2e965af
Compare
Fix change log duplicate added from rebasing.
2e965af to
ab85080
Compare
|
Great, merging! |
|
Thanks for the review and merge! |
Description
This pull request is to add
__iter__inConfigNamespaceto see whatConfigItemnames are defined in it.Fixes #8524
p.s. Not sure what the "example start" stuff is about, so I didn't add that in.