aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2024-07-13 18:47:31 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2024-07-13 18:47:31 -0400
commit34f2829170a81c477e2416ceeeb32691722888d8 (patch)
tree7ce9f280a7466971dd80e72269b5bd4c9a9e9d2e
parent564efc6d76e2f61f8a0421182701161321339582 (diff)
downloadqolab-34f2829170a81c477e2416ceeeb32691722888d8.tar.gz
qolab-34f2829170a81c477e2416ceeeb32691722888d8.zip
improved doc string
-rw-r--r--qolab/file_utils/__init__.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/qolab/file_utils/__init__.py b/qolab/file_utils/__init__.py
index 8d403e8..289ffec 100644
--- a/qolab/file_utils/__init__.py
+++ b/qolab/file_utils/__init__.py
@@ -10,7 +10,10 @@ def filename2os_fname(fname):
In particular replaces Z: <==> /mnt/qol_grp_data and \\ <==> /
- Example: Z:\\dir1\\dir2\\file <==> /mnt/qol_grp_data/dir1/dir2/file
+ Example
+ -------
+ >>> filename2os_fname("Z:\\dir1\\dir2\\file") # when run on Linux
+ '/mnt/qol_grp_data/dir1/dir2/file'
"""
if platform.system() == "Windows":
fname = re.sub("/mnt/qol_grp_data", "Z:", fname)
@@ -25,9 +28,11 @@ def filename2os_fname(fname):
def get_runnum(data_dir):
r"""Reads, increments data counter and saves it back in the provided `data_dir`.
If necessary creates counter file and full path to it.
- Examples":
- get_runnum('Z:\\Ramsi_EIT\\data\\')
- get_runnum('/mnt/qol_grp_data/data')
+
+ Examples
+ --------
+ >>> get_runnum('Z:\\Ramsi_EIT\\data\\')
+ >>> get_runnum('/mnt/qol_grp_data/data')
"""
data_dir = filename2os_fname(data_dir)
if not os.path.exists(data_dir):