LINKS : REFACTO#68
Open
berthetclement wants to merge 27 commits into
Open
Conversation
…parsing and validation
- Added `LinksParser` class for parsing and filtering links data based on scenarios and year ranges. - Implemented new utility function `filter_based_on_year_range`. - Introduced new constants in `constants.py` to support links data parsing. - Added unit tests covering nominal cases, edge cases, and export validations. - Included sample input files for testing links processing.
…x mapping - Added `TimeSeriesMedianValues` and `InternalMapping` dataclasses to model median values and index mapping. - Introduced NTC median repartition computation for grouped data using peak labels. - Added index parsing and mapping logic for transfer links. - Refactored `_filter_based_on_ntc` to `_filter_based_on_transfer_type` for better clarity. - Updated `build_links` to integrate new index and median repartition processing.
…ng logic - Added new HVDC link types in `constants.py` for more detailed categorization. - Introduced `_add_links_code_antares_column`, `_filter_non_declared_links_areas`, and `_filter_duplicate_market` methods in `LinksParser` to improve filtering logic. - Refactored NTC median computation with grouped medians and better type annotations. - Enhanced `MainParams` to support mapping links market codes to Antares codes. - Updated links building logic to incorporate new parsing, filtering, and aggregation features. - Adjusted `LinksColumnsNames` and other supporting structures to align with new features.
…d HVDC handling - Added `AggregatedValues` for representing detailed HVDC and NTC aggregated metrics. - Implemented `_get_profile_values` for computing and normalizing link profiles. - Enhanced `_select_links_profile` for granular aggregation by market zones and directions. - Updated `build_links` to integrate the enhanced aggregation logic. - Cleaned up unused code and improved type annotations.
- Introduced `has_curve` attribute in `AggregatedValues` to track curve presence. - Added `selection_priority` property to enhance sorting by curve presence and reference capacity. - Updated link aggregation and selection logic to utilize the new `selection_priority`. - Adjusted tests and expected output to reflect changes in link selection criteria.
…sistency - Updated HVDC constant names in `constants.py` to align with new naming conventions (`_MW_` and `_FO_Rate_`). - Adjusted related test output files to reflect changes.
… logic - Introduced `mean_strict_positive` utility function to compute the mean of strictly positive values. - Updated HVDC aggregation logic in `parsing.py` to use `mean_strict_positive` for `hvdc_for`. - Adjusted expected output file to reflect changes in aggregation calculations.
MartinBelthle
requested changes
May 22, 2026
- Replaced `Literal`-based `Direction` with `StrEnum`. - Added new season and hour constants (`WINTER_SEASON`, `SUMMER_SEASON`, `HOUR_PEAK`, `HOUR_OFFPEAK`). - Refactored `_filter_based_on_year_range` and moved related logic from `utils.py` to `parsing.py`. - Updated `_filter_duplicate_market` to `_filter_duplicate_market_zone` for better clarity. - Simplified links filtering and aggregation methods, removing unused utility functions. - Enhanced year transformation logic with `_transform_year_to_straddling_year`.
- Deleted outdated `tools`, `conf`, and `links` modules from `src/antares/data_collection`. - Removed associated test files (`test_conf_tools.py`, `test_create_xlsx_workbook.py`). - Cleaned up unused logic related to links data processing and exports.
# Conflicts: # src/antares/data_collection/__init__.py
- Replaced `_filter_non_declared_links_areas` with the new `filter_non_declared_areas` utility for area filtering. - Streamlined antares code retrieval by removing unused methods (`get_links_antares_code`, `get_links_antares_codes`) and redundant attributes (`_links_market_to_antares`). - Adjusted relevant logic in `MainParams` (sheet LINKS removed) and `LinksParser` to reflect these changes.
…int/ruff actions)
… logic - Expanded `selection_priority` to include HVDC-related attributes for improved sorting. - Refined HVDC aggregation with better handling of `hvdc_for` and `NA` values. - Simplified `_mean_strict_positive` naming and logic for clarity. - Improved link selection logic to prioritize curve presence and capacity.
…omments - Eliminated the commented-out `discrim_profil` function to declutter code. - Removed redundant test variable and outdated comments for clearer implementation.
… from project files
# Conflicts: # tests/antares/resources/MAIN_PARAMS_2025.xlsx
update PEMMDB_LINK.xlsx in expected output files
MartinBelthle
requested changes
Jun 2, 2026
…nt code - Unified the structure of tests for hour and month column validations, improving parameterization for better readability and maintainability. - Removed deprecated and unused methods `get_peak_hours_label` and `get_peak_months_label` from `MainParams`. - Updated parsing logic for `PeakParamsColumnsNames` to check for exact hour and month ranges, replacing generic range checks.
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.
HVDC will be treated now in this bloc part
transfer links.csvRemove all old files concerning LINKS/conf/tests