diff --git a/docs/release_notes/upcoming.md b/docs/release_notes/upcoming.md index b20948d9..438946a2 100644 --- a/docs/release_notes/upcoming.md +++ b/docs/release_notes/upcoming.md @@ -13,3 +13,17 @@ ready to be released, carry out the following steps: version --> + +## New features + + + +## Breaking changes + + + +## Bug fixes + +- Fix misleading warning message for assets decommissioned before simulation start ([#1259]) + +[#1259]: https://github.com/EnergySystemsModellingLab/MUSE2/pull/1259 diff --git a/src/asset.rs b/src/asset.rs index a56ea7d7..be92a0c2 100644 --- a/src/asset.rs +++ b/src/asset.rs @@ -340,8 +340,8 @@ impl Asset { let max_decommission_year = max_decommission_year.unwrap_or(commission_year + process_parameter.lifetime); ensure!( - max_decommission_year >= commission_year, - "Max decommission year must be after/same as commission year" + max_decommission_year > commission_year, + "Max decommission year must be greater than commission year" ); Ok(Self { diff --git a/src/asset/pool.rs b/src/asset/pool.rs index 899dcb84..3b0007fd 100644 --- a/src/asset/pool.rs +++ b/src/asset/pool.rs @@ -35,11 +35,11 @@ impl AssetPool { // Ignore assets that have already been decommissioned if asset.max_decommission_year() <= year { warn!( - "Asset '{}' with commission year {} and lifetime {} was decommissioned before \ + "User asset '{}' with commission year {} was decommissioned in {}, before \ the start of the simulation", asset.process_id(), asset.commission_year, - asset.process_parameter.lifetime + asset.max_decommission_year ); continue; }