Add shorthand syntax to simplify user configs#253
Open
TimothyWillard wants to merge 1 commit intomainfrom
Open
Add shorthand syntax to simplify user configs#253TimothyWillard wants to merge 1 commit intomainfrom
TimothyWillard wants to merge 1 commit intomainfrom
Conversation
Added the ability for `flepimop2` to parse shorthand syntax form modules that easy to specify in a single line with few arguments. In a configuration file this looks like the user specifying the module model as a string. For example: ```yaml parameter: beta: fixed(0.3) ``` The initial portion of the string, 'fixed', identifies the module to load and the contents between the parens are pased to `from_shorthand` class method (if implemented) to parse into a well formed module. - Updated build functions to accept strings, by default `flepimop2._utils._module._build` handles this by defering to the `from_shorthand` classmethod of the requested module. - Added shorthand syntax for `FixedParameter` for user convenience. - Removed the default module from the `flepimop2.*.abc.build` helpers, instead requiring that users either use shorthand syntax or specify a 'module' explicitly. Closes #14, closes #100.
70ab7d8 to
ea05d09
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Added the ability for
flepimop2to parse shorthand syntax form modulesthat easy to specify in a single line with few arguments. In a
configuration file this looks like the user specifying the module model
as a string. For example:
The initial portion of the string, 'fixed', identifies the module to
load and the contents between the parens are pased to
from_shorthandclass method (if implemented) to parse into a well formed module.
flepimop2._utils._module._buildhandles this by defering to thefrom_shorthandclassmethod of the requested module.FixedParameterfor user convenience.flepimop2.*.abc.buildhelpers,instead requiring that users either use shorthand syntax or specify a
'module' explicitly.
Related issues
Closes #14, closes #100.
Checklist
just ci.CHANGELOG.mdor noted "no major changes" in my commit if the PR is small.