Skip to content

Data/scale as parameter - #11

Merged
finozzifa merged 4 commits into
prototypefrom
data/scale-as-parameter
Jun 26, 2025
Merged

Data/scale as parameter#11
finozzifa merged 4 commits into
prototypefrom
data/scale-as-parameter

Conversation

@euronion

Copy link
Copy Markdown
Member

The scale and scale_unit column where a weird idea and mixing long and wide data formats.
This PR turns the scale column into a row with parameter = "capacity" and adjusts the related functions accordingly.
Also adds more unit tests.

@euronion
euronion requested review from Copilot and finozzifa June 25, 2025 18:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_parameters instead of parameters['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.
                )

Comment thread technologydata/technologies.py
@finozzifa

Copy link
Copy Markdown
Member

Please go ahead with the squash merge!

@finozzifa
finozzifa merged commit ca4f9ec into prototype Jun 26, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants