From 8b40631040f7bf0c69f92d708a77675ef35811ec Mon Sep 17 00:00:00 2001 From: Tom Bland Date: Fri, 26 Jul 2024 16:44:25 +0100 Subject: [PATCH 1/3] Brush up documentation --- docs/inputs/toml.rst | 21 +++++++++---------- .../data/example/trade/technodata/Agents.csv | 4 ++-- src/muse/demand_share.py | 12 +++++------ 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/docs/inputs/toml.rst b/docs/inputs/toml.rst index e018f8306..7503eab23 100644 --- a/docs/inputs/toml.rst +++ b/docs/inputs/toml.rst @@ -518,18 +518,17 @@ to define the timeslice simply by referring to the slices it will use at each le *demand_share* A method used to split the MCA demand into separate parts to be serviced by - specific agents. A basic distinction is between *new* and *retrofit* agents: the - former asked to respond to an increase of commodity demand investing in new - assets; the latter asked to invest in new asset to balance the decommissined - assets. - - There are currently two options: + specific agents. The appropriate choice depends on the type of agents being used + in the simulation. There are currently two options: - - :py:func:`~muse.demand_share.new_and_retro`: the demand is split into a - retrofit demand corresponding to demand that used to be serviced by - decommisioned assets, and the *new* demand. - - :py:func:`~muse.demand_share.market_demand`: simply the consumption for the - forecast year. + - :py:func:`~muse.demand_share.standard_demand` (default): The input demand is + split amongst *new* agents. *New* agents get a share of the increase in demand + for the forecast years, as well as the demand that occurs from decommissioned + assets. + - :py:func:`~muse.demand_share.new_and_retro`: The input demand is split amongst + both *new* and *retrofit* agents. *New* agents get a share of the increase in + demand for the forecast year, whereas *retrofit* agents are assigned a share of + the demand that occurs from decommissioned assets. *constraints* The list of constraints to apply to the LP problem solved by the sector. By diff --git a/src/muse/data/example/trade/technodata/Agents.csv b/src/muse/data/example/trade/technodata/Agents.csv index 42fd21d17..02be47962 100644 --- a/src/muse/data/example/trade/technodata/Agents.csv +++ b/src/muse/data/example/trade/technodata/Agents.csv @@ -1,3 +1,3 @@ AgentShare,Name,RegionName,Objective,ObjData,Objsort,SearchRule,DecisionMethod,MaturityThreshold,SpendLimit,Type -agent_share,A1,R1,ALCOE,1,TRUE,from_assets->compress->reduce_assets,singleObj,-1,inf,default -agent_share,A1,R2,ALCOE,1,TRUE,from_assets->compress->reduce_assets,singleObj,-1,inf,default +agent_share,A1,R1,ALCOE,1,TRUE,from_assets->compress->reduce_assets,singleObj,-1,inf,Retrofit +agent_share,A1,R2,ALCOE,1,TRUE,from_assets->compress->reduce_assets,singleObj,-1,inf,Retrofit diff --git a/src/muse/demand_share.py b/src/muse/demand_share.py index be2b2f574..27e3eba56 100644 --- a/src/muse/demand_share.py +++ b/src/muse/demand_share.py @@ -107,7 +107,7 @@ def demand_share( return cast(DEMAND_SHARE_SIGNATURE, demand_share) -@register_demand_share(name="default") +@register_demand_share(name="new_and_retro") def new_and_retro( agents: Sequence[AbstractAgent], market: xr.Dataset, @@ -118,9 +118,9 @@ def new_and_retro( ) -> xr.DataArray: r"""Splits demand across new and retro agents. - The input demand is split amongst both *new* and *retro* agents. *New* agents get a - share of the increase in demand for the forecast year, whereas *retrofi* agents are - assigned a share of the demand that occurs from decommissioned assets. + The input demand is split amongst both *new* and *retrofit* agents. *New* agents get + a share of the increase in demand for the forecast year, whereas *retrofit* agents + are assigned a share of the demand that occurs from decommissioned assets. Args: agents: a list of all agents. This list should mainly be used to determine the @@ -318,7 +318,7 @@ def decommissioning(capacity): return result -@register_demand_share(name="standard_demand") +@register_demand_share(name="default") def standard_demand( agents: Sequence[AbstractAgent], market: xr.Dataset, @@ -330,7 +330,7 @@ def standard_demand( r"""Splits demand across new agents. The input demand is split amongst *new* agents. *New* agents get a - share of the increase in demand for the forecast years well as the demand that + share of the increase in demand for the forecast years, as well as the demand that occurs from decommissioned assets. Args: From 2ec091224f8b4c283e6176c2f420ddba5e4e3142 Mon Sep 17 00:00:00 2001 From: Tom Bland Date: Fri, 26 Jul 2024 17:15:06 +0100 Subject: [PATCH 2/3] Fix alignment --- docs/inputs/toml.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/inputs/toml.rst b/docs/inputs/toml.rst index 7503eab23..740cfb3bc 100644 --- a/docs/inputs/toml.rst +++ b/docs/inputs/toml.rst @@ -522,13 +522,13 @@ to define the timeslice simply by referring to the slices it will use at each le in the simulation. There are currently two options: - :py:func:`~muse.demand_share.standard_demand` (default): The input demand is - split amongst *new* agents. *New* agents get a share of the increase in demand - for the forecast years, as well as the demand that occurs from decommissioned - assets. + split amongst *new* agents. *New* agents get a share of the increase in demand + for the forecast years, as well as the demand that occurs from decommissioned + assets. - :py:func:`~muse.demand_share.new_and_retro`: The input demand is split amongst - both *new* and *retrofit* agents. *New* agents get a share of the increase in - demand for the forecast year, whereas *retrofit* agents are assigned a share of - the demand that occurs from decommissioned assets. + both *new* and *retrofit* agents. *New* agents get a share of the increase in + demand for the forecast year, whereas *retrofit* agents are assigned a share + of the demand that occurs from decommissioned assets. *constraints* The list of constraints to apply to the LP problem solved by the sector. By From d01ed8b38c9931724cc93e5498d027b56fa4966e Mon Sep 17 00:00:00 2001 From: Tom Bland Date: Fri, 26 Jul 2024 17:17:37 +0100 Subject: [PATCH 3/3] Revert change to trade model --- src/muse/data/example/trade/technodata/Agents.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/muse/data/example/trade/technodata/Agents.csv b/src/muse/data/example/trade/technodata/Agents.csv index 02be47962..42fd21d17 100644 --- a/src/muse/data/example/trade/technodata/Agents.csv +++ b/src/muse/data/example/trade/technodata/Agents.csv @@ -1,3 +1,3 @@ AgentShare,Name,RegionName,Objective,ObjData,Objsort,SearchRule,DecisionMethod,MaturityThreshold,SpendLimit,Type -agent_share,A1,R1,ALCOE,1,TRUE,from_assets->compress->reduce_assets,singleObj,-1,inf,Retrofit -agent_share,A1,R2,ALCOE,1,TRUE,from_assets->compress->reduce_assets,singleObj,-1,inf,Retrofit +agent_share,A1,R1,ALCOE,1,TRUE,from_assets->compress->reduce_assets,singleObj,-1,inf,default +agent_share,A1,R2,ALCOE,1,TRUE,from_assets->compress->reduce_assets,singleObj,-1,inf,default