changed $trenType to $trendMethod in case TREND_BEST_FIT #4339
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix TREND_BEST_FIT_NO_POLY. This resolves one of the problems in PR #4400. It does not attempt to resolve the other main problem in that issue, the fact that Polynomial Best Fit is mis-coded; it is unclear what needs to be done to fix that.
This change could be consider breaking. I think it is unlikely that any existing code will actually break. Use of Polynomial Best Fit will currently run into errors when it tries to treat a float property as an array, which it does in many places. It will be changed to throw an exception in the constructor until those problems are fixed. One place where BestFit issues
triggerError
will be replaced with an exception. Trend::calculate will now throw an exception if the trend type is unrecognized rather than returningfalse
; this is not a particularly legitimate use case, and it allows us to always returnBestFit
rather thanmixed
. None of the conditions for which we will now throw exceptions were part of the unit test suite; they are now.Some unit tests are added. Draft PR #1907 does not yet add any unit tests, nor does it address the Polynomial problem. It is not clear if it is compatible with this change.