-
Notifications
You must be signed in to change notification settings - Fork 20
1451 interpolate_simulation_result does not yield consistent timepoints #1482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
reneSchm
merged 5 commits into
main
from
1451-interpolate_simulation_result-does-not-yield-consistent-timepoints
Jan 27, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4ee4d84
update tolerances, removing magic numbers
reneSchm 949af55
make conditionals on adding days easier to read
reneSchm c0d7d3b
update interpolation bindings, using a central method
reneSchm a46386e
fix new file attribution
reneSchm e34590e
fix documentation according to review.
reneSchm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
pycode/memilio-simulation/memilio/simulation/bindings/data/analyze_result.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| /* | ||
| * Copyright (C) 2020-2026 MEmilio | ||
| * | ||
| * Authors: Rene Schmieding | ||
| * | ||
| * Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de> | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| #ifndef PYMIO_DATA_ANALYZE_RESULT_H | ||
| #define PYMIO_DATA_ANALYZE_RESULT_H | ||
|
|
||
| #include "memilio/data/analyze_result.h" | ||
| #include "pybind_util.h" | ||
|
|
||
| #include "pybind11/pybind11.h" | ||
|
|
||
| namespace py = pybind11; | ||
|
|
||
| namespace pymio | ||
| { | ||
|
|
||
| /** | ||
| * @brief Bind functions interpolate_simulation_result and interpolate_ensemble_results. | ||
| */ | ||
| void bind_interpolate_result_methods(py::module_& m) | ||
| { | ||
| m.def( | ||
reneSchm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "interpolate_simulation_result", | ||
| [](const mio::TimeSeries<double>& ts) { | ||
| return mio::interpolate_simulation_result(ts); | ||
| }, | ||
| "Interpolate a given time series with evenly spaced, integer time points that represent whole days.", | ||
| py::arg("ts")); | ||
| m.def("interpolate_simulation_result", | ||
| static_cast<mio::TimeSeries<double> (*)(const mio::TimeSeries<double>&, const double)>( | ||
| &mio::interpolate_simulation_result), | ||
| "Interpolate a given time series with evenly spaced, integer time points that represent whole days.", | ||
| py::arg("ts"), py::arg("abs_tol")); | ||
|
|
||
| m.def("interpolate_simulation_result", | ||
| static_cast<mio::TimeSeries<double> (*)(const mio::TimeSeries<double>&, const std::vector<double>&)>( | ||
| &mio::interpolate_simulation_result), | ||
| "Interpolate a time series at the given time points.", py::arg("ts"), py::arg("interpolation_times")); | ||
|
|
||
| m.def("interpolate_ensemble_results", &mio::interpolate_ensemble_results<mio::TimeSeries<double>>, | ||
| "Interpolates results of all runs with evenly spaced, integer time points that represent whole days."); | ||
| } | ||
|
|
||
| } // namespace pymio | ||
|
|
||
| #endif // PYMIO_DATA_ANALYZE_RESULT_H | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.