-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Rolling window with select function not behaving correctly #140
Comments
Based on the testing, particularly the first window got called twice |
Tried to use map function on Series directly it turned out the same, the function got called more than it should. So it should be the bug in the iterator. |
OKay, figured out why this happened. After going through the source code, find out whenever the series is baked, the internal iterators are called and trigger the selector function. During this process, the selector function can be call numerous times from getColumnNames(), toArray(), and toPairs(). |
I believe this is due to Data-Forge's laziness and you need to write the transformer function so that it can execute without side effects. I do realise this is a problem and I'm considering removing the the laziness in Data-Forge v2. I've labelled this issue and will return to it for v2. |
When using rollingwindow with the select function, the rolling windows are correct but select function calls the transformer more than it should.
Please see the following test code:
The following are the outputs:
I think only 4 times should be the correct number.
The text was updated successfully, but these errors were encountered: