From 94b482f0bdd24e712a546f7351b74b14f3ac2ad6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Mar 2026 10:26:50 +0000 Subject: [PATCH 1/4] Initial plan From ca8e19b2472aac1aba5367ac1a6d65e4f144339b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Mar 2026 10:35:02 +0000 Subject: [PATCH 2/4] Add filesystem parameter to cf.read as pass-through to cfdm.read Co-authored-by: bnlawrence <1792815+bnlawrence@users.noreply.github.com> --- cf/docstring/docstring.py | 15 +++++++++++++++ cf/read_write/read.py | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/cf/docstring/docstring.py b/cf/docstring/docstring.py index dfd65e28d1..cbb15f46e1 100644 --- a/cf/docstring/docstring.py +++ b/cf/docstring/docstring.py @@ -686,4 +686,19 @@ The subspace is the smallest hyperrectangular subspace that contains all of the selected locations.""", + # read filesystem + "{{read filesystem: optional}}": """filesystem: optional + A pre-authenticated filesystem object (for example an + ``fsspec`` filesystem instance) to use for opening the + dataset. When provided, *datasets* values are treated as + paths understood by *filesystem*, and local string + pre-processing (tilde/variable expansion, globbing and + directory walking) is bypassed. The file is opened by + calling ``filesystem.open(dataset, "rb")``, which returns + a file-like object that is passed to the netCDF backend. + + If `None` (the default) then the existing file-opening + logic is used. + + .. versionadded:: NEXTVERSION""", } diff --git a/cf/read_write/read.py b/cf/read_write/read.py index c920b72b97..1a6e95b0c8 100644 --- a/cf/read_write/read.py +++ b/cf/read_write/read.py @@ -336,6 +336,10 @@ class read(cfdm.read): .. versionadded:: 3.19.0 + {{read filesystem: optional}} + + .. versionadded:: NEXTVERSION + umversion: deprecated at version 3.0.0 Use the *um* parameter instead. @@ -455,6 +459,7 @@ def __new__( fmt=None, file_type=None, group_dimension_search="closest_ancestor", + filesystem=None, ): """Read field or domain constructs from a dataset.""" kwargs = locals() From ddc4840f3a760d87566640ee653c0e71bb2e21dc Mon Sep 17 00:00:00 2001 From: David Hassell Date: Wed, 18 Mar 2026 17:17:01 +0000 Subject: [PATCH 3/4] Remove duplicate docstring --- cf/docstring/docstring.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/cf/docstring/docstring.py b/cf/docstring/docstring.py index cbb15f46e1..dfd65e28d1 100644 --- a/cf/docstring/docstring.py +++ b/cf/docstring/docstring.py @@ -686,19 +686,4 @@ The subspace is the smallest hyperrectangular subspace that contains all of the selected locations.""", - # read filesystem - "{{read filesystem: optional}}": """filesystem: optional - A pre-authenticated filesystem object (for example an - ``fsspec`` filesystem instance) to use for opening the - dataset. When provided, *datasets* values are treated as - paths understood by *filesystem*, and local string - pre-processing (tilde/variable expansion, globbing and - directory walking) is bypassed. The file is opened by - calling ``filesystem.open(dataset, "rb")``, which returns - a file-like object that is passed to the netCDF backend. - - If `None` (the default) then the existing file-opening - logic is used. - - .. versionadded:: NEXTVERSION""", } From 587ca4634d21a996800a93c5191f01ced61511b0 Mon Sep 17 00:00:00 2001 From: David Hassell Date: Wed, 18 Mar 2026 17:18:49 +0000 Subject: [PATCH 4/4] filesystem changelog --- Changelog.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changelog.rst b/Changelog.rst index fcc3fbb2de..674bd687f7 100644 --- a/Changelog.rst +++ b/Changelog.rst @@ -3,6 +3,8 @@ Version NEXTVERSION **2026-??-??** +* New keyword to `cf.read`: ``filesystem`` + (https://github.com/NCAS-CMS/cf-python/issues/931) * New keyword parameter to `cf.Data.compute`: ``persist`` (https://github.com/NCAS-CMS/cf-python/issues/929) * New function to control the persistence of computed data: