Skip to content

Implement inflow to capacity factor utility and inverse operation#9

Merged
MarcoAnarmo merged 10 commits intomainfrom
feature/inflowToCapacityFactor
Aug 27, 2025
Merged

Implement inflow to capacity factor utility and inverse operation#9
MarcoAnarmo merged 10 commits intomainfrom
feature/inflowToCapacityFactor

Conversation

@MarcoAnarmo
Copy link
Copy Markdown
Member

No description provided.

@MarcoAnarmo MarcoAnarmo self-assigned this Aug 26, 2025
@MarcoAnarmo MarcoAnarmo added the enhancement New feature or request label Aug 26, 2025
Copy link
Copy Markdown
Contributor

@FelixCAAuer FelixCAAuer left a comment

Choose a reason for hiding this comment

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

Thank you, only some minor points :)

@MarcoAnarmo
Copy link
Copy Markdown
Member Author

MarcoAnarmo commented Aug 26, 2025

After running the test over the sample data I have checked that the values of Inflows remain the same after the inverse operation which guarantees everything is working as expected!

new_vres = inflowsToCapacityFactors(dPower_Inflows, dPower_VRES, dPower_VRESProfiles)

unchanged_inflows = capacityFactorsToInflows(new_vres, dPower_VRES, dPower_Inflows)

In the picture you can verify the values of inflows remain the same.

image

@MarcoAnarmo
Copy link
Copy Markdown
Member Author

Next TODO before merging is adding the option to delete the inflows generators data from the VRES_Profiles.

@MarcoAnarmo
Copy link
Copy Markdown
Member Author

You can run the following test script to test the Utilities. Here you can see the Inflows generators are removed inplace from the VRES Profiles dataframe. You can also check that the values of the capacity factors are correct calculated and reversed.

import ExcelReader
from Utilities import inflowsToCapacityFactors, capacityFactorsToInflows

dPower_Inflows = ExcelReader.get_dPower_Inflows(path_to_inflows)
dPower_VRES = ExcelReader.get_dPower_VRES(path_to_vres)
dPower_VRESProfiles = ExcelReader.get_dPower_VRESProfiles(path_to_vresprofiles)

before = dPower_VRESProfiles.index.get_level_values('g').unique().tolist()
print(f"--- VRES Profiles generators before: --- Len:{len(before)}\n", before)

new_vres = inflowsToCapacityFactors(dPower_Inflows, dPower_VRES, dPower_VRESProfiles)

after = new_vres.index.get_level_values('g').unique().tolist()
print(f"\n--- VRES Profiles generators after: --- Len:{len(after)}\n", after)

unchanged_inflows = capacityFactorsToInflows(new_vres, dPower_VRES, dPower_Inflows, True)

end = new_vres.index.get_level_values('g').unique().tolist()
print(f"\n--- VRES Profiles generators end: --- Len:{len(end)}\n", end)

Copy link
Copy Markdown
Contributor

@FelixCAAuer FelixCAAuer left a comment

Choose a reason for hiding this comment

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

Small question, otherwise good to merge - thank you! :)

@MarcoAnarmo MarcoAnarmo merged commit 00baa53 into main Aug 27, 2025
1 check passed
@MarcoAnarmo MarcoAnarmo deleted the feature/inflowToCapacityFactor branch August 27, 2025 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants