-
Notifications
You must be signed in to change notification settings - Fork 4
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
change: Remove PythonCall dep and extension #51
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #51 +/- ##
=======================================
Coverage 99.04% 99.04%
=======================================
Files 23 22 -1
Lines 3339 3367 +28
=======================================
+ Hits 3307 3335 +28
Misses 32 32
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
mmap_files = String[] | ||
obj_lengths = Int[] | ||
for r_ix in to_mmap | ||
push!(obj_lengths, length(results.resultTypes[r_ix].value)) | ||
tmp_path, io = mktemp() | ||
write(io, results.resultTypes[r_ix].value) | ||
empty!(results.resultTypes[r_ix].value) | ||
close(io) | ||
push!(mmap_files, tmp_path) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my own understanding: you're using the variable name mmap_files
, but actually these are just temp files on disk, is that correct? Or is there something else happening here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmap_files
is the path to each file where the big array is mmap
-ed. These files are in /tmp
and are deleted when the Julia process exits.
Issue #, if available: N/A
Description of changes: Use JSON strings to pass inputs and results back and forth to external callers (inc. Python). Means we no longer need a PythonCall extension. Use
mmap
ed files for large datasets (e.g. state vectors or density matrices) to avoid very expensive inter-process communication.Testing done: Unit tests passed locally and works with coming branch for Python wrapper.
Merge Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.General
Tests
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.