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

FIX: TimeSeries.align() samples the x-axis at the least frequent TimeStream's granularity #14

Open
jonahjlee opened this issue Jan 14, 2025 · 0 comments

Comments

@jonahjlee
Copy link
Contributor

In time_series.py:

@staticmethod
    def align(*args) -> list:
        start_time = np.max([arg.start.timestamp() for arg in args])
        end_time = np.min([arg.stop.timestamp() for arg in args])
        granularity = np.max([arg.granularity for arg in args])
        new_length = end_time - start_time

        new_x_axis = np.linspace(0, new_length, math.ceil(new_length / granularity))

Since granularity has units of seconds, higher granularity means lower frequency data. The intended behaviour was to sample the most frequent TimeStream to preserve all data, and this could be extended to allow for users to pass in a custom new granularity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant