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

Implement forecast function #1324

Conversation

ken-swyfft
Copy link
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.

@tonyqus tonyqus added this to the NPOI 2.7.1 milestone May 2, 2024
@ken-swyfft
Copy link
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
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
Member

tonyqus commented May 12, 2024

LGTM

@tonyqus tonyqus merged commit 27fe304 into nissl-lab:master May 12, 2024
2 of 3 checks passed
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