-
Notifications
You must be signed in to change notification settings - Fork 3
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
Make StlResults
fields public
#6
Conversation
It's currently hard to store the results of the STL without using `to_vec()` on the various slices returned by the seasonal/trend/remainder/weights accessor methods, which unfortunately requires cloning all the data. By making the fields public the caller can decide what to do with them. An alternative could be to add some sort of `into_parts()` method which returns all four as a tuple or something, but this just seemed easier!
Hi @sd2k, thanks for another PR! The methods will return slices in 0.3.0, which won't require cloning, so this shouldn't be needed. |
@ankane that does sound like a good step but my issue is that I want to take ownership of one or two of the individual components, moving them out of |
Here's a more concrete example of where I'm doing that in my fork: I'm implementing MSTL which iterates a few times and calculates the most recent seasonal component for a few seasonal lengths. Without ownership of the |
Thanks for the additional context. Cloning the data should be fine for this, as it'll be extremely fast compared to running STL. |
Hi @sd2k, thinking about this more, I think an I also read the MSTL paper and am planning to include it in 0.3.0. |
Thanks for the suggestion, and sorry for the initial hesitation. |
@ankane Nice, that's great to hear! No worries re. hesitation, it's much harder to remove something once it's been added so I understand you wanted to consider it 🙂 |
Added initial support for MSTL in 33ed566 |
Added more parameters in follow-up commits. Let me know if you have any feedback and will cut a new release. |
Oh nice! I wasn't expecting MSTL to be added to this crate, was happy implementing it myself, but it's good to see a second implementation. I'll try to adapt |
I filed #7 to add a few more derived traits but other than that everything works nicely! grafana/augurs#37 incorporates your MSTL support into |
It's currently hard to store the results of the STL decomposition without using
to_vec()
on the various slices returned by the seasonal/trend/remainder/weights accessor methods, which unfortunately requires cloning all the data. By making the fields public the caller can decide what to do with them.An alternative could be to add some sort of
into_parts()
method which returns all four as a tuple or something, but this just seemed easier!