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

Support reading streaming from online .mtx or .mtx.gz files #54

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

yuehhua
Copy link
Contributor

@yuehhua yuehhua commented Feb 13, 2023

Resolved #42

@codecov-commenter
Copy link

codecov-commenter commented Feb 13, 2023

Codecov Report

Merging #54 (b205208) into master (bf9cc4f) will increase coverage by 3.99%.
The diff coverage is 95.86%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master      #54      +/-   ##
==========================================
+ Coverage   92.20%   96.20%   +3.99%     
==========================================
  Files           4        5       +1     
  Lines         154      237      +83     
==========================================
+ Hits          142      228      +86     
+ Misses         12        9       -3     
Impacted Files Coverage Δ
src/MatrixMarket.jl 100.00% <ø> (ø)
src/format.jl 91.52% <91.52%> (ø)
src/mmread.jl 100.00% <100.00%> (+6.41%) ⬆️
src/mmwrite.jl 100.00% <100.00%> (+2.27%) ⬆️
src/mminfo.jl 87.50% <0.00%> (+6.85%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@yuehhua yuehhua marked this pull request as ready for review February 14, 2023 07:21
@yuehhua yuehhua changed the title Support streaming from online .mtx or .mtx.gz files Support reading streaming from online .mtx or .mtx.gz files Feb 15, 2023
@tkonolige
Copy link
Collaborator

Could you explain what you are trying to do with this PR. I'm not sure how I understand how it is related to reading from streams. It seems like having mmread(stream :: IO) already solves that problem.

@yuehhua
Copy link
Contributor Author

yuehhua commented Feb 17, 2023

Sorry for not explain this clearly. To support streaming, we not only have to support the interface like mmread(stream :: IO) , but also the core behavior of streaming, which is data is not transmitted by chunk, instead, data is transmitted by bytes. We couldn't expect we could fetch whole trunk of data, since data stream could be paused by internet. Thus, we should be able to support more fine-grained unit than a .mtx file we expected before. A single line in a .mtx file is supported in this PR in case that internet is gone and we could still get partial data in MMReader. The same reason to MMwriter. To save data for different format, CoordinateFormat and ArrayFormat are supported for sparse matrices and dense matrices, respectively. These two formats save single line of data into the format and could be fetched after internet is paused. They also support Iterable to iterate over data.

@tkonolige
Copy link
Collaborator

Doesn't the IO interface support streaming? The use case here seems to be resuming downloads but that seems like a really niche use case. Do you have an example of how this is used (like with a library that resumes downloads)? Overall I think added complexity to the code is not worth it.

@yuehhua
Copy link
Contributor Author

yuehhua commented Feb 25, 2023

Would I put the example to README? Or other place?

I think the code complexity would stop at this PR. It is sufficient complex.

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.

allow read and write from a stream for better compression support
3 participants