Skip to content
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

Add a function for cubic spline interpolation #3216

Open
wants to merge 35 commits into
base: main
Choose a base branch
from

Conversation

eslickj
Copy link
Contributor

@eslickj eslickj commented Mar 28, 2024

Summary/Motivation:

This adds an external function for cubic spline interpolation. I couldn't find this functionality in Pyomo, but I may have missed something. This is just a draft. I wanted to see if this is worth finishing. I can finish cleaning this up and adding tests or close it. I need functionality similar to this for pump and fan curves.

Changes proposed in this PR:

  • Add an external function cubic spline interpolation function

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@eslickj eslickj marked this pull request as draft March 28, 2024 22:55
@blnicho blnicho changed the title Add a function for cubic spline interpolation [DRAFT] [WIP] Add a function for cubic spline interpolation Apr 3, 2024
@mrmundt
Copy link
Contributor

mrmundt commented Apr 9, 2024

We discussed in the weekly dev call and expressed that this PR sounds interesting / useful. If you have time, @eslickj , please feel free to push forward with it.

@eslickj
Copy link
Contributor Author

eslickj commented Apr 11, 2024

@mrmundt, Thanks! I think it's all there and functioning properly. I'll write tests as I have time.

@eslickj
Copy link
Contributor Author

eslickj commented May 14, 2024

@mrmundt, I added tests.

@eslickj eslickj marked this pull request as ready for review May 15, 2024 09:59
@eslickj eslickj changed the title [WIP] Add a function for cubic spline interpolation Add a function for cubic spline interpolation May 15, 2024
@mrmundt mrmundt marked this pull request as draft May 15, 2024 15:24
@mrmundt mrmundt marked this pull request as ready for review May 15, 2024 15:24
@mrmundt
Copy link
Contributor

mrmundt commented May 21, 2024

@eslickj - The failing test is indicating that you have a missing __init__.py file. Please add that file in and ideally the tests should start passing!

@eslickj
Copy link
Contributor Author

eslickj commented May 22, 2024

@mrmundt, I added the file.

@blnicho blnicho requested a review from jsiirola March 11, 2025 19:44
Copy link
Member

@jsiirola jsiirola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall in good shape. Some minor changes... @eslickj, let us know if you want to make them or if you want one of us to cover it.

@eslickj
Copy link
Contributor Author

eslickj commented Mar 13, 2025

@jsiirola, thanks! I should be able to make the changes.

Copy link
Member

@blnicho blnicho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eslickj I found a few minor things that should be fixed

Copy link

codecov bot commented Mar 17, 2025

Codecov Report

Attention: Patch coverage is 93.77163% with 18 lines in your changes missing coverage. Please review.

Project coverage is 88.67%. Comparing base (2739945) to head (12b84f3).

Files with missing lines Patch % Lines
...omo/contrib/cspline_external/cspline_parameters.py 87.94% 17 Missing ⚠️
pyomo/contrib/cspline_external/build.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3216      +/-   ##
==========================================
+ Coverage   88.65%   88.67%   +0.01%     
==========================================
  Files         882      887       +5     
  Lines      101133   101422     +289     
==========================================
+ Hits        89662    89933     +271     
- Misses      11471    11489      +18     
Flag Coverage Δ
builders 26.61% <21.45%> (-0.01%) ⬇️
default 84.76% <93.77%> (?)
expensive 34.04% <21.45%> (?)
linux 86.12% <93.77%> (-2.28%) ⬇️
linux_other 86.12% <93.77%> (+0.02%) ⬆️
osx 75.98% <51.21%> (-0.08%) ⬇️
win 84.60% <93.77%> (+0.02%) ⬆️
win_other 84.60% <93.77%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants