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

[feature] timeseries: Enable saving of compressed CSV files #2209

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

jokabrink
Copy link

When setting up the OutputWriter() object, passing output_file_type=".csv.zip" should not result in a warning or error, but instead tell Pandas to save the data using the inferred compression format. This is possible because the documentation in https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_csv.html allows for inferred compression types from file name.

@rbolgaryn
Copy link
Member

Thank you @jokabrink this is a nice feature!

Please add a minimal test for this feature in pandapower/test/timeseries/test_output_writer.py and mention the change in the CHANGELOG file.

Copy link
Member

@rbolgaryn rbolgaryn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see my comment

Copy link

codecov bot commented Mar 26, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 76.00%. Comparing base (75b80f4) to head (42118ec).

Files with missing lines Patch % Lines
pandapower/timeseries/output_writer.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2209      +/-   ##
===========================================
- Coverage    76.00%   76.00%   -0.01%     
===========================================
  Files          282      282              
  Lines        32950    32952       +2     
===========================================
  Hits         25045    25045              
- Misses        7905     7907       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Check if "csv" is between two dots instead of full match to enable
compression by Pandas.
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.

3 participants