Data/scale as parameter - #11
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors how the capacity scaling is handled by removing the ‘scale’ and ‘scale_unit’ columns from the CSV files and updating the scaling logic in the Technologies class. Key changes include:
- Removing scale-related columns from CSV files and adjusting tests accordingly.
- Updating the adjust_scale API in the Technologies class to use to_capacity, to_capacity_unit, scaled_parameters, and absolute_parameters.
- Refactoring and extending test cases to cover new scaling behaviors.
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/test_adjust_functions/**/*.csv | Removed redundant scale/scale_unit columns from test input and output files |
| test/test_adjust_functions.py | Modified tests to reflect the new adjust_scale parameters and expected behavior |
| technologydata/technologies.py | Updated adjust_scale method, its parameters and internal scaling logic, along with the corresponding docstring |
| technologydata/datasources/specification/technologies.schema.json | Removed scale-related spec and updated the parameter example values |
| technologydata/datasources/example0*/technologies.csv | Updated example CSVs to match the new data format without the scale columns |
Comments suppressed due to low confidence (2)
technologydata/technologies.py:282
- Update this docstring line to refer to
scaled_parametersinstead ofparameters['scaling']to match the new API.
The scaling factor is applied to all parameters specified in the `parameters['scaling']` list.
technologydata/technologies.py:355
- Consider handling cases with multiple capacity rows more explicitly (for example, by raising an exception) instead of only logging an error to avoid silent failures.
)
finozzifa
approved these changes
Jun 26, 2025
Member
|
Please go ahead with the squash merge! |
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.
The
scaleandscale_unitcolumn where a weird idea and mixing long and wide data formats.This PR turns the
scalecolumn into a row withparameter = "capacity"and adjusts the related functions accordingly.Also adds more unit tests.