Skip to content

Commit 99d43f3

Browse files
#35 Implemented Negative Deployment Check, Error, and Correct
added an if statement to the beginning of the mass code checking for negative deployment, which prints a message and sets all deployment that is negative to 0.
1 parent 6b27807 commit 99d43f3

File tree

4 files changed

+6469
-6992
lines changed

4 files changed

+6469
-6992
lines changed

PV_ICE/main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,11 @@ def calculateMassFlow(self, scenarios=None, materials_input=None,
684684

685685
# Standard method to calculate Area from the Power
686686
else:
687+
#negative deployment check, error, correct
688+
if (df['new_Installed_Capacity_[MW]'].values<0).any():
689+
print('You have at least 1 negative annual deployment! All years of negative deployment have been set to 0.')
690+
df.loc[df['new_Installed_Capacity_[MW]']<0,'new_Installed_Capacity_[MW]'] = 0.0
691+
687692
df['new_Installed_Capacity_[W]'] = (
688693
df['new_Installed_Capacity_[MW]']*1e6)
689694

0 commit comments

Comments
 (0)