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.
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
Add support for partial config files #981
Add support for partial config files #981
Changes from 11 commits
9373e83
9b03308
2493518
5f528b7
b04e18d
780ed10
baa377f
d301f0e
eab1faf
59b9d49
c1a236f
7257d85
e8a0210
c9a4100
1b71c64
feae5d8
def7162
e5b53cd
4ddd143
e3877ca
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Would it be worthwhile replacing
update_config()
in favour of the typedmerge_mappings()
? They are doing the same thing, althoughupdate_config()
doesn't use theMutableMapping
type and also converts path strings toPath()
.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'm so sorry I didn't realise I had re-written your function. I assumed update_config did something different!
Don't want to tread on toes, so happy to remove
merge_mappings
in favour ofupdate_config
if you like!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.
Don't worry its only code and I'm not possessive about it.
I don't mind which remains bit glad that we converged on the same solution!
Go with whichever you think is best, currently I think that is
merge_mappings()
, stronger type-hints and clearer docstring.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.
Tried replacing it, but they do slightly different things, in that
update_config
takesargparse.Namespace
objects, whilemerge_mappings
takes onlyMutableMappings
, attempting to replace causes errors with iteration. I tried to fix this by usingvars(args)
on the input but it still fails, so if it's okay with you, I'd suggest keeping both for now?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.
Ok, keep both but write up an issue to go through and reconcile the two in the future. On the surface they look very similar so it should be possible to write one function.