Skip to content

Commit c5d1490

Browse files
committed
reword a few comments
1 parent 068b660 commit c5d1490

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

xarray/tutorial.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ def open_rasterio(
6060

6161
if cache:
6262
path = cache_dir / name
63-
# need to always do that, otherwise the context manager might fail
63+
# need to always do that, otherwise we might close the
64+
# path using the context manager
6465
cache_dir = pathlib.Path(cache_dir)
6566
else:
6667
cache_dir = tempfile.TemporaryDirectory()
@@ -75,7 +76,8 @@ def open_rasterio(
7576
return _open_rasterio(path, **kws)
7677

7778
url = f"{github_url}/raw/{branch}/tests/data/{path.name}"
78-
# make sure the directory is deleted afterwards
79+
# if cache_dir points to a temporary directory, make sure it is
80+
# deleted afterwards
7981
with cache_dir:
8082
download_to(url, path)
8183
return _open_rasterio(path, **kws)
@@ -128,7 +130,8 @@ def construct_url(full_name):
128130

129131
if cache:
130132
path = cache_dir / name
131-
# need to always do that, otherwise the context manager might fail
133+
# need to always do that, otherwise we might close the
134+
# path using the context manager
132135
cache_dir = pathlib.Path(cache_dir)
133136
else:
134137
cache_dir = tempfile.TemporaryDirectory()
@@ -140,7 +143,8 @@ def construct_url(full_name):
140143
if cache and path.is_file():
141144
return _open_dataset(path, **kws)
142145

143-
# make sure the directory is deleted afterwards if it was temporary
146+
# if cache_dir points to a temporary directory, make sure it is
147+
# deleted afterwards
144148
with cache_dir:
145149
download_to(construct_url(path.name), path)
146150

0 commit comments

Comments
 (0)