muse.sectors package
Submodules
muse.sectors.abstract module
- class AbstractSector[source]
Bases:
ABCAbstract base class for sectors.
Sectors are part of type hierarchy with
AbstractSectorat the apex: all sectors should derive fromAbstractSectordirectly or indirectly.MUSE only requires two things of a sector. Sector should be instanstiable via a
factory()function. And they should be callable vianext().AbstractSectordeclares an interface with these two functions. Sectors which derive from it will be warned if either method is not implemented.
muse.sectors.preset_sector module
Sector with preset behaviours.
muse.sectors.register module
- SECTORS_REGISTERED = {'default': <bound method Sector.factory of <class 'muse.sectors.sector.Sector'>>, 'preset': <bound method PresetSector.factory of <class 'muse.sectors.preset_sector.PresetSector'>>, 'presets': <bound method PresetSector.factory of <class 'muse.sectors.preset_sector.PresetSector'>>}
Dictionary of sectors.
muse.sectors.sector module
- class Sector(name, technologies, supply_prod, subsectors=[], interactions=None, outputs=None, timeslice_level=None)[source]
Bases:
AbstractSectorBase class for all sectors.
- property agents
Iterator over all agents in the sector.
- property capacity
Aggregates capacity across agents.
The capacities are aggregated leaving only two dimensions: asset (technology, installation date, region), year.
- interactions
A function for outputting data for post-mortem analysis.
- market_variables(market, technologies)[source]
Computes resulting market: production, consumption, and costs.
- name
Timeslice level for the sector (e.g. “month”).
- next(mca_market)[source]
Advance sector by one time period.
- Parameters:
mca_market – Market with
demand,supply, andprices.- Returns:
A market containing the
supplyoffered by the sector, it’s attendantconsumptionof fuels and materials and the associatedcosts.
- output_data
- outputs
Computes production as used to return the supply to the MCA.
It can be anything registered with
@register_production.
- subsectors
Parameters describing the sector’s technologies.
- supply_prod
Full supply, consumption and costs data for the most recent year.
- technologies
- timeslice_level
Subsectors controlled by this object.
muse.sectors.subsector module
- class Subsector(agents, commodities, demand_share=None, constraints=None, investment=None, name='subsector', expand_market_prices=False, timeslice_level=None)[source]
Bases:
objectAgent group servicing a subset of the sectorial commodities.
- classmethod factory(settings, technologies, regions=None, current_year=None, name='subsector', timeslice_level=None)[source]
- timeslice_level
Whether to expand prices to include destination region.
If
True, the input market prices are expanded of the missing “dst_region” dimension by setting them to the maximum between the source and destination region.
- aggregate_enduses(technologies)[source]
Aggregate enduse commodities for a set of technologies.
Returns a list of all enduse commodities associated with the technologies in the input dataset. Enduse commodities are determined using based on the comm_usage attribute of the technologies, using the is_enduse function from the muse.commodities module.
Module contents
Define a sector, e.g. aggregation of agents.
There are three main kinds of sectors classes, encompassing three use cases:
Sector: The main workhorse sector of the model. It contains only on kind of data, namely the agents responsible for holding assets and investing in new assets.PresetSector: A sector that is meant to generate demand for the sectors above using a fixed formula or schedule.
All the sectors derive from AbstractSector. The AbstractSector defines
two abstract functions which should be declared by derived sectors. Abstract
here means a common programming practice where some concept in the code (e.g. a sector)
is given an explicit interface, with the goal of making it easier for other programmers
to use and implement the concept.
AbstractSector.factory(): Creates a sector from input dataAbstractSector.next(): A function which takes a market (demand, supply, prices) and returns a market. What happens within could be anything, though it will likely consists of dispatch and investment.
New sectors can be registered with the MUSE input files using
muse.sectors.register.register_sector().
- class AbstractSector[source]
Bases:
ABCAbstract base class for sectors.
Sectors are part of type hierarchy with
AbstractSectorat the apex: all sectors should derive fromAbstractSectordirectly or indirectly.MUSE only requires two things of a sector. Sector should be instanstiable via a
factory()function. And they should be callable vianext().AbstractSectordeclares an interface with these two functions. Sectors which derive from it will be warned if either method is not implemented.
- class PresetSector(presets, interpolation_mode='linear', name='preset')[source]
Bases:
AbstractSectorSector with outcomes fixed from the start.
- interpolation_mode
Interpolation method
- name
Name by which to identify a sector
- presets
Market across time and space.
- class Sector(name, technologies, supply_prod, subsectors=[], interactions=None, outputs=None, timeslice_level=None)[source]
Bases:
AbstractSectorBase class for all sectors.
- property agents
Iterator over all agents in the sector.
- property capacity
Aggregates capacity across agents.
The capacities are aggregated leaving only two dimensions: asset (technology, installation date, region), year.
- interactions
A function for outputting data for post-mortem analysis.
- market_variables(market, technologies)[source]
Computes resulting market: production, consumption, and costs.
- name
Timeslice level for the sector (e.g. “month”).
- next(mca_market)[source]
Advance sector by one time period.
- Parameters:
mca_market – Market with
demand,supply, andprices.- Returns:
A market containing the
supplyoffered by the sector, it’s attendantconsumptionof fuels and materials and the associatedcosts.
- output_data
- outputs
Computes production as used to return the supply to the MCA.
It can be anything registered with
@register_production.
- subsectors
Parameters describing the sector’s technologies.
- supply_prod
Full supply, consumption and costs data for the most recent year.
- technologies
- timeslice_level
Subsectors controlled by this object.