[WIP] Added max_block and request_batch to pyfive.File and backend - #256
[WIP] Added max_block and request_batch to pyfive.File and backend#256dwest77a wants to merge 12 commits into
Conversation
|
thanks @dwest77a 🍺 Note that if you wish the PR to be truly draft, you can always convert it to a Draft PR. I approved the tests to run here, and if you don't mind, I'll also add you to PyActiveStorage 🍻 |
|
This relates to issue #257 |
|
@dwest77a the issue with pre-commit kicks in since you change the functional call and args: 131c139,141
< self._read_bulk_fsspec(fh, chunks, out, dtype)
---
> self._read_bulk_fsspec(
> fh, chunks, out, dtype, max_block=max_block, batch_size=batch_size
> )
|
|
@dwest77a I realized we've had quite a few of these |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #256 +/- ##
==========================================
+ Coverage 78.48% 78.52% +0.04%
==========================================
Files 15 15
Lines 3416 3423 +7
Branches 546 547 +1
==========================================
+ Hits 2681 2688 +7
Misses 593 593
Partials 142 142 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@valeriupredoi thanks, I'll look into the test coverage now. |
|
Good man Dan 🍺 |
| original_cat_ranges = fs.cat_ranges | ||
| fs.cat_ranges = cat_ranges_spy | ||
|
|
||
| uri = "https://esgf.ceda.ac.uk/thredds/fileServer/esg_cmip6/CMIP6/AerChemMIP/MOHC/UKESM1-0-LL/ssp370SST-lowNTCF/r1i1p1f2/Amon/cl/gn/latest/cl_Amon_UKESM1-0-LL_ssp370SST-lowNTCF_r1i1p1f2_gn_205001-209912.nc" |
There was a problem hiding this comment.
@valeriupredoi happy to reconfigure this in some way that doesn't use a hardcoded path, it does need to be remote to test the block and batch sizes though.
|
I'd like to get the two other pull requests that affect file handling into main before doing this one ... just in case there is an interaction ... I'll try and get them done in the next couple of days, and then move to this one. |
Description
max_blockandrequest_batchas parameters to the pyfive.File declaration. This is relayed to the backend bulk_fsspec method which now uses the merge_requests utility from fsspec if max_block is defined. Request batch allows configuration via the fsspec cat_ranges method to restrict the number of simultaneous requests down from the default for remote connections of 1280.Checklist