nissl-lab / npoi

a .NET library that can read/write Office formats without Microsoft Office installed. No COM+, no interop.
Apache License 2.0
5.67k stars 1.42k forks source link

Implement forecast function #1324

Closed ken-swyfft closed 4 months ago

ken-swyfft commented 4 months ago

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:

Codebase modification:

Codebase configuration:

Testing:

tonyqus commented 4 months ago

Reference: https://github.com/apache/poi/blob/trunk/poi/src/main/java/org/apache/poi/ss/formula/functions/Forecast.java https://github.com/apache/poi/blob/trunk/poi/src/test/java/org/apache/poi/ss/formula/functions/TestForecast.java

ken-swyfft commented 4 months ago

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 commented 4 months ago

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.

tonyqus commented 4 months ago

LGTM