-
Notifications
You must be signed in to change notification settings - Fork 0
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
reading default values from yml files #23
Conversation
Signed-off-by: neuronflow <[email protected]>
ereg/registration.py
Outdated
@@ -188,6 +188,7 @@ def update_parameters(self, config_file: Union[str, dict], **kwargs): | |||
) | |||
|
|||
# this is taken directly from the sample_config.yaml | |||
# TODO this is ugly we should probbaly read these defaults from a file? |
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.
There are pros and cons for both the mechanisms. If we are reading from a file, we need to ensure that the file is packaged in pypi in a manner that works across various platforms.
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.
yes, this is solved :)
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.
ah it was not commited yet, see commits below
Signed-off-by: neuronflow <[email protected]>
Signed-off-by: neuronflow <[email protected]>
Signed-off-by: neuronflow <[email protected]>
ereg/registration.py
Outdated
def _generate_default_parameters(self) -> dict: | ||
defaults_file = os.path.normpath( | ||
os.path.abspath( | ||
__file__ + "configurations/default_config.yaml", |
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.
__file__ + "configurations/default_config.yaml", | |
__file__ + "configurations/sample_config.yaml", |
No need for another config file at all.
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.
then we need to move the other files to this location :)
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.
Sure!
@@ -0,0 +1,95 @@ | |||
# TODO adjust default parameters! |
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.
This file can be deleted.
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.
yes, it is a placeholder. the files we want to include into the pkg should be subfolders of the ereg folder :)
This PR also needs changes in the MANIFEST and pyproject.tml files in accordance with the documentation here (or something similar): https://setuptools.pypa.io/en/stable/userguide/datafiles.html |
should work without a manifest, at least in brainles preprocessing we also include files without a manifest [I believe the reason it works is that we use poetry] |
Oh okay. Should be fine as long as we can verify this without having to push a new version to pip. |
hmm if it works with |
Cool! Move the |
currently we pkg everything that is under the |
Signed-off-by: neuronflow <[email protected]>
@sarthakpati so @IsraMekki0 and I went through the code today, we added this property: Line 83 in e4973e4
This enables users to change the configuration of a registrator instance with Further, we added the possibility to read in defaults from the .yml now what seems missing is that the Line 99 in e4973e4
|
Sounds great! Thanks, @IsraMekki and @neuronflow |
Signed-off-by: neuronflow <[email protected]>
Signed-off-by: neuronflow <[email protected]>
Signed-off-by: neuronflow <[email protected]>
"bias_correct", self.parameters.get("bias", False) | ||
) | ||
self.parameters["interpolator"] = ( | ||
self.parameters.get("interpolator", "linear") |
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 don't fully understand why this is done @sarthakpati . The
.replace("_", "")
.replace("-", "")
.lower()
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.
@sarthakpati did you see this?
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.
Uh, I think this is to just remove these specific special characters to make the comparisons easier in the next lines.
Signed-off-by: neuronflow [email protected]