Skip to content
Open
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
21 changes: 0 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ log = "0.4.32"
float-cmp = "0.10.0"
itertools = "0.15.0"
serde = {version = "1.0.228", features = ["derive", "rc"]}
serde_string_enum = "0.2.1"
tempfile = "3.27.0"
toml = "1.1.2"
unicase = "2.9.0"
fern = {version = "0.7.1", features = ["chrono", "colored"]}
Comment thread
alexdewar marked this conversation as resolved.
chrono = "0.4"
clap = {version = "4.6.1", features = ["cargo", "derive"]}
Expand Down
4 changes: 4 additions & 0 deletions docs/release_notes/upcoming.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ ready to be released, carry out the following steps:
- Changed the default `pricing_strategy` for SED/SVD commodities from "shadow" to "full_average" ([#1281])
- The `agent_search_space.csv` input file has been renamed to `agent_search_spaces.csv` for
consistency ([#1293])
- Due to an internal change, some options in CSV files are now case sensitive (e.g. you must put
`lcox` rather than `LCOX`). The error message you see if it does not match will now be more
informative, however. ([#1376])

## Bug fixes

Expand All @@ -39,3 +42,4 @@ ready to be released, carry out the following steps:
[#1293]: https://github.com/EnergySystemsModellingLab/MUSE2/pull/1293
[#1319]: https://github.com/EnergySystemsModellingLab/MUSE2/pull/1319
[#1349]: https://github.com/EnergySystemsModellingLab/MUSE2/pull/1349
[#1376]: https://github.com/EnergySystemsModellingLab/MUSE2/pull/1376
8 changes: 4 additions & 4 deletions src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::process::Process;
use crate::region::RegionID;
use crate::units::Dimensionless;
use indexmap::{IndexMap, IndexSet};
use serde_string_enum::DeserializeLabeledStringEnum;
use serde::Deserialize;
use std::collections::HashMap;
use std::rc::Rc;

Expand Down Expand Up @@ -79,12 +79,12 @@ pub enum DecisionRule {
}

/// The type of objective for the agent
#[derive(Debug, Clone, Copy, PartialEq, DeserializeLabeledStringEnum)]
#[derive(Debug, Clone, Copy, PartialEq, Deserialize)]
pub enum ObjectiveType {
/// Average cost of one unit of output commodity over its lifetime
#[string = "lcox"]
#[serde(rename = "lcox")]
LevelisedCostOfX,
/// Net present value
#[string = "npv"]
#[serde(rename = "npv")]
NetPresentValue,
}
17 changes: 8 additions & 9 deletions src/commodity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use crate::time_slice::{TimeSliceID, TimeSliceLevel, TimeSliceSelection};
use crate::units::{Flow, MoneyPerFlow};
use indexmap::IndexMap;
use serde::Deserialize;
use serde_string_enum::DeserializeLabeledStringEnum;
use std::collections::HashMap;
use std::rc::Rc;

Expand Down Expand Up @@ -61,32 +60,32 @@ pub struct Commodity {
define_id_getter! {Commodity, CommodityID}

/// Type of balance for application of cost
#[derive(Eq, PartialEq, Clone, Debug, DeserializeLabeledStringEnum, Hash)]
#[derive(Eq, PartialEq, Clone, Debug, Deserialize, Hash)]
pub enum BalanceType {
/// Applies to production, with an equal and opposite levy/incentive on consumption
#[string = "net"]
#[serde(rename = "net")]
Net,
/// Applies to consumption only
#[string = "cons"]
#[serde(rename = "cons")]
Consumption,
/// Applies to production only
#[string = "prod"]
#[serde(rename = "prod")]
Production,
}

/// Commodity balance type
#[derive(PartialEq, Debug, DeserializeLabeledStringEnum, Clone)]
#[derive(PartialEq, Debug, Deserialize, Clone)]
pub enum CommodityType {
/// Supply and demand of this commodity must be balanced
#[string = "sed"]
#[serde(rename = "sed")]
SupplyEqualsDemand,
/// Specifies a demand (specified in input files) which must be met by the simulation
#[string = "svd"]
#[serde(rename = "svd")]
ServiceDemand,
/// Either an input or an output to the simulation.
///
/// This represents a commodity which can either be produced or consumed, but not both.
#[string = "oth"]
#[serde(rename = "oth")]
Other,
}

Expand Down
8 changes: 4 additions & 4 deletions src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::units::{
use anyhow::{Result, ensure};
use indexmap::{IndexMap, IndexSet};
use itertools::Itertools;
use serde_string_enum::DeserializeLabeledStringEnum;
use serde::Deserialize;
use std::collections::HashMap;
use std::ops::RangeInclusive;
use std::rc::Rc;
Expand Down Expand Up @@ -458,15 +458,15 @@ impl ProcessFlow {
}

/// Type of commodity flow (see [`ProcessFlow`])
#[derive(PartialEq, Default, Debug, Clone, DeserializeLabeledStringEnum)]
#[derive(PartialEq, Default, Debug, Clone, Deserialize)]
pub enum FlowType {
/// The input to output flow ratio is fixed
#[default]
#[string = "fixed"]
#[serde(rename = "fixed")]
Fixed,
/// The flow ratio can vary, subject to overall flow of a specified group of commodities whose
/// input/output ratio must be as per user input data
#[string = "flexible"]
#[serde(rename = "flexible")]
Flexible,
}

Expand Down
19 changes: 4 additions & 15 deletions src/time_slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use indexmap::{IndexMap, IndexSet};
use itertools::Itertools;
use serde::de::Error;
use serde::{Deserialize, Serialize};
Comment on lines 9 to 11

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... this breaks compilation 🤷

use serde_string_enum::DeserializeLabeledStringEnum;
use std::iter;

define_id_type! {Season, "season"}
Expand Down Expand Up @@ -191,26 +190,16 @@ impl TimeSliceSelection {
}

/// The time granularity for a particular operation
#[derive(
PartialEq,
Eq,
PartialOrd,
Ord,
Copy,
Clone,
Debug,
DeserializeLabeledStringEnum,
strum::EnumIter,
)]
#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Debug, Deserialize, strum::EnumIter)]
pub enum TimeSliceLevel {
/// Treat individual time slices separately
#[string = "daynight"]
#[serde(rename = "daynight")]
DayNight,
/// Whole seasons
#[string = "season"]
#[serde(rename = "season")]
Season,
/// The whole year
#[string = "annual"]
#[serde(rename = "annual")]
Annual,
}

Expand Down
Loading