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

Draft: Accepting already open and limited IO types #535

Merged
merged 11 commits into from
Oct 6, 2024
Merged

Conversation

JonasIsensee
Copy link
Collaborator

@JonasIsensee JonasIsensee commented Jan 16, 2024

This adds a method jldopen(::IO, mode; kwargs...)
that should take in already opened IOs and figure out what to do with them.

Currently, this PR implements a ReadOnlyBuffer that can wrap another IO object which only supports reading but not seeking. Therefore it reads linearly and buffers everything in between.

  • figure out what to implement for reading
  • figure out what to implement for writing
  • How to handle a capable external stream (light-weight wrapper)
  • How to figure out what an IO object can do (how to wrap it or error)
  • Do something creative with the filename field in JLDFile

Referencing
#346
#233
#304

Copy link

codecov bot commented Jan 16, 2024

Codecov Report

Attention: Patch coverage is 94.45585% with 27 lines in your changes missing coverage. Please review.

Project coverage is 85.45%. Comparing base (bc774d3) to head (1557580).
Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
src/io/bufferedio.jl 78.78% 14 Missing ⚠️
src/io/dataio.jl 97.45% 4 Missing ⚠️
src/JLD2.jl 95.38% 3 Missing ⚠️
src/headermessages.jl 60.00% 2 Missing ⚠️
src/io/io_wrappers.jl 97.75% 2 Missing ⚠️
src/data/specialcased_types.jl 50.00% 1 Missing ⚠️
src/types.jl 96.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #535      +/-   ##
==========================================
+ Coverage   85.21%   85.45%   +0.23%     
==========================================
  Files          36       37       +1     
  Lines        4391     4406      +15     
==========================================
+ Hits         3742     3765      +23     
+ Misses        649      641       -8     

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

@JonasIsensee JonasIsensee merged commit 16c3448 into master Oct 6, 2024
12 checks passed
@stevengj stevengj deleted the betterio branch October 6, 2024 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant