-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Implement forecast function #1324
Implement forecast function #1324
Conversation
I see that the |
Ubuntu test usually fails. No worries. It's not caused by your code. |
LGTM |
This is my first PR for NPOI, and I'm still very much a newbie when it comes to the codebase. But this was a function that we needed, and it seemed like this was the easiest way to get it done.
Please let me know if there's anything I could/should be doing differently or better, or if there's anything I missed.
Copilot Description
This pull request introduces changes to the codebase to implement the Excel FORECAST function in the
NPOI.SS.Formula.Functions
namespace. The most significant changes include the addition of theForecast
class, a modification to theProduceFunctions
method in theFunctionEval
class to use this newForecast
class, and the addition of unit tests to verify the functionality of theForecast
class.Here are the top five most important changes:
Codebase expansion:
main/SS/Formula/Functions/Forecast.cs
: Added theForecast
class which represents the Excel FORECAST function. This function predicts a future value along a linear trend line based on existing historical data. The class includes methods for convertingValueEval
objects to numeric arrays and for creatingValueVectors
.Codebase modification:
main/SS/Formula/Eval/FunctionEval.cs
: Modified theProduceFunctions
method to use the newForecast
class instead of theNotImplementedFunction
for the FORECAST function.Codebase configuration:
build/_build.csproj.DotSettings
: Added user rules for C# naming conventions and updated the settings migration to reflect these changes. [1] [2]Testing:
testcases/main/SS/Formula/Functions/TestForecast.cs
: Added a new test classTestForecast
for theForecast
function. This class includes tests for basic functionality, handling of large numbers and arrays, error propagation, and a test replicating an example from the Microsoft support website.