Skip to content

Commit

Permalink
feat: Improve the metric set implementation.
Browse files Browse the repository at this point in the history
This now includes nested aggregation, hooking up the metric
sets to the model and use by the CSV recorder.

There's still some WIP but a general review would be good
at this point.
  • Loading branch information
jetuk committed Dec 11, 2023
1 parent 8c8e573 commit 517f2f5
Show file tree
Hide file tree
Showing 12 changed files with 622 additions and 144 deletions.
8 changes: 5 additions & 3 deletions pywr-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extern crate core;
use crate::derived_metric::DerivedMetricIndex;
use crate::node::NodeIndex;
use crate::parameters::{IndexParameterIndex, InterpolationError, MultiValueParameterIndex, ParameterIndex};
use crate::recorders::RecorderIndex;
use crate::recorders::{MetricSetIndex, RecorderIndex};
use pyo3::exceptions::{PyException, PyRuntimeError};
use pyo3::{create_exception, PyErr};
use thiserror::Error;
Expand Down Expand Up @@ -49,8 +49,8 @@ pub enum PywrError {
MultiValueParameterKeyNotFound(String),
#[error("parameter {0} not found")]
ParameterNotFound(String),
#[error("metric set index not found")]
MetricSetIndexNotFound,
#[error("metric set index {0} not found")]
MetricSetIndexNotFound(MetricSetIndex),
#[error("metric set with name {0} not found")]
MetricSetNotFound(String),
#[error("recorder index not found")]
Expand Down Expand Up @@ -101,6 +101,8 @@ pub enum PywrError {
ScenarioStateNotFound,
#[error("scenario not found: {0}")]
ScenarioNotFound(String),
#[error("scenario group index not found: {0}")]
ScenarioGroupIndexNotFound(usize),
#[error("clp error")]
ClpError(#[from] solvers::ClpError),
#[error("metric not defined")]
Expand Down
Loading

0 comments on commit 517f2f5

Please sign in to comment.