Skip to content

Commit

Permalink
chore: Fix schema only builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
jetuk committed Jul 23, 2024
1 parent 97e048d commit 409da2f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
9 changes: 5 additions & 4 deletions pywr-schema/src/nodes/loss_link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ use crate::metric::Metric;
use crate::model::LoadArgs;
use crate::nodes::{NodeAttribute, NodeMeta};
use crate::parameters::TryIntoV2Parameter;
use pywr_core::aggregated_node::Factors;
#[cfg(feature = "core")]
use pywr_core::metric::MetricF64;
use pywr_core::{aggregated_node::Factors, metric::MetricF64};
use pywr_schema_macros::PywrVisitAll;
use pywr_v1_schema::nodes::LossLinkNode as LossLinkNodeV1;
use schemars::JsonSchema;
Expand All @@ -25,6 +24,7 @@ pub enum LossFactor {
Net { factor: Metric },
}

#[cfg(feature = "core")]
impl LossFactor {
pub fn load(
&self,
Expand Down Expand Up @@ -254,14 +254,15 @@ impl TryFrom<LossLinkNodeV1> for LossLinkNode {
mod tests {
use crate::model::PywrModel;
#[cfg(feature = "core")]
use pywr_core::test_utils::run_all_solvers;
use pywr_core::test_utils::ExpectedOutputs;
use pywr_core::test_utils::{run_all_solvers, ExpectedOutputs};
#[cfg(feature = "core")]
use tempfile::TempDir;

fn loss_link1_str() -> &'static str {
include_str!("../test_models/loss_link1.json")
}

#[cfg(feature = "core")]
fn loss_link1_outputs_str() -> &'static str {
include_str!("../test_models/loss_link1-expected.csv")
}
Expand Down
5 changes: 3 additions & 2 deletions pywr-schema/src/nodes/water_treatment_works.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,15 @@ impl WaterTreatmentWorks {
mod tests {
use crate::model::PywrModel;
#[cfg(feature = "core")]
use pywr_core::test_utils::run_all_solvers;
use pywr_core::test_utils::ExpectedOutputs;
use pywr_core::test_utils::{run_all_solvers, ExpectedOutputs};
#[cfg(feature = "core")]
use tempfile::TempDir;

fn wtw1_str() -> &'static str {
include_str!("../test_models/wtw1.json")
}

#[cfg(feature = "core")]
fn wtw1_outputs_str() -> &'static str {
include_str!("../test_models/wtw1-expected.csv")
}
Expand Down
1 change: 1 addition & 0 deletions pywr-schema/src/outputs/csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::error::SchemaError;
use pywr_core::recorders::{CsvLongFmtOutput, CsvWideFmtOutput, Recorder};
use pywr_schema_macros::PywrVisitPaths;
use schemars::JsonSchema;
#[cfg(feature = "core")]
use std::num::NonZeroU32;
#[cfg(feature = "core")]
use std::path::Path;
Expand Down

0 comments on commit 409da2f

Please sign in to comment.