Skip to content

Commit

Permalink
chore: Remove completed TODOs. (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
jetuk authored Jul 19, 2024
1 parent f1a2f3f commit d69d26b
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 7 deletions.
2 changes: 0 additions & 2 deletions pywr-core/src/metric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,13 @@ impl MetricF64 {
MetricF64::NodeVolume(idx) => Ok(state.get_network_state().get_node_volume(idx)?),
MetricF64::AggregatedNodeInFlow(idx) => {
let node = model.get_aggregated_node(idx)?;
// TODO this could be more efficient with an iterator method? I.e. avoid the `Vec<_>` allocation
node.get_nodes()
.iter()
.map(|idx| state.get_network_state().get_node_in_flow(idx))
.sum::<Result<_, _>>()
}
MetricF64::AggregatedNodeOutFlow(idx) => {
let node = model.get_aggregated_node(idx)?;
// TODO this could be more efficient with an iterator method? I.e. avoid the `Vec<_>` allocation
node.get_nodes()
.iter()
.map(|idx| state.get_network_state().get_node_out_flow(idx))
Expand Down
2 changes: 1 addition & 1 deletion pywr-core/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ impl FlowConstraints {
/// Defaults to f64::MAX if no parameter is defined.
pub fn get_max_flow(&self, network: &Network, state: &State) -> Result<f64, PywrError> {
match &self.max_flow {
None => Ok(f64::MAX), // TODO should this return infinity?
None => Ok(f64::MAX),
Some(m) => m.get_value(network, state),
}
}
Expand Down
2 changes: 0 additions & 2 deletions pywr-core/src/parameters/aggregated_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ impl GeneralParameter<usize> for AggregatedIndexParameter {
state: &State,
_internal_state: &mut Option<Box<dyn ParameterState>>,
) -> Result<usize, PywrError> {
// TODO scenarios!

let value: usize = match self.agg_func {
AggIndexFunc::Sum => {
let mut total = 0;
Expand Down
1 change: 0 additions & 1 deletion pywr-core/src/parameters/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ impl Parameter for ConstantParameter {
}
}

// TODO this should only need to implement `ConstantParameter` when that is implemented.
impl ConstParameter<f64> for ConstantParameter {
fn compute(
&self,
Expand Down
1 change: 0 additions & 1 deletion pywr-core/src/parameters/division.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ impl GeneralParameter<f64> for DivisionParameter {
state: &State,
_internal_state: &mut Option<Box<dyn ParameterState>>,
) -> Result<f64, PywrError> {
// TODO handle scenarios
let denominator = self.denominator.get_value(model, state)?;

if denominator == 0.0 {
Expand Down

0 comments on commit d69d26b

Please sign in to comment.