Skip to content

Commit

Permalink
fix: Make some schema fields public.
Browse files Browse the repository at this point in the history
  • Loading branch information
jetuk committed Mar 26, 2024
1 parent 7a0a969 commit 8201b1a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
14 changes: 7 additions & 7 deletions pywr-schema/src/data_tables/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ pub enum CsvDataTableLookup {
/// An external table of data that can be referenced
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone)]
pub struct CsvDataTable {
name: String,
pub name: String,
#[serde(rename = "type")]
ty: DataTableType,
lookup: CsvDataTableLookup,
url: PathBuf,
pub ty: DataTableType,
pub lookup: CsvDataTableLookup,
pub url: PathBuf,
}

impl CsvDataTable {
Expand Down Expand Up @@ -226,9 +226,9 @@ impl LoadedTableCollection {

#[derive(serde::Deserialize, serde::Serialize, Debug, Clone)]
pub struct TableDataRef {
table: String,
column: Option<TableIndex>,
index: Option<TableIndex>,
pub table: String,
pub column: Option<TableIndex>,
pub index: Option<TableIndex>,
}

impl TableDataRef {
Expand Down
12 changes: 6 additions & 6 deletions pywr-schema/src/metric_sets/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ impl From<MetricAggFrequency> for pywr_core::recorders::AggregationFrequency {
#[derive(Deserialize, Serialize, Clone)]
pub struct MetricAggregator {
/// Optional aggregation frequency.
freq: Option<MetricAggFrequency>,
pub freq: Option<MetricAggFrequency>,
/// Aggregation function to apply over metric values.
func: MetricAggFunc,
pub func: MetricAggFunc,
/// Optional child aggregator.
child: Option<Box<MetricAggregator>>,
pub child: Option<Box<MetricAggregator>>,
}

impl From<MetricAggregator> for pywr_core::recorders::Aggregator {
Expand All @@ -133,9 +133,9 @@ impl From<MetricAggregator> for pywr_core::recorders::Aggregator {
/// in multiple values (i.e. per each period implied by the frequency).
#[derive(Deserialize, Serialize, Clone)]
pub struct MetricSet {
name: String,
metrics: Vec<OutputMetric>,
aggregator: Option<MetricAggregator>,
pub name: String,
pub metrics: Vec<OutputMetric>,
pub aggregator: Option<MetricAggregator>,
}

impl MetricSet {
Expand Down
6 changes: 3 additions & 3 deletions pywr-schema/src/outputs/hdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use std::path::{Path, PathBuf};

#[derive(serde::Deserialize, serde::Serialize, Debug, Clone)]
pub struct Hdf5Output {
name: String,
filename: PathBuf,
pub name: String,
pub filename: PathBuf,
/// The metric set to save
metric_set: String,
pub metric_set: String,
}

impl Hdf5Output {
Expand Down
12 changes: 6 additions & 6 deletions pywr-schema/src/outputs/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use pywr_core::recorders::MemoryRecorder;

#[derive(serde::Deserialize, serde::Serialize, Debug, Clone)]
pub struct MemoryAggregation {
time: Option<MetricAggFunc>,
scenario: Option<MetricAggFunc>,
metric: Option<MetricAggFunc>,
pub time: Option<MetricAggFunc>,
pub scenario: Option<MetricAggFunc>,
pub metric: Option<MetricAggFunc>,
}

impl From<MemoryAggregation> for pywr_core::recorders::Aggregation {
Expand All @@ -21,9 +21,9 @@ impl From<MemoryAggregation> for pywr_core::recorders::Aggregation {

#[derive(serde::Deserialize, serde::Serialize, Debug, Clone)]
pub struct MemoryOutput {
name: String,
metric_set: String,
aggregation: MemoryAggregation,
pub name: String,
pub metric_set: String,
pub aggregation: MemoryAggregation,
}

impl MemoryOutput {
Expand Down

0 comments on commit 8201b1a

Please sign in to comment.