-
Notifications
You must be signed in to change notification settings - Fork 4
Clean yaml converter test files #84
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
Conversation
killian-scalian
commented
Apr 10, 2025
- add a separate test file for preprocessing
areas = converter.study.get_areas().values() | ||
return areas, converter | ||
|
||
def _generate_tdp_instance_parameter( |
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.
Cette fonction est dupliquée dans test_converter
, peut-on mutualiser ?
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 we can, done in the last commit
""" | ||
component = getattr(instance, process_method)() | ||
expected_component = InputComponentParameter( | ||
id=process_method.split("process_")[1], |
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.
Je trouve ça très dangereux parce que si on renomme la méthode dans la classe ThermalDataPreProcessing
sans renommer le paramètre du modèle, la fonction est cassée. Je préférerai que tu donnes aussi en argument de _validate_component
l'id du paramètre directement
assert current_df.equals(expected_df) | ||
assert component == expected_component | ||
|
||
def _test_p_min_cluster(self, local_study_w_thermal: Study): |
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.
def _test_p_min_cluster(self, local_study_w_thermal: Study): | |
def test_p_min_cluster(self, local_study_w_thermal: Study): |
""" | ||
areas, converter = self._init_area_reading(local_study_w_thermal) | ||
study_path = converter.study_path | ||
instance = generate_tdp_instance_parameter(areas, study_path) |
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.
Peux-tu le renommer thermal_data_preprocessing
dans tout le fichier pour plus de clarté ?
instance, expected_path = self._setup_test( | ||
local_study_w_thermal, "nb_units_min" | ||
) | ||
instance.process_p_min_cluster() |
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.
Inutile ça se fait dans _validate_component
instance, "process_nb_units_min", expected_path, expected_values | ||
) | ||
|
||
def test_nb_units_max(self, local_study_w_thermal: Study): |
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.
Les tests test_nb_units_max
, test_nb_units_min
, test_p_min_cluster
sont très similaires, tu pourrais même utiliser parametrize
) | ||
assert variation_component.value == str(expected_path) | ||
|
||
def test_nb_units_max_variation_forward( |
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.
Inutile grâce au parametrize
local_study_w_thermal, create_csv_from_constant_value, direction="forward" | ||
) | ||
|
||
def test_nb_units_max_variation_backward( |
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.
Inutile grâce au parametrize