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

PasConnector returns Series and maintains series dtype #124

Merged
merged 4 commits into from
Jun 26, 2024

Conversation

dbrakenhoff
Copy link
Member

When loading a time series from disk using PasConnector as database, the dtype would sometimes be returned as int instead of float (which is what was stored initially). This has been fixed wit this PR.

Additionally, PasConnector does not support maintaining type for Series or DataFrames. You can store both, but now the loading behavior has changed. Before PasConnector would always return a pandas.DataFrame with a single column. Now it will only return a pandas.Series. This makes more sense as that is also what Pastas prefers.

Fixes #119

- PasConnector now always defaults to reading pandas series (instead of 1-column DataFrames)
- set dtype=False in read_json
- add squeeze argument to _series_from_json
- squeeze time series when parsing model dict
@dbrakenhoff dbrakenhoff merged commit 0f5d21f into dev Jun 26, 2024
18 of 19 checks passed
@dbrakenhoff dbrakenhoff deleted the pr119_fix_dtype_pasconnector branch June 26, 2024 09:52
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

Successfully merging this pull request may close these issues.

1 participant