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

Port read and write functions #70

Merged
merged 4 commits into from
Jun 14, 2024
Merged

Port read and write functions #70

merged 4 commits into from
Jun 14, 2024

Conversation

mtsokol
Copy link
Collaborator

@mtsokol mtsokol commented Jun 13, 2024

Hi @willow-ahrens @hameerabbasi,

Here's a minimal PR to port fread and fwrite to finch-tensor.

@mtsokol mtsokol added the enhancement New feature or request label Jun 13, 2024
@mtsokol mtsokol self-assigned this Jun 13, 2024
tests/test_io.py Outdated Show resolved Hide resolved
src/finch/io.py Outdated Show resolved Hide resolved
src/finch/io.py Outdated Show resolved Hide resolved
@@ -30,3 +30,4 @@

jl.seval("using Finch")
jl.seval("using Random")
jl.seval("using TensorMarket")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this limit us to just this format?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, it's just a dependency. Here's a list of all supported formats: https://willowahrens.io/Finch.jl/stable/guides/fileio/#Finch.fread

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to pull in any other dependencies for other formats?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@willow-ahrens Are there other IO related dependencies that we should install during the setup to fully support fread and fwrite?

In Finch.jl in Project.toml I found three more:

[weakdeps]
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
NPZ = "15e1cf62-19b3-5cfa-8e77-841668bca605"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
TensorMarket = "8b7d4fe7-0b45-4d0d-9dd8-5cc9b23b4b77"

Copy link
Collaborator

Choose a reason for hiding this comment

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

HDF5, NPZ, and TensorMarket are required for binsparse and ttx files.

Copy link
Collaborator

Choose a reason for hiding this comment

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

These should be added with pkg.add when we add Finch, or loaded dynamically depending on whether we want to take a dependency on hdf5

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! I load them dynamically.

src/finch/julia.py Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jun 13, 2024

Codecov Report

Attention: Patch coverage is 77.41935% with 7 lines in your changes missing coverage. Please review.

Project coverage is 89.73%. Comparing base (12c94c2) to head (8813fd0).
Report is 26 commits behind head on main.

Files Patch % Lines
src/finch/io.py 70.83% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #70      +/-   ##
==========================================
- Coverage   91.25%   89.73%   -1.52%     
==========================================
  Files           8        9       +1     
  Lines         720      828     +108     
==========================================
+ Hits          657      743      +86     
- Misses         63       85      +22     

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

@mtsokol
Copy link
Collaborator Author

mtsokol commented Jun 14, 2024

@hameerabbasi it's ready for another review. All IO dependencies are loaded dynamically (once) when a specific file extension is present.

@mtsokol mtsokol merged commit 9838853 into main Jun 14, 2024
5 checks passed
@mtsokol mtsokol deleted the io-functions branch June 14, 2024 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants