-
Notifications
You must be signed in to change notification settings - Fork 3
Improve bindings for configuration types #35
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
Open
wdeconinck
wants to merge
14
commits into
master
Choose a base branch
from
improve-config
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3644b68
Improve config
wdeconinck df967b1
Version 0.41.1.dev5
wdeconinck 87c8da3
Fix nit on using nb::str
wdeconinck 3cf4e1f
Remove unneeded overload
wdeconinck 917a370
Forward compatibility to handle vector<bool> correctly.
wdeconinck ed6afa5
Add unit-test that asserts Metadata follows the mapping protocol
wdeconinck 2fd129f
More defensive path handling
wdeconinck 59cecf5
Change error types to the mapping protocol expectations
wdeconinck 6ed96da
Fix handling of None value
wdeconinck 48479a9
Remove make_Config and inline it at callsite
wdeconinck 4b7dad2
Be more explicit that both yaml and json are parsed by the same parser
wdeconinck e8a9101
Replace atlas4py.Config.from_kwargs with constructor
wdeconinck e88c54d
Make eckit.Configuration and eckit.LocalConfiguration private
wdeconinck a7a2d6b
Address #39 partially, only for the Config related classes
wdeconinck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inheriting from
eckit::LocalConfigurationhere is a nice simplification — it removes the duplicated__getitem__/__setitem__and makesdict(metadata)work. But it silently changeskeysfrom a property to a method: master had.def_prop_ro( "keys", &util::Metadata::keys ), andConfiguration::keysis bound as.def("keys", ...).No error, just a wrong value — truthy, and it won't fail until something tries to use it as a list. Worth at least a changelog note, or a transitional
keysproperty if you want to avoid the break.Config.keyswas already a method, so onlyMetadatais affected.Also note there's no test covering
Metadataat all, which is why this didn't show up.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is more important to change the API for metadata to use keys() function as it then follows the python mapping protocol.
I'm hoping this will not have any adverse effects to users at the moment, and be understood as an API improvement.
So my advice is: Don't fix.