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

_read_results gives more data than requested when using a larger cache #1074

Closed
GabrielKS opened this issue Mar 5, 2024 · 1 comment · Fixed by #1073
Closed

_read_results gives more data than requested when using a larger cache #1074

GabrielKS opened this issue Mar 5, 2024 · 1 comment · Fixed by #1073
Assignees
Labels

Comments

@GabrielKS
Copy link
Contributor

The symptom is kind of the opposite as in #1072 — we get more timestamps than called for when the cache contains a superset in time of what we need:

julia> timestamps = PSI._process_timestamps(res, DateTime("2035-01-01"), 7);

julia> variable_tuples = [(ActivePowerVariable, ThermalStandard)];

julia> variable_keys = [PSI.VariableKey(ActivePowerVariable, ThermalStandard)];

julia> load_results!(res, 7; variables=variable_tuples)

julia> PSI._read_results(res, variable_keys, timestamps[1:6], nothing) |> values |> first |> x->x.data |> keys |> collect
7-element Vector{DateTime}:
 2035-01-01T00:00:00
 2035-01-02T00:00:00
 2035-01-03T00:00:00
 2035-01-04T00:00:00
 2035-01-05T00:00:00
 2035-01-06T00:00:00
 2035-01-07T00:00:00

julia> # 7 timestamps in the result even though we asked for only 6

This causes problems downstream when we convert to DataFrame, see #1073 (comment).

@GabrielKS GabrielKS self-assigned this Mar 5, 2024
GabrielKS added a commit that referenced this issue Mar 5, 2024
@GabrielKS GabrielKS linked a pull request Mar 5, 2024 that will close this issue
jd-lara added a commit that referenced this issue Mar 5, 2024
@GabrielKS
Copy link
Contributor Author

Fixed in psy4

jd-lara pushed a commit that referenced this issue Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant