Conversation
…contrib_bc_input_converter
tbittar
approved these changes
Jul 3, 2025
| initial_value: Union[pd.DataFrame, float], | ||
| preprocessed_values: Optional[Union[dict[str, float], float]] = None, | ||
| ) -> Union[float, pd.DataFrame]: | ||
| def resolve(value): |
Collaborator
There was a problem hiding this comment.
You could define the function outside the class as a free function
| has_valid_area = any(area.id in valid_areas for area in self.areas.values()) | ||
|
|
||
| def _convert_area_to_component_list(self, lib_id: str) -> list[InputComponent]: | ||
| if has_valid_area: |
Collaborator
There was a problem hiding this comment.
En lisant le code, j'ai vraiment du mal à comprendre ce que fais cette fonction..., Je ne comprends pas bien pourquoi le if/else : dans quel cas se retrouve-t-on sans "valid_areas" ? Pourquoi parcourt-on toutes les areas dans le cas où il y en a au moins une de valide... ?
| to_exclude = [ | ||
| item | ||
| for area in self.areas.values() | ||
| if area.id not in valid_areas |
Collaborator
There was a problem hiding this comment.
Pourquoi cette ligne ? On sait déjà qu'on n'a pas d'area valide dans ce bloc
| # Get area pattern for binding constraint from model config | ||
| self.bc_area_pattern = f"${{{bc_data['template-parameters'][0]['name']}}}" | ||
|
|
||
| model_config_datas: dict = self._extract_legacy_objects_from_model_config( |
Collaborator
There was a problem hiding this comment.
Suggested change
| model_config_datas: dict = self._extract_legacy_objects_from_model_config( | |
| legacy_objects_used_for_bc: dict = self._extract_legacy_objects_from_model_config( |
| obtained_components, key=lambda x: x["id"] | ||
| ) | ||
|
|
||
| def test_multiply_operation(self): |
Collaborator
There was a problem hiding this comment.
The following tests should not be in the Testconverter class
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.
No description provided.