Skip to content

Commit

Permalink
solved non-backward compatibility with temperatures and yaml config f…
Browse files Browse the repository at this point in the history
…iles
  • Loading branch information
squoilin committed Jan 29, 2020
1 parent d65a1d8 commit 882b310
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dispaset/preprocessing/data_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,12 +483,18 @@ def load_config_yaml(filename,AbsPath=True):
except yaml.YAMLError as exc:
logging.error('Cannot parse config file: {}'.format(filename))
raise exc

# List of parameters to be added if not present (for backward compatibility):
params_to_be_added = ['Temperatures']
for param in params_to_be_added:
if param not in config:
config[param] = ''

# List of parameters for which an external file path must be specified:
params = ['Demand', 'Outages', 'PowerPlantData', 'RenewablesAF', 'LoadShedding', 'NTC', 'Interconnections',
'ReservoirScaledInflows', 'PriceOfNuclear', 'PriceOfBlackCoal', 'PriceOfGas', 'PriceOfFuelOil',
'PriceOfBiomass', 'PriceOfCO2', 'ReservoirLevels', 'PriceOfLignite', 'PriceOfPeat','HeatDemand',
'CostHeatSlack','CostLoadShedding']
'CostHeatSlack','CostLoadShedding','Temperatures']

if AbsPath:
# Changing all relative paths to absolute paths. Relative paths must be defined
Expand Down
1 change: 1 addition & 0 deletions tests/conf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ PriceOfPeat: 'Database/FuelPrices/Biomass/2015.csv'
RenewablesAF: 'tests/dummy_data/AvailabilityFactors/##/2015.csv'
ReservoirLevels: ''
ReservoirScaledInflows: ''
Temperatures: 'tests/dummy_data/Temperatures.csv'

#----------------
zones: [ 'Z1', 'Z2', 'ZZ3']
Expand Down

0 comments on commit 882b310

Please sign in to comment.