How kgreen7/nzupy works
NZUpy is a Python model for projecting and balancing NZ ETS unit supply and demand. A user configures years, scenarios and component assumptions through the NZUpy API, then runs scenarios to obtain price, emissions, supply and stockpile results; chart tools present those outputs. The graph preserves the documented supply and demand stages, scenario and optimisation machinery, data/configuration layer, and visualisation capabilities. Some source was unsampled, so links not established by excerpts or README are omitted; dashed links mark documented capabilities whose internal calls were not shown.
Main entry points: base_model.py NZUpy API · chart_generator.py Chart generator · runner.py Model runner · calculation_engine.py Calculation engine
Components 20
Model orchestration
- NZUpy API
model/core/base_model.py - Scenario manager
model/core/scenario_manager.py - Model runner
model/core/runner.py - Calculation engine
model/core/calculation_engine.py - Price optimiser
model/core/optimiser.py
Supply components
- Auctions
model/supply/auction.py - Industrial allocation
model/supply/industrial.py - Forestry response
model/supply/forestry.py - Stockpile dynamics
model/supply/stockpile.py
Demand components
- Baseline emissions
model/demand/emissions.py - Price response
model/demand/price_response.py
Configuration and data
- Model configuration
model/config.py - Input data handler
model/utils/data_handler.py - Price conversion
model/utils/price_convert.py
Results and charts
- Output formatter
model/utils/output_format.py - Chart generator
model/interface/chart_generator.py - Single-run charts
model/interface/single_charts.py - Range charts
model/interface/range_charts.py - Chart configuration
model/interface/chart_config.py
Other components
- Model user
Connections 20
- Model user → NZUpy API: configures and runs
README.md - NZUpy API → Scenario manager: manages scenarios
model/core/base_model.py - NZUpy API → Model runner: runs model
model/core/base_model.py - NZUpy API → Calculation engine: evaluates gap
model/core/base_model.py - Calculation engine → Stockpile dynamics: calculates stockpile
model/core/calculation_engine.py - Model runner → Price optimiser: uses optimiser
model/core/runner.py - NZUpy API → Auctions: configures supply
model/core/base_model.py - NZUpy API → Industrial allocation: configures supply
model/core/base_model.py - NZUpy API → Forestry response: configures supply
model/core/base_model.py - NZUpy API → Stockpile dynamics: configures supply
model/core/base_model.py - NZUpy API → Baseline emissions: configures demand
model/core/base_model.py - NZUpy API → Price response: configures demand
model/core/base_model.py - NZUpy API → Input data handler: loads inputs
model/core/base_model.py - Input data handler → Price conversion: uses conversion
model/utils/data_handler.py - NZUpy API → Output formatter: formats results
model/core/base_model.py - Model user → Chart generator: requests charts
README.md - Chart generator → Single-run charts: renders single runs
model/interface/chart_generator.py - Chart generator → Range charts: renders ranges
model/interface/chart_generator.py - Single-run charts → Chart configuration: uses styles
model/interface/single_charts.py - Range charts → Chart configuration: uses styles
model/interface/range_charts.py