Skip to content

Conversation

@luke-kiernan
Copy link
Contributor

Evaluation as a function, for PiecewiseIncrementalCurve and PiecewiseAverageCurve. I also added check_domain(fd::FunctionData, x::Real), as defense against floating point errors.

@codecov
Copy link

codecov bot commented Nov 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.41%. Comparing base (0ee9770) to head (d67d939).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #514      +/-   ##
==========================================
+ Coverage   79.10%   80.41%   +1.30%     
==========================================
  Files          71       71              
  Lines        6192     6141      -51     
==========================================
+ Hits         4898     4938      +40     
+ Misses       1294     1203      -91     
Flag Coverage Δ
unittests 80.41% <100.00%> (+1.30%) ⬆️

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

Files with missing lines Coverage Δ
src/cost_aliases.jl 92.00% <100.00%> (+6.63%) ⬆️
src/function_data.jl 99.57% <100.00%> (+1.30%) ⬆️

... and 29 files with indirect coverage changes

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

Copy link
Member

@GabrielKS GabrielKS left a comment

Choose a reason for hiding this comment

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

The current approach duplicates already-implemented FunctionData and ValueCurve conversion math. @luke-kiernan and I are in the midst of a conversation about what we even want the interface to look like, I'm going to mark this as draft until we resolve that.

@GabrielKS GabrielKS marked this pull request as draft November 21, 2025 18:15
@luke-kiernan
Copy link
Contributor Author

luke-kiernan commented Nov 21, 2025

We've agreed that it makes sense to evaluate an InputOutputCurve at an input x: just evaluate the function data at x. However, it's ambiguous for the Incremental and AverageRate curves, so there, I'll leave evaluation un-implemented. (If you want to evaluate the curve--not the rate--for one of those, just convert it to an InputOutputCurve first.)

Will do in a separate PR.

@GabrielKS
Copy link
Member

Successor: #517

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.

3 participants