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

Store time series data more efficiently #11

Open
daniel-thom opened this issue Apr 12, 2024 · 0 comments
Open

Store time series data more efficiently #11

daniel-thom opened this issue Apr 12, 2024 · 0 comments

Comments

@daniel-thom
Copy link
Collaborator

Problems with the current design of time series:

  1. Does not allow one component to share time series data across two fields (e.g., active power and reactive power).
  2. Does not allow one component to share time series data with different initial times.
  3. The user can accidentally store the same time array data multiple times.

Dan and Pedro brainstormed a solution.

Create this new class:

class ProfileData(BaseModel):
    data: pa.Array | BaseQuantity
    hash_str: str

SingleTimeSeries would store it instead of the same data type above. The profile data would get serialized with its hash instead of the currently-used UUID. Duplicate data would never be stored.

The user does not have to know about the ProfileData class. It can get created automatically in System.add_time_series. The user interfaces stay the same. There is one new user pattern to share time series:

# ts1 is a SingleTimeSeries that is already stored in the system.
ts2 = SingleTimeSeries.from_existing(ts1, variable_name=X, initial_time=Y, resolution=Z)
@pesap pesap removed the [] label Apr 15, 2024
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

2 participants