Skip to content

Capture compression and open binary if present.#419

Merged
delucchi-cmu merged 2 commits intomainfrom
issue/407/open_mode
Nov 14, 2024
Merged

Capture compression and open binary if present.#419
delucchi-cmu merged 2 commits intomainfrom
issue/407/open_mode

Conversation

@delucchi-cmu
Copy link
Copy Markdown
Contributor

@delucchi-cmu delucchi-cmu commented Nov 14, 2024

The compression kwarg, when provided, should be used when opening the file, but should NOT be passed along to pandas.read_csv. This captures the value in a named argument so it can be used in the file opening.

Further, if some compression is provided, we change the read mode to "rb", as compression implies that the underlying file is not plain text.

Closes #407
Closes astronomy-commons/hats-import#425

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.02%. Comparing base (17ec4ac) to head (b3c1d38).
Report is 20 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #419      +/-   ##
==========================================
+ Coverage   92.99%   93.02%   +0.03%     
==========================================
  Files          49       47       -2     
  Lines        2127     2123       -4     
==========================================
- Hits         1978     1975       -3     
+ Misses        149      148       -1     

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 14, 2024

Before [e47eab1] After [9c40ded] Ratio Benchmark (Parameter)
12.7±0.2ms 15.0±1ms ~1.18 benchmarks.Suite.time_inner_pixel_alignment
385±2ms 389±5ms 1.01 benchmarks.Suite.time_outer_pixel_alignment
124±0.6ms 125±1ms 1.01 benchmarks.time_test_alignment_even_sky
1.04±0.02ms 1.03±0.02ms 0.99 benchmarks.time_test_cone_filter_multiple_order
46.3±0.6ms 45.3±0.4ms 0.98 benchmarks.Suite.time_pixel_tree_creation
117±0.9ms 111±0.6ms 0.95 benchmarks.Suite.time_paths_creation
97.9±0.5ms 92.1±0.6ms 0.94 benchmarks.MetadataSuite.time_load_partition_info_order7
98.4±0.6ms 92.5±0.5ms 0.94 benchmarks.MetadataSuite.time_load_partition_join_info
23.9±0.4ms 22.1±0.2ms 0.92 benchmarks.MetadataSuite.time_load_partition_info_order6

Click here to view all benchmarks.

@delucchi-cmu delucchi-cmu requested a review from hombit November 14, 2024 14:06
Copy link
Copy Markdown
Contributor

@hombit hombit left a comment

Choose a reason for hiding this comment

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

Thank you! I have few questions

  1. I don't really understand where decompression is happening - could you point on that code?
  2. Could you please add a high-level test for this?

Comment thread src/hats/io/file_io/file_io.py Outdated
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.

Open files with "b" flag Warnings with zipped CSV

2 participants