Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions docs/release_notes/upcoming.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ ready to be released, carry out the following steps:
- Fix parsing and validation of agent search space file ([#1293])
- Use shadow prices rather than market prices for appraisal optimisations and dispatch runs during
investment ([#1349])
- Updated input data validation to ensure `capacity_to_activity > 0`. Previously,
`capacity_to_activity = 0` was permitted.

[highs-opts-docs]: ../developer_guide/custom_highs_options.md
[#1259]: https://github.com/EnergySystemsModellingLab/MUSE2/pull/1259
Expand Down
2 changes: 1 addition & 1 deletion schemas/input/processes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fields:
description:
Factor relating capacity units (e.g. GW) to activity units (e.g. PJ). It is the
maximum activity per year for one unit of capacity.
notes: Must be >=0. Optional (defaults to 1.0).
notes: Must be >0. Optional (defaults to 1.0).
- name: unit_size
type: number
description:
Expand Down
3 changes: 1 addition & 2 deletions src/fixture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::agent::{
Agent, AgentCommodityPortionsMap, AgentID, AgentMap, AgentObjectiveMap, AgentSearchSpaceMap,
DecisionRule,
};
use crate::asset::{Asset, AssetCapacity, AssetPool, AssetRef};
use crate::asset::{Asset, AssetPool, AssetRef};
use crate::commodity::{
Commodity, CommodityID, CommodityLevyMap, CommodityType, DemandMap, PricingStrategy,
};
Expand Down Expand Up @@ -406,7 +406,6 @@ pub fn appraisal_output(asset: Asset, time_slice: TimeSliceID) -> AppraisalOutpu
let unmet_demand = indexmap! { time_slice.clone() => Flow(5.0) };
AppraisalOutput {
asset: AssetRef::from(asset),
capacity: AssetCapacity::Continuous(Capacity(42.0)),
coefficients: Rc::new(ObjectiveCoefficients {
activity_coefficients,
market_costs,
Expand Down
4 changes: 2 additions & 2 deletions src/input/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ where

// Validate capacity_to_activity
ensure!(
capacity_to_activity >= ActivityPerCapacity(0.0),
"Error in process {}: capacity_to_activity must be >= 0",
capacity_to_activity > ActivityPerCapacity(0.0),
"Error in process {}: capacity_to_activity must be > 0",
process_raw.id
);

Expand Down
4 changes: 2 additions & 2 deletions src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ impl DebugDataWriter {
asset_id: result.asset.id(),
process_id: result.asset.process_id().clone(),
region_id: result.asset.region_id().clone(),
capacity: result.capacity.total_capacity(),
capacity: result.asset.capacity().total_capacity(),
metric: result.metric.as_ref().map(|m| m.value()),
};
self.appraisal_results_writer.serialize(row)?;
Expand Down Expand Up @@ -1183,7 +1183,7 @@ mod tests {
asset_id: None,
process_id: asset.process_id().clone(),
region_id: asset.region_id().clone(),
capacity: Capacity(42.0),
capacity: Capacity(2.0),
metric: Some(4.14),
};
let records: Vec<AppraisalResultsRow> =
Expand Down
Loading
Loading