Read file-like object datasets
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 150
- Forks
- 23
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 2
Description
It would be very nice to be able to read datasets defined by an open file handle with cfdm.read.
>>> import fsspec
>>> fs = fsspec.filesystem(...)
>>> fh = fs.open('filename.nc', 'rb')
>>> f = cf.read(fh)
This particular example would be equivalent to:
>>> f = cf.read('filename.nc', filesystem=fs)
E.g. for a local file, this should also work:
>>> fh = open('filename.nc', 'rb')
>>> f = cf.read(fh)
This will be largely implemented via https://github.com/NCAS-CMS/cfdm/issues/401
PR to follow.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the cf.read entry point and read the referenced cfdm issue #401, which is expected to provide most of the implementation. Check how an open local or fsspec file handle is accepted and identify the existing read-related tests before making changes. Done means cf.read accepts both kinds of file-like object as shown without breaking path-based reads.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100