Open
Conversation
First version of the config parser
aboucaud
reviewed
Jan 27, 2023
Comment on lines
+31
to
+37
| if isinstance(config, ConfigParser): | ||
| self._config = config.config | ||
| else: | ||
| raise ValueError( | ||
| f"config must be an instance of {ConfigParser}. " | ||
| f"Got: {type(config)}" | ||
| ) |
There was a problem hiding this comment.
Suggested change
| if isinstance(config, ConfigParser): | |
| self._config = config.config | |
| else: | |
| raise ValueError( | |
| f"config must be an instance of {ConfigParser}. " | |
| f"Got: {type(config)}" | |
| ) | |
| if not isinstance(config, ConfigParser): | |
| raise ValueError( | |
| f"config must be an instance of `WeakLensingValidation.config_parser.ConfigParser`. " | |
| f"Got: {type(config)}" | |
| ) | |
| self._config = config.config |
aboucaud
reviewed
Jan 27, 2023
| def __init__( | ||
| self, | ||
| path=None, | ||
| config=None, |
There was a problem hiding this comment.
Pourquoi mettre par défaut à None ?
C'est un argument nécessaire, pas optionnel.
aboucaud
reviewed
Jan 27, 2023
Comment on lines
+80
to
+81
| self._config["workspace"]['path'] + '/' \ | ||
| + file_name + '.hdf5' |
aboucaud
reviewed
Jan 27, 2023
| ) | ||
| else: | ||
| new_path = \ | ||
| self._config["workspace"]['path'] + '/' + file_name |
aboucaud
reviewed
Jan 27, 2023
Comment on lines
+105
to
+107
| df_tmp['var_cat_history'] = \ | ||
| np.ones(len(df_tmp), dtype=int) \ | ||
| * path_config['var_cat_history'][i] |
There was a problem hiding this comment.
Avoid backslashes, use parentheses instead
aboucaud
reviewed
Jan 27, 2023
| return self._df[col_name].to_dask_array() | ||
| elif isinstance(col_name, dict): | ||
| cat_tmp = {} | ||
| func = copy.copy(col_name['func']) |
There was a problem hiding this comment.
Suggested change
| func = copy.copy(col_name['func']) | |
| func = copy.deepcopy(col_name['func']) |
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.
First version of the catalo handler.
See issues #3 for more details.
Right there are two child class
GalaxyCatalogandStarCatalogwhich do not have a very good reason to exist. Will see if we keep them. It could be useful in case one of the catalog requiered a specific handling. Which is not the case at the moment..