Skip to content

Commit

Permalink
chore: Improve docstrings for RbfProfileParameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
jetuk committed Oct 24, 2023
1 parent b46668d commit 56f67e4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pywr-schema/src/parameters/doc_examples/rbf_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "my-interpolated-profile",
"type": "RbfProfile",
"points": [
[90.0, 0.5],
[180.0, 0.3],
[270.0, 0.7]
[90, 0.5],
[180, 0.3],
[270, 0.7]
],
"function": {"Gaussian": { "epsilon": 3.0 }}
}
16 changes: 16 additions & 0 deletions pywr-schema/src/parameters/doc_examples/rbf_2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "my-interpolated-profile",
"type": "RbfProfile",
"points": [
[90, 0.5],
[180, 0.3],
[270, 0.7]
],
"function": {"Gaussian": { "epsilon": 3.0 }},
"variable": {
"is_active": true,
"days_of_year_range": 30,
"value_upper_bounds": 1.0,
"value_lower_bounds": 0.0
}
}
2 changes: 1 addition & 1 deletion pywr-schema/src/parameters/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub use super::parameters::indexed_array::IndexedArrayParameter;
pub use super::parameters::polynomial::Polynomial1DParameter;
pub use super::parameters::profiles::{
DailyProfileParameter, MonthlyProfileParameter, RadialBasisFunction, RbfProfileParameter,
UniformDrawdownProfileParameter,
RbfProfileVariableSettings, UniformDrawdownProfileParameter,
};
pub use super::parameters::python::PythonParameter;
pub use super::parameters::tables::TablesArrayParameter;
Expand Down
9 changes: 9 additions & 0 deletions pywr-schema/src/parameters/profiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,15 @@ impl Into<pywr_core::parameters::RbfProfileVariableConfig> for RbfProfileVariabl
/// ```json
#[doc = include_str!("doc_examples/rbf_1.json")]
/// ```
///
/// The example below shows the definition of a [`RbfProfileParameter`] in JSON with variable
/// settings defined. This settings determine how the interpolation points be modified by
/// external algorithms. See [`RbfProfileVariableSettings`] for more information.
///
/// ```json
#[doc = include_str!("doc_examples/rbf_2.json")]
/// ```
///
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone)]
pub struct RbfProfileParameter {
#[serde(flatten)]
Expand Down

0 comments on commit 56f67e4

Please sign in to comment.