Skip to content

Implement forecast function#1324

Merged
tonyqus merged 5 commits into
nissl-lab:masterfrom
swyfft-insurance:feature/ks/20240425_ImplementForecastFunction
May 12, 2024
Merged

Implement forecast function#1324
tonyqus merged 5 commits into
nissl-lab:masterfrom
swyfft-insurance:feature/ks/20240425_ImplementForecastFunction

Conversation

@ken-swyfft
Copy link
Copy Markdown
Contributor

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 the Forecast class, a modification to the ProduceFunctions method in the FunctionEval class to use this new Forecast class, and the addition of unit tests to verify the functionality of the Forecast class.

Here are the top five most important changes:

Codebase expansion:

  • main/SS/Formula/Functions/Forecast.cs: Added the Forecast 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 converting ValueEval objects to numeric arrays and for creating ValueVectors.

Codebase modification:

Codebase configuration:

Testing:

  • testcases/main/SS/Formula/Functions/TestForecast.cs: Added a new test class TestForecast for the Forecast 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.

Comment thread build/_build.csproj.DotSettings
Comment thread main/SS/Formula/Eval/FunctionEval.cs
@tonyqus
Copy link
Copy Markdown
Member

tonyqus commented May 2, 2024

@tonyqus tonyqus added this to the NPOI 2.7.1 milestone May 2, 2024
@ken-swyfft
Copy link
Copy Markdown
Contributor Author

I see that the ubuntu flavor of the tests are failing - but from what I can tell, that's happening on other PR's as well, so I'm assuming it's not something I broke in this PR?

@tonyqus
Copy link
Copy Markdown
Member

tonyqus commented May 3, 2024

I see that the ubuntu flavor of the tests are failing - but from what I can tell, that's happening on other PR's as well, so I'm assuming it's not something I broke in this PR?

Ubuntu test usually fails. No worries. It's not caused by your code.

@ken-swyfft ken-swyfft changed the title Feature/ks/20240425 implement forecast function Implement forecast function May 3, 2024
@tonyqus
Copy link
Copy Markdown
Member

tonyqus commented May 12, 2024

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants