Skip to content

Commit

Permalink
[SMS-272] compose runspec (#47)
Browse files Browse the repository at this point in the history
* tests: base oseomosys construction

* feat: improvement to base abstraction

* feat: add validation for time_defintion

* tests: for time_definition

* add test_otoole_roundtrip pytest

* [SMS-239] cleanup noqa test data (#36)

* fix: rm otoole sample data from tests

* feat: import utils by name

* fix: cleanup some DS store

* fix: import utils

* Refactor root_validator to model_validator (#37)

* tests: otoole_roundtrip

* feat: fitler pandas=3. dep warning

* tests: roundtrip otoole timedefn

* delint

* otoole_roundtrip as pytest

* fix: rename otoole-csv paths

* fix: make long_name and description optional

* tests: skip full otoole construction for now

* tests: test region construction

* feat: make base osemosys data built from args[0]

* fix: rm composable assumptions and targets for now

* fix: accidental rename

* fix: accident rename test case

* tests: commodity construction and compatability

* feat: begin refactor to /compat

* feat: add 'isnumeric' helper util

* refactor: defaults to initial import, don't import pydatnic schemas

* refactor: defaults and compat

* feat: commodity schema

* feat: make data construction more flexible

* feat: build and test impact construction

* tests: impact otoole roundtrip

* fix: some cleanup on commodity testing

* tests: touchup test-impact

* tests: technology construction

* feat: otoole compatability for technology

* feat: add to defaults

* feat: region and impact compat

* feat: validation for technology

* tests: runspec construction and roundtrip

* feat: add defaults for discount rate depreciation method

* feat: instantiate RunSpec on load model

* feat: add a depreciation_method enum

* feat: include reserve margin in commodity and technology defn

* feat: otoole compatability for RunSpec and Technology

* fix: return 'self' from model_validator(mode='after')

* feat: finish RunSpec model

* tests: roundtrip and yaml compatability

* feat: add data casting for OSeMOSYSData

* refactor into composeable OSeMOSYSData class

* refactor: move otoole time_defn to compat

* feat: test commodity composition

* tests: rename composition base test

* feat: add dtype to operating mode vars

* feat: refactor compose

* feat: compose technologies

* feat: compose all schema

* tests: runspec composition

* fix: simplify yaml to start with passing case

* feat: load model yaml

* fix: create timedefinition from yearparts and dayparts

* additional fail cases test_compose_base.py

* additional fail cases test_runspec.py

* fix: delint

---------

Co-authored-by: edwardxtg <edwardxtg@gmail.com>
Co-authored-by: edwardxtg <71764756+edwardxtg@users.noreply.github.com>
  • Loading branch information
3 people committed Feb 29, 2024
1 parent 93f64c9 commit 0e6f509
Show file tree
Hide file tree
Showing 25 changed files with 1,462 additions and 1,113 deletions.
75 changes: 60 additions & 15 deletions examples/CAISO-ERCOT-IC/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

# alias data
# custom defined cross-references
ELEC-DAILY-PROFILE: &ELEC-DAILY-PROFILE
- 0.05 # 0 - 4
- 0.10 # 4 - 8
- 0.20 # 8 - 12
- 0.20 # 12 - 16
- 0.30 # 16 - 20
- 0.15 # 20 - 24
ELEC-DAILY-PROFILE:
s1-h1: 0.05 # 0 - 4
s1-h2: 0.10 # 4 - 8
s1-h3: 0.20 # 8 - 12
s1-h4: 0.20 # 12 - 16
s1-h5: 0.30 # 16 - 20
s1-h6: 0.15 # 20 - 24

# Model Nameplate
id: my-model
Expand All @@ -31,7 +31,7 @@ regions:
neighbours:
- US-TX
- PACIFIC-MARKET
- id: UX-TX
- id: US-TX
long_name: Texas
description: "The US state of Texas"
neighbours:
Expand All @@ -50,9 +50,10 @@ regions:

# TIME DEFINTIONS
time_definition:
id: 2022_2040_6yrpart_12daypart
years: "range(2022,2041)"
dayparts: 6
yearparts: 12
daily_time_brackets: 6
seasons: 1

# FINANCIALS
depreciation_method: "straight-line"
Expand All @@ -68,8 +69,7 @@ commodities:
US-TX: "{y:(1.73*1.1**(y-2022)) for y in ${time_definition.years}}"
demand_profile:
"*": # region
"*": # year
"*": *ELEC-DAILY-PROFILE # season -> use YAML cross-referencing
"*": "${ELEC-DAILY-PROFILE}" # year: timeslice

# IMPACTS
impacts:
Expand All @@ -83,10 +83,55 @@ impacts:
constraint: "{y:225*((2041-y)/(2041-2022)) for y in ${time_definition.years}}"

# RENEWABLE TARGETS
renewable_targets:
renewable_production_target:
US-CA: "{y:0.1*((2041-y)/(2041-2022))+0.4 for y in ${time_definition.years}}"
US-TX: "{y:0.1*((2041-y)/(2041-2022))+0.2 for y in ${time_definition.years}}"

# RESERVE MARGINS
reserve_margins_commodity: null
reserve_margins_technology: 0.1
reserve_margin: null

# technologies:
# - id: SPV
# long_name: solar photovoltaic
# description: solar photovoltaic
# activity_unit_ratio: 30.41667
# capacity_addition_size: null
# availability_factor: 1.
# capacity_factor: 1.
# operating_life: 25
# is_renewable: true
# include_regions: null
# exclude_regions:
# - ATLANTIC-MARKET
# - PACIFIC-MARKET
# capex:
# "*": "{y:700 - 100*(max(${time_definition.years})-y)/(max(${time_definition.years}) - min(${time_definition.years})) for y in ${time_definition.years}}"
# opex_fixed: 10
# operating_modes:
# - id: GEN
# long_name: generation mode
# description: default generation mode
# impact_activity_ratio: 0.
# input_activity_ratio: null
# output_activity_ratio:
# "*": # all regions
# ELEC:
# "*": # all years
# 1.
# to_storage: null
# from_storage: null
# opex_variable: 0.
# residual_capacity: 1.
# gross_capacity_max: 35.
# additional_capacity_max_ceil: null
# additional_capacity_max_floor: 5
# additional_capacity_max_growth_rate: 0.1
# gross_capacity_min: 0.
# additional_capacity_min: 0.
# additional_capacity_min_growth_rate: 0.

# # constraints - activity
# annual_activity_max: null
# annual_activity_min: null
# total_activity_max: null
# total_activity_min: null
Loading

0 comments on commit 0e6f509

Please sign in to comment.