jupyter-analysis-tools 1.4.0__py3-none-any.whl → 1.4.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- jupyter_analysis_tools/__init__.py +1 -1
- jupyter_analysis_tools/utils.py +34 -3
- {jupyter_analysis_tools-1.4.0.dist-info → jupyter_analysis_tools-1.4.1.dist-info}/METADATA +13 -3
- {jupyter_analysis_tools-1.4.0.dist-info → jupyter_analysis_tools-1.4.1.dist-info}/RECORD +8 -8
- {jupyter_analysis_tools-1.4.0.dist-info → jupyter_analysis_tools-1.4.1.dist-info}/WHEEL +0 -0
- {jupyter_analysis_tools-1.4.0.dist-info → jupyter_analysis_tools-1.4.1.dist-info}/licenses/AUTHORS.rst +0 -0
- {jupyter_analysis_tools-1.4.0.dist-info → jupyter_analysis_tools-1.4.1.dist-info}/licenses/LICENSE +0 -0
- {jupyter_analysis_tools-1.4.0.dist-info → jupyter_analysis_tools-1.4.1.dist-info}/top_level.txt +0 -0
jupyter_analysis_tools/utils.py
CHANGED
|
@@ -117,16 +117,47 @@ def networkdriveMapping(cmdOutput: str = None):
|
|
|
117
117
|
[row[1:3] for row in rows if row[1].endswith(":") and row[2].startswith("\\\\")]
|
|
118
118
|
)
|
|
119
119
|
return rows
|
|
120
|
+
else: # Linux (tested) or macOS (untested)
|
|
121
|
+
if cmdOutput is None:
|
|
122
|
+
proc = subprocess.run(["mount"], capture_output=True, text=True)
|
|
123
|
+
cmdOutput = proc.stdout
|
|
124
|
+
|
|
125
|
+
def parse(line):
|
|
126
|
+
# position of last opening parenthesis, start of options list
|
|
127
|
+
lastParen = list(i for i, c in enumerate(line) if "(" == c)[-1]
|
|
128
|
+
line = line[:lastParen].strip()
|
|
129
|
+
spaces = list(i for i, c in enumerate(line) if " " == c)
|
|
130
|
+
fstype = line[spaces[-1] :].strip() # last remaining word is the filesystem type
|
|
131
|
+
line = line[: spaces[-2]].strip() # strip the 'type' indicator as well
|
|
132
|
+
sepIdx = line.find(" on /") # separates destination from mount point
|
|
133
|
+
dest = line[:sepIdx].strip()
|
|
134
|
+
mountpoint = line[sepIdx + 4 :].strip()
|
|
135
|
+
yield (mountpoint, dest, fstype)
|
|
136
|
+
|
|
137
|
+
return {
|
|
138
|
+
mp: dst
|
|
139
|
+
for line in cmdOutput.strip().splitlines()
|
|
140
|
+
for (mp, dst, fstype) in parse(line)
|
|
141
|
+
if fstype in ("nfs", "cifs", "sshfs", "afs", "ext4")
|
|
142
|
+
}
|
|
120
143
|
return {}
|
|
121
144
|
|
|
122
145
|
|
|
123
146
|
def makeNetworkdriveAbsolute(filepath, cmdOutput: str = None):
|
|
124
147
|
"""Replaces the drive letter of the given path by the respective network path, if possible."""
|
|
125
|
-
if
|
|
148
|
+
if filepath.drive.startswith(r"\\"):
|
|
149
|
+
return # it's a UNC path already
|
|
150
|
+
if isWindows():
|
|
126
151
|
drivemap = networkdriveMapping(cmdOutput=cmdOutput)
|
|
127
152
|
prefix = drivemap.get(filepath.drive, None)
|
|
128
153
|
if prefix is not None:
|
|
129
154
|
filepath = Path(prefix).joinpath(*filepath.parts[1:])
|
|
155
|
+
else: # Linux or macOS
|
|
156
|
+
drivemap = networkdriveMapping(cmdOutput=cmdOutput)
|
|
157
|
+
# search for the mountpoint, starting with the longest, most specific, first
|
|
158
|
+
for mp, target in sorted(drivemap.items(), key=lambda tup: len(tup[0]), reverse=True):
|
|
159
|
+
if filepath.is_relative_to(mp):
|
|
160
|
+
return Path(target).joinpath(filepath.relative_to(mp))
|
|
130
161
|
return filepath
|
|
131
162
|
|
|
132
163
|
|
|
@@ -152,7 +183,7 @@ def extract7z(fn, workdir=None):
|
|
|
152
183
|
assert os.path.isfile(os.path.join(workdir, fn)), "Provided 7z archive '{}' not found!".format(
|
|
153
184
|
fn
|
|
154
185
|
)
|
|
155
|
-
print(f"Extracting '{fn}':")
|
|
186
|
+
print(f"Extracting '{fn}': ")
|
|
156
187
|
proc = subprocess.run(
|
|
157
188
|
["7z", "x", fn],
|
|
158
189
|
cwd=workdir,
|
|
@@ -185,7 +216,7 @@ def setPackage(globalsdict):
|
|
|
185
216
|
sys.path.insert(0, searchpath)
|
|
186
217
|
globalsdict["__package__"] = path.name
|
|
187
218
|
globalsdict["__name__"] = path.name
|
|
188
|
-
print(f"Setting the current directory as package '{path.name}'
|
|
219
|
+
print(f"Setting the current directory as package '{path.name}': \n {path}.")
|
|
189
220
|
|
|
190
221
|
|
|
191
222
|
def grouper(iterable, n, fillvalue=None):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jupyter-analysis-tools
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.1
|
|
4
4
|
Summary: Yet another Python library with helpers and utilities for data analysis and processing.
|
|
5
5
|
Author-email: Ingo Breßler <ingo.bressler@bam.de>, "Brian R. Pauw" <brian.pauw@bam.de>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -35,10 +35,10 @@ Requires-Dist: matplotlib
|
|
|
35
35
|
Requires-Dist: ipywidgets
|
|
36
36
|
Dynamic: license-file
|
|
37
37
|
|
|
38
|
-
# Jupyter Analysis Tools (v1.4.
|
|
38
|
+
# Jupyter Analysis Tools (v1.4.1)
|
|
39
39
|
|
|
40
40
|
[](https://pypi.org/project/jupyter-analysis-tools)
|
|
41
|
-
[](https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.4.1...main)
|
|
42
42
|
[](https://en.wikipedia.org/wiki/MIT_license)
|
|
43
43
|
[](https://pypi.org/project/jupyter-analysis-tools)
|
|
44
44
|
[](https://pypi.org/project/jupyter-analysis-tools#files)
|
|
@@ -97,6 +97,16 @@ are installed:
|
|
|
97
97
|
|
|
98
98
|
# CHANGELOG
|
|
99
99
|
|
|
100
|
+
## v1.4.1 (2025-08-01)
|
|
101
|
+
|
|
102
|
+
### Bug fixes
|
|
103
|
+
|
|
104
|
+
* **utils**: networkdriveMapping() for Linux, with tests ([`3f4deeb`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/3f4deebdf57cc9162121c26d5d7d8484f1f0ec63))
|
|
105
|
+
|
|
106
|
+
### Testing
|
|
107
|
+
|
|
108
|
+
* **utils**: remove debug output, should work now ([`1117c89`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/1117c89d4206c6880373e3b8765dff6e48d3ccd5))
|
|
109
|
+
|
|
100
110
|
## v1.4.0 (2025-07-28)
|
|
101
111
|
|
|
102
112
|
### Continuous integration
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
jupyter_analysis_tools/__init__.py,sha256=
|
|
1
|
+
jupyter_analysis_tools/__init__.py,sha256=fGYDi_Ue_6eMLG_hi9FqEOgckxlhFnXQB98ELyhaecM,398
|
|
2
2
|
jupyter_analysis_tools/analysis.py,sha256=AiAvUO648f0PYXqLfal1kDH926neasE5c1RYFu9wtYg,1768
|
|
3
3
|
jupyter_analysis_tools/binning.py,sha256=d6eXRC3IOnnJIF25OfEASyWedT71EX2nF7jAgGJ9suQ,14536
|
|
4
4
|
jupyter_analysis_tools/datalocations.py,sha256=BakfiZOMcBwp-_DAn7l57lGWZmZGNnk0j73V75nLBUA,4322
|
|
@@ -6,11 +6,11 @@ jupyter_analysis_tools/distrib.py,sha256=uyh2jXDdXR6dfd36CAoE5_psoFF0bfA6l1wletP
|
|
|
6
6
|
jupyter_analysis_tools/git.py,sha256=mqSk5nnAFrmk1_2KFuKVrDWOkRbGbAQOq2N1DfxhNpg,2216
|
|
7
7
|
jupyter_analysis_tools/plotting.py,sha256=X5Orrwiof-9MuYMKDJEXIlIt0K6bQT6ktFFjXKIVApI,1962
|
|
8
8
|
jupyter_analysis_tools/readdata.py,sha256=kHbGh7sp3lbpxuHASmCUVZsfH45JCIxMzgSnbq-Pgoo,6883
|
|
9
|
-
jupyter_analysis_tools/utils.py,sha256=
|
|
9
|
+
jupyter_analysis_tools/utils.py,sha256=JcfIv50cAm9MIu9jSptxP3abJwz9XnKsdbKsuJNMQrQ,8078
|
|
10
10
|
jupyter_analysis_tools/widgets.py,sha256=rA8qPvY9nS1OtykZwXtCTG29K-N_MYFVb5Aj8yK40_s,2996
|
|
11
|
-
jupyter_analysis_tools-1.4.
|
|
12
|
-
jupyter_analysis_tools-1.4.
|
|
13
|
-
jupyter_analysis_tools-1.4.
|
|
14
|
-
jupyter_analysis_tools-1.4.
|
|
15
|
-
jupyter_analysis_tools-1.4.
|
|
16
|
-
jupyter_analysis_tools-1.4.
|
|
11
|
+
jupyter_analysis_tools-1.4.1.dist-info/licenses/AUTHORS.rst,sha256=-twUESsY0XqFQ0MIC0ylKhglNwL8lyHmGXriM3RF-2s,93
|
|
12
|
+
jupyter_analysis_tools-1.4.1.dist-info/licenses/LICENSE,sha256=jRVl3hmCq0Qv1wifm-EelEKhFWecdoWdhcxSte4a1_c,1125
|
|
13
|
+
jupyter_analysis_tools-1.4.1.dist-info/METADATA,sha256=9Xvhoeern3vZcI5icffe0TAddl_cKyW4MqVW9-yTBmg,44248
|
|
14
|
+
jupyter_analysis_tools-1.4.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
15
|
+
jupyter_analysis_tools-1.4.1.dist-info/top_level.txt,sha256=ei_0x-BF85FLoJ_h67ySwDFowtqus_gI4_0GR466PEU,23
|
|
16
|
+
jupyter_analysis_tools-1.4.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
{jupyter_analysis_tools-1.4.0.dist-info → jupyter_analysis_tools-1.4.1.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{jupyter_analysis_tools-1.4.0.dist-info → jupyter_analysis_tools-1.4.1.dist-info}/top_level.txt
RENAMED
|
File without changes
|