Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
e1df337
Add new model and test scaffolds
cc-a Jun 25, 2024
79016d9
Get tests running
cc-a Jun 27, 2024
549cdd1
Change column titles and order
tsmbland Jul 3, 2024
01760a2
Correct id columns
tsmbland Jul 3, 2024
08c9c70
Ignore default_new_input in regression tests
tsmbland Aug 4, 2025
8059a2e
Fix typo in CO2
tsmbland Aug 4, 2025
e9361da
Fix popping error
tsmbland Aug 8, 2025
355754f
Update to be closer to current MUSE2 format
tsmbland Aug 8, 2025
3179a2c
Bring it even closer to the MUSE2 format
tsmbland Aug 11, 2025
f69b9bd
First pass at duckdb data interface
cc-a Jun 27, 2024
2685eb0
New db tables
tsmbland Jul 3, 2024
71d6388
Update tables for new csv columns
tsmbland Jul 4, 2024
e3b6ece
Split new tests into new file
tsmbland Jul 5, 2024
5b827cd
Tests for new tables
tsmbland Jul 8, 2024
73014f1
Add functions for demand data and (in progress) initial market
tsmbland Aug 15, 2024
1a6652c
Convert timeslice id to int, fix failing test
tsmbland Aug 19, 2024
3de85dd
Finish initial market reader
tsmbland Aug 19, 2024
cd3d3dc
Fix test
tsmbland Aug 19, 2024
e82cb11
Undo rebase mistake
tsmbland Aug 8, 2025
085a080
Delete some outdated code, get the tests passing
tsmbland Aug 12, 2025
5c5b7c2
Small touch ups
tsmbland Aug 13, 2025
36e958a
Add new readers and tests
tsmbland Aug 13, 2025
d5474ac
Simplify code
tsmbland Aug 13, 2025
4d08bc6
Add functions for global_commodities and technodictionary xarrays
tsmbland Aug 13, 2025
fd2f711
process_agent_parameters
tsmbland Aug 13, 2025
ab69b28
process_initial_market
tsmbland Aug 13, 2025
1ca038e
process_initial_capacity
tsmbland Aug 13, 2025
f866d7a
Add functions for expanding years/regions/timeslices
tsmbland Aug 13, 2025
17ab0cb
Allow chained expansions
tsmbland Aug 13, 2025
2ec61a5
Add some validation checks and filling missing data
tsmbland Aug 13, 2025
8bfc5d9
read_process_availabilities
tsmbland Aug 13, 2025
865c5db
Make helpers more generic
tsmbland Aug 13, 2025
a646110
Make the helper functions a bit clearer
tsmbland Aug 13, 2025
dead011
Add more constraints
tsmbland Aug 13, 2025
c4b80a7
Small tidies
tsmbland Aug 13, 2025
d5e279f
Separate fields for input/output flows
tsmbland Aug 13, 2025
95c69c1
Tidy ups
tsmbland Aug 13, 2025
9923ab1
Tidier still
tsmbland Aug 13, 2025
79563f2
Add more validation
tsmbland Aug 15, 2025
2bba85d
Proper validation for process flows and availabilities
tsmbland Aug 15, 2025
038596c
process_io_technodata
tsmbland Aug 18, 2025
ad65bef
process_technodata_timeslices
tsmbland Aug 18, 2025
b599574
process_technologies
tsmbland Aug 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ dependencies = [
"xlrd",
"mypy-extensions",
"pypubsub",
"tomlkit"
"tomlkit",
"duckdb",
"fsspec"
]
dynamic = ["version"]

Expand Down
4 changes: 4 additions & 0 deletions src/muse/data/example/default_new_input/agent_objectives.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
agent_id,objective_type,decision_weight,objective_sort
A1_RES,LCOE,1,TRUE
A1_PWR,LCOE,1,TRUE
A1_GAS,LCOE,1,TRUE
4 changes: 4 additions & 0 deletions src/muse/data/example/default_new_input/agents.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
id,description,region_id,sector_id,search_rule,decision_rule,quantity
A1_RES,Residential sector agent,R1,residential,all,single,1
A1_PWR,Power sector agent,R1,power,all,single,1
A1_GAS,Gas sector agent,R1,gas,all,single,1
6 changes: 6 additions & 0 deletions src/muse/data/example/default_new_input/assets.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
agent_id,process_id,region_id,commission_year,capacity
A1_GAS,gassupply1,R1,1995,7.5
A1_GAS,gassupply1,R1,2000,7.5
A1_PWR,gasCCGT,R1,1995,1
A1_RES,gasboiler,R1,2015,5
A1_RES,gasboiler,R1,2020,5
6 changes: 6 additions & 0 deletions src/muse/data/example/default_new_input/commodities.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
id,description,type,unit
electricity,Electricity,energy,PJ
gas,Gas,energy,PJ
heat,Heat,energy,PJ
wind,Wind,energy,PJ
CO2f,Carbon dioxide,environmental,kt
22 changes: 22 additions & 0 deletions src/muse/data/example/default_new_input/commodity_costs.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
commodity_id,region_id,year,value
electricity,R1,2020,19.5
electricity,R1,2025,21.93518528
electricity,R1,2030,26.50925917
electricity,R1,2035,26.51851861
electricity,R1,2040,23.85185194
electricity,R1,2045,23.97222222
electricity,R1,2050,24.06481472
gas,R1,2020,7.15275
gas,R1,2025,8.10645
gas,R1,2030,9.06015
gas,R1,2035,9.2191
gas,R1,2040,9.37805
gas,R1,2045,9.193829337
gas,R1,2050,9.009608674
CO2f,R1,2020,0.08314119
CO2f,R1,2025,0.120069795
CO2f,R1,2030,0.156998399
CO2f,R1,2035,0.214877567
CO2f,R1,2040,0.272756734
CO2f,R1,2045,0.35394801
CO2f,R1,2050,0.435139285
8 changes: 8 additions & 0 deletions src/muse/data/example/default_new_input/demand.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commodity_id,region_id,year,demand
heat,R1,2020,10
heat,R1,2025,13.3
heat,R1,2030,16.7
heat,R1,2035,20
heat,R1,2040,23.3
heat,R1,2045,26.7
heat,R1,2050,30
7 changes: 7 additions & 0 deletions src/muse/data/example/default_new_input/demand_slicing.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
commodity_id,region_id,time_slice,fraction
heat,R1,all-year.all-week.night,0.1
heat,R1,all-year.all-week.morning,0.15
heat,R1,all-year.all-week.afternoon,0.1
heat,R1,all-year.all-week.early-peak,0.15
heat,R1,all-year.all-week.late-peak,0.3
heat,R1,all-year.all-week.evening,0.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
process_id,region_id,year,time_slice,limit_type,value
gassupply1,R1,all,all,up,0.9
gasCCGT,R1,all,all,up,0.9
windturbine,R1,all,all,up,0.4
12 changes: 12 additions & 0 deletions src/muse/data/example/default_new_input/process_flows.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
process_id,commodity_id,region_id,year,coeff
gassupply1,gas,R1,all,1
gasCCGT,gas,R1,all,-1.67
gasCCGT,electricity,R1,all,1
gasCCGT,CO2f,R1,all,91.67
windturbine,wind,R1,all,-1
windturbine,electricity,R1,all,1
gasboiler,gas,R1,all,-1.16
gasboiler,heat,R1,all,1
gasboiler,CO2f,R1,all,64.71
heatpump,electricity,R1,all,-0.4
heatpump,heat,R1,all,1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
process_id,region_id,year,cap_par,fix_par,var_par,max_capacity_addition,max_capacity_growth,total_capacity_limit,lifetime,discount_rate
gassupply1,R1,all,0,0,2.55,5,1,60,35,0.1
gasCCGT,R1,all,23.78234399,0,0,2,1,60,35,0.1
windturbine,R1,all,36.30771182,0,0,2,1,60,25,0.1
gasboiler,R1,all,3.8,0,0,10,0.02,60,10,0.1
heatpump,R1,all,8.866667,0,0,10,0.02,60,10,0.1
6 changes: 6 additions & 0 deletions src/muse/data/example/default_new_input/processes.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
id,description,sector_id
gassupply1,Gas supply,gas
gasCCGT,Gas CCGT,power
windturbine,Wind turbine,power
gasboiler,Gas boiler,residential
heatpump,Heat pump,residential
2 changes: 2 additions & 0 deletions src/muse/data/example/default_new_input/regions.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,description
R1,Region 1
4 changes: 4 additions & 0 deletions src/muse/data/example/default_new_input/sectors.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
id,description
gas,Gas sector
power,Power sector
residential,Residential sector
7 changes: 7 additions & 0 deletions src/muse/data/example/default_new_input/time_slices.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
season,day,time_of_day,fraction
all-year,all-week,night,0.166667
all-year,all-week,morning,0.166667
all-year,all-week,afternoon,0.1666667
all-year,all-week,early-peak,0.166667
all-year,all-week,late-peak,0.166667
all-year,all-week,evening,0.166667
9 changes: 9 additions & 0 deletions src/muse/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"multiple_agents",
"minimum_service",
"trade",
"default_new_input",
]


Expand Down Expand Up @@ -137,6 +138,8 @@ def copy_model(
_copy_minimum_service(path)
elif name.lower() == "trade":
_copy_trade(path)
elif name.lower() == "default_new_input":
_copy_default_new_input(path)
return path


Expand Down Expand Up @@ -316,6 +319,12 @@ def update_lpsolver(data):
modify_toml(path / "settings.toml", update_lpsolver)


def _copy_default_new_input(path: Path):
from shutil import copytree

copytree(example_data_dir() / "default_new_input", path)


def _copy_default_timeslice(path: Path):
copytree(example_data_dir() / "default_timeslice", path)

Expand Down
Loading
Loading