Skip to content

Commit

Permalink
updated for vm
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Eggimann committed Feb 28, 2019
1 parent 173644a commit 5f7dbf5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 30 deletions.
7 changes: 5 additions & 2 deletions energy_demand/basic/demand_supply_interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ def constrained_results(
key_name = "{}_{}_{}".format(submodel, fueltype_str, tech_simplified)
supply_results[key_name] = fuel_tech[submodel_nr][:, fueltype_int, :]

for key_name, values in supply_results.items():
if testing_functions.test_if_minus_value_in_array(values):
raise Exception("TTT {} {}".format(key_name, np.sum(values)))

# ---------------------------------
# Add non_heating for all fueltypes
# ---------------------------------
Expand All @@ -105,9 +109,8 @@ def constrained_results(
for key_name, values in supply_results.items():
if testing_functions.test_if_minus_value_in_array(values):
logging.info("info tt: {} {}".format(values, np.sum(values)))
raise Exception("Error d: Negative entry in results " + str(key_name))
raise Exception("Error d: Negative entry in results {} {}".format(key_name, np.sum(values)))

logging.info("... Prepared results for energy supply model in constrained mode")
return supply_results

def unconstrained_results(
Expand Down
6 changes: 5 additions & 1 deletion energy_demand/enduse_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import matplotlib.pyplot as plt
import copy

from energy_demand.basic import date_prop
from energy_demand.basic import date_prop, testing_functions
from energy_demand.profiles import load_factors as lf
from energy_demand.technologies import diffusion_technologies
from energy_demand.technologies import fuel_service_switch
Expand Down Expand Up @@ -337,6 +337,10 @@ def __init__(
mode_constrained=False,
param_lf_improved_cy=strategy_vars['dm_improvement'][enduse][curr_yr],
make_all_flat=make_all_flat)

if testing_functions.test_if_minus_value_in_array(self.fuel_yh):
print("MINUS VALUE {} {} {}".format(enduse, sector, np.sum(self.fuel_yh)))
raise Exception

def load_shifting_multiple_tech(
enduse,
Expand Down
27 changes: 0 additions & 27 deletions wrapperconfi_CLUSTERg.ini

This file was deleted.

0 comments on commit 5f7dbf5

Please sign in to comment.