Skip to content

Commit 98dff8f

Browse files
committed
Rename: flow_type to type/kind
1 parent 9db4f17 commit 98dff8f

5 files changed

Lines changed: 13 additions & 12 deletions

File tree

examples/simple/process_flows.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
process_id,commodity_id,regions,years,coeff,flow_type,flow_cost,is_pac
1+
process_id,commodity_id,regions,years,coeff,type,flow_cost,is_pac
22
GASDRV,GASPRD,all,all,1.0,fixed,,true
33
GASPRC,GASPRD,all,all,-1.05,fixed,,false
44
GASPRC,GASNAT,all,all,1.0,fixed,,true

schemas/input/process_flows.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fields:
2828
title: The flow for this commodity
2929
description: |
3030
Can be <0, indicating an input flow, or >0, indicating an output flow. Cannot be zero.
31-
- name: flow_type
31+
- name: type
3232
type: string
3333
title: The type of commodity flow
3434
description: Currently this value must be `fixed`

src/input/process.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ mod tests {
306306
indexmap! { commodity_sed.id.clone() => ProcessFlow {
307307
commodity: commodity_sed.into(),
308308
coeff: -10.0,
309-
flow_type: FlowType::Fixed,
309+
kind: FlowType::Fixed,
310310
flow_cost: 1.0,
311311
is_pac: false,
312312
}},
@@ -320,7 +320,7 @@ mod tests {
320320
indexmap! {commodity_sed.id.clone()=>ProcessFlow {
321321
commodity: commodity_sed.into(),
322322
coeff: 10.0,
323-
flow_type: FlowType::Fixed,
323+
kind: FlowType::Fixed,
324324
flow_cost: 1.0,
325325
is_pac: false,
326326
}},
@@ -381,7 +381,7 @@ mod tests {
381381
indexmap! { commodity_svd.id.clone() => ProcessFlow {
382382
commodity: commodity_svd.into(),
383383
coeff: 10.0,
384-
flow_type: FlowType::Fixed,
384+
kind: FlowType::Fixed,
385385
flow_cost: 1.0,
386386
is_pac: false,
387387
}},

src/input/process/flow.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ struct ProcessFlowRaw {
2222
regions: String,
2323
coeff: f64,
2424
#[serde(default)]
25-
flow_type: FlowType,
25+
#[serde(rename = "type")]
26+
kind: FlowType,
2627
flow_cost: Option<f64>,
2728
is_pac: bool,
2829
}
@@ -38,7 +39,7 @@ impl ProcessFlowRaw {
3839

3940
// **TODO**: https://github.com/EnergySystemsModellingLab/MUSE_2.0/issues/300
4041
ensure!(
41-
self.flow_type == FlowType::Fixed,
42+
self.kind == FlowType::Fixed,
4243
"Commodity flexible assets are not currently supported"
4344
);
4445

@@ -109,7 +110,7 @@ where
109110
let process_flow = ProcessFlow {
110111
commodity: Rc::clone(commodity),
111112
coeff: record.coeff,
112-
flow_type: record.flow_type,
113+
kind: record.kind,
113114
flow_cost: record.flow_cost.unwrap_or(0.0),
114115
is_pac: record.is_pac,
115116
};
@@ -203,7 +204,7 @@ mod tests {
203204

204205
fn create_process_flow_raw(
205206
coeff: f64,
206-
flow_type: FlowType,
207+
kind: FlowType,
207208
flow_cost: Option<f64>,
208209
is_pac: bool,
209210
) -> ProcessFlowRaw {
@@ -213,7 +214,7 @@ mod tests {
213214
years: "2020".into(),
214215
regions: "region".into(),
215216
coeff,
216-
flow_type,
217+
kind,
217218
flow_cost,
218219
is_pac,
219220
}
@@ -248,7 +249,7 @@ mod tests {
248249
ProcessFlow {
249250
commodity,
250251
coeff,
251-
flow_type: FlowType::Fixed,
252+
kind: FlowType::Fixed,
252253
flow_cost: 0.0,
253254
is_pac,
254255
}

src/process.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub struct ProcessFlow {
8787
/// Positive value indicates flow out and negative value indicates flow in.
8888
pub coeff: f64,
8989
/// Identifies if a flow is fixed or flexible.
90-
pub flow_type: FlowType,
90+
pub kind: FlowType,
9191
/// Cost per unit flow.
9292
///
9393
/// For example, cost per unit of natural gas produced. The user can apply it to any specified

0 commit comments

Comments
 (0)