Skip to content

Commit 870a67a

Browse files
authored
fix double colons and long line
1 parent 5073fe6 commit 870a67a

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

src/mdio/api/io_utils.py

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ def process_url(
2020
"""Check read/write access to FSStore target and return FSStore with double caching.
2121
2222
It can use an in-memory Least Recently Used (LRU) cache implementation from
23-
Zarr, and optionally, a file cache (`simplecache` protocol from FSSpec) that is useful
24-
for remote stores.
23+
Zarr, and optionally, a file cache (`simplecache` protocol from FSSpec) that
24+
is useful for remote stores.
2525
2626
File cache is only valid for remote stores. The LRU caching works
2727
on both remote and local.
@@ -44,42 +44,44 @@ def process_url(
4444
Examples:
4545
If we want to access an MDIO file from S3 without using disk caching,
4646
the simplecache protocol is not used, and therefore we only need to
47-
specify the s3 filesystem options::
47+
specify the s3 filesystem options:
4848
49+
>>> from mdio.api.convenience import process_url
50+
>>>
51+
>>>
4952
>>> process_url(
50-
... url="s3://bucket/key",
51-
... mode="r",
52-
... storage_options={"key": "my_key", "secret": "my_secret"},
53-
... memory_cache_size=0,
54-
... disk_cache=False,
53+
... url="s3://bucket/key",
54+
... mode="r",
55+
... storage_options={"key": "my_key", "secret": "my_secret"},
56+
... memory_cache_size=0,
57+
... disk_cache=False,
5558
... )
5659
5760
On the other hand, if we want to use disk caching, we need to
5861
explicitly state that the options we are passing are for the S3
59-
filesystem::
62+
filesystem:
6063
6164
>>> process_url(
62-
... url="s3://bucket/key",
63-
... mode="r",
64-
... storage_options={"s3": {"key": "my_key", "secret": "my_secret"}},
65-
... memory_cache_size=0,
66-
... disk_cache=True,
65+
... url="s3://bucket/key",
66+
... mode="r",
67+
... storage_options={"s3": {"key": "my_key", "secret": "my_secret"}},
68+
... memory_cache_size=0,
69+
... disk_cache=True,
6770
... )
6871
69-
This allows us to pass options to the simplecache filesystem as well::
72+
This allows us to pass options to the simplecache filesystem as well:
7073
7174
>>> process_url(
72-
... url="s3://bucket/key",
73-
... mode="r",
74-
... storage_options={
75-
... "s3": {"key": "my_key", "secret": "my_secret"},
76-
... "simplecache": {"cache_storage": "custom/local/cache/path"}
77-
... },
78-
... memory_cache_size=0,
79-
... disk_cache=True,
75+
... url="s3://bucket/key",
76+
... mode="r",
77+
... storage_options={
78+
... "s3": {"key": "my_key", "secret": "my_secret"},
79+
... "simplecache": {"cache_storage": "custom/local/cache/path"},
80+
... },
81+
... memory_cache_size=0,
82+
... disk_cache=True,
8083
... )
8184
"""
82-
# Append simplecache (disk caching) protocol to the URL.
8385
if disk_cache is True:
8486
url = "::".join(["simplecache", url])
8587

0 commit comments

Comments
 (0)