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 3 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 79.43%. Comparing base (f2794c6) to head (ca9e3cc).
Report is 115 commits behind head on develop.

Current head ca9e3cc differs from pull request most recent head 2afbe2f

Please upload reports for the commit 2afbe2f to get more accurate results.

Files Patch % Lines
pandapower/timeseries/output_writer.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #2209       +/-   ##
============================================
+ Coverage    62.30%   79.43%   +17.13%     
============================================
  Files          255      255               
  Lines        28062    27953      -109     
============================================
+ Hits         17483    22205     +4722     
+ Misses       10579     5748     -4831     

☔ 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