Skip to content

Commit ee862fe

Browse files
Fix: Docs generation create temporary files that are not cleaned up. (#10238)
1 parent e39f59e commit ee862fe

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

doc/internals/time-coding.rst

+17
Original file line numberDiff line numberDiff line change
@@ -535,3 +535,20 @@ To opt-out of timedelta decoding (see issue `Undesired decoding to timedelta64 <
535535
.. note::
536536
Note that in the future the default value of ``decode_timedelta`` will be
537537
``False`` rather than ``None``.
538+
539+
540+
541+
.. ipython:: python
542+
:suppress:
543+
544+
# Cleanup
545+
import os
546+
547+
for f in [
548+
"test-datetimes1.nc",
549+
"test-datetimes2.nc",
550+
"test-timedeltas1.nc",
551+
"test-timedeltas2.nc",
552+
]:
553+
if os.path.exists(f):
554+
os.remove(f)

doc/user-guide/io.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -1363,7 +1363,10 @@ To export just the dataset schema without the data itself, use the
13631363
# However, `ds` (rather than the unpickled dataset) refers to the open file. Delete
13641364
# `ds` to close the file.
13651365
del ds
1366-
os.remove("saved_on_disk.nc")
1366+
1367+
for f in ["saved_on_disk.nc", "saved_on_disk.h5"]:
1368+
if os.path.exists(f):
1369+
os.remove(f)
13671370
13681371
This can be useful for generating indices of dataset contents to expose to
13691372
search indices or other automated data discovery tools.

0 commit comments

Comments
 (0)