jupyter-analysis-tools 1.4.0__tar.gz → 1.4.1__tar.gz

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.
Files changed (51) hide show
  1. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/.copier-answers.yml +1 -1
  2. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/CHANGELOG.md +10 -0
  3. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/PKG-INFO +13 -3
  4. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/README.md +2 -2
  5. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/docs/conf.py +1 -1
  6. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/src/jupyter_analysis_tools/__init__.py +1 -1
  7. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/src/jupyter_analysis_tools/utils.py +34 -3
  8. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/src/jupyter_analysis_tools.egg-info/PKG-INFO +13 -3
  9. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/tests/utils.py +30 -0
  10. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/.editorconfig +0 -0
  11. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/.pre-commit-config.yaml +0 -0
  12. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/AUTHORS.rst +0 -0
  13. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/CONTRIBUTING.rst +0 -0
  14. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/LICENSE +0 -0
  15. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/MANIFEST.in +0 -0
  16. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/ci/requirements.txt +0 -0
  17. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/docs/_templates/class.rst +0 -0
  18. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/docs/_templates/module.rst +0 -0
  19. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/docs/authors.rst +0 -0
  20. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/docs/changelog.rst +0 -0
  21. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/docs/contributing.rst +0 -0
  22. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/docs/index.rst +0 -0
  23. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/docs/installation.rst +0 -0
  24. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/docs/readme.rst +0 -0
  25. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/docs/reference/index.rst +0 -0
  26. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/docs/requirements.txt +0 -0
  27. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/docs/spelling_wordlist.txt +0 -0
  28. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/docs/usage.rst +0 -0
  29. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/pyproject.toml +0 -0
  30. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/setup.cfg +0 -0
  31. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/src/jupyter_analysis_tools/analysis.py +0 -0
  32. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/src/jupyter_analysis_tools/binning.py +0 -0
  33. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/src/jupyter_analysis_tools/datalocations.py +0 -0
  34. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/src/jupyter_analysis_tools/distrib.py +0 -0
  35. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/src/jupyter_analysis_tools/git.py +0 -0
  36. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/src/jupyter_analysis_tools/plotting.py +0 -0
  37. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/src/jupyter_analysis_tools/readdata.py +0 -0
  38. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/src/jupyter_analysis_tools/widgets.py +0 -0
  39. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/src/jupyter_analysis_tools.egg-info/SOURCES.txt +0 -0
  40. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/src/jupyter_analysis_tools.egg-info/dependency_links.txt +0 -0
  41. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/src/jupyter_analysis_tools.egg-info/requires.txt +0 -0
  42. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/src/jupyter_analysis_tools.egg-info/top_level.txt +0 -0
  43. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/templates/CHANGELOG.md.j2 +0 -0
  44. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/testdata/2015-03-20-Silica.ssf.json +0 -0
  45. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/testdata/2015-03-20-Silica.ssfz +0 -0
  46. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/testdata/S2842 water.json +0 -0
  47. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/testdata/S2842 water.pdh +0 -0
  48. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/testdata/S2843[9].pdh +0 -0
  49. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/tests/readdata.py +0 -0
  50. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/tests/requirements.txt +0 -0
  51. {jupyter_analysis_tools-1.4.0 → jupyter_analysis_tools-1.4.1}/tox.ini +0 -0
@@ -22,4 +22,4 @@ repo_main_branch: main
22
22
  repo_name: jupyter-analysis-tools
23
23
  repo_userorg: BAMresearch
24
24
  sphinx_theme: furo
25
- version: 1.4.0
25
+ version: 1.4.1
@@ -1,5 +1,15 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v1.4.1 (2025-08-01)
4
+
5
+ ### Bug fixes
6
+
7
+ * **utils**: networkdriveMapping() for Linux, with tests ([`3f4deeb`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/3f4deebdf57cc9162121c26d5d7d8484f1f0ec63))
8
+
9
+ ### Testing
10
+
11
+ * **utils**: remove debug output, should work now ([`1117c89`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/1117c89d4206c6880373e3b8765dff6e48d3ccd5))
12
+
3
13
  ## v1.4.0 (2025-07-28)
4
14
 
5
15
  ### Continuous integration
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jupyter-analysis-tools
3
- Version: 1.4.0
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.0)
38
+ # Jupyter Analysis Tools (v1.4.1)
39
39
 
40
40
  [![PyPI Package latest release](https://img.shields.io/pypi/v/jupyter-analysis-tools.svg)](https://pypi.org/project/jupyter-analysis-tools)
41
- [![Commits since latest release](https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.4.0.svg)](https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.4.0...main)
41
+ [![Commits since latest release](https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.4.1.svg)](https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.4.1...main)
42
42
  [![License](https://img.shields.io/pypi/l/jupyter-analysis-tools.svg)](https://en.wikipedia.org/wiki/MIT_license)
43
43
  [![Supported versions](https://img.shields.io/pypi/pyversions/jupyter-analysis-tools.svg)](https://pypi.org/project/jupyter-analysis-tools)
44
44
  [![PyPI Wheel](https://img.shields.io/pypi/wheel/jupyter-analysis-tools.svg)](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,7 +1,7 @@
1
- # Jupyter Analysis Tools (v1.4.0)
1
+ # Jupyter Analysis Tools (v1.4.1)
2
2
 
3
3
  [![PyPI Package latest release](https://img.shields.io/pypi/v/jupyter-analysis-tools.svg)](https://pypi.org/project/jupyter-analysis-tools)
4
- [![Commits since latest release](https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.4.0.svg)](https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.4.0...main)
4
+ [![Commits since latest release](https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.4.1.svg)](https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.4.1...main)
5
5
  [![License](https://img.shields.io/pypi/l/jupyter-analysis-tools.svg)](https://en.wikipedia.org/wiki/MIT_license)
6
6
  [![Supported versions](https://img.shields.io/pypi/pyversions/jupyter-analysis-tools.svg)](https://pypi.org/project/jupyter-analysis-tools)
7
7
  [![PyPI Wheel](https://img.shields.io/pypi/wheel/jupyter-analysis-tools.svg)](https://pypi.org/project/jupyter-analysis-tools#files)
@@ -32,7 +32,7 @@ project = "Jupyter Analysis Tools"
32
32
  year = "2018-2025"
33
33
  author = "Ingo Breßler and Brian R. Pauw"
34
34
  copyright = "{0}, {1}".format(year, author)
35
- version = "1.4.0"
35
+ version = "1.4.1"
36
36
  release = version
37
37
  commit_id = None
38
38
  try:
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # __init__.py
3
3
 
4
- __version__ = "1.4.0"
4
+ __version__ = "1.4.1"
5
5
 
6
6
  from .binning import reBin
7
7
  from .git import checkRepo, isNBstripoutActivated, isNBstripoutInstalled, isRepo
@@ -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 isWindows() and not filepath.drive.startswith(r"\\"):
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}':\n {path}.")
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.0
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.0)
38
+ # Jupyter Analysis Tools (v1.4.1)
39
39
 
40
40
  [![PyPI Package latest release](https://img.shields.io/pypi/v/jupyter-analysis-tools.svg)](https://pypi.org/project/jupyter-analysis-tools)
41
- [![Commits since latest release](https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.4.0.svg)](https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.4.0...main)
41
+ [![Commits since latest release](https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.4.1.svg)](https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.4.1...main)
42
42
  [![License](https://img.shields.io/pypi/l/jupyter-analysis-tools.svg)](https://en.wikipedia.org/wiki/MIT_license)
43
43
  [![Supported versions](https://img.shields.io/pypi/pyversions/jupyter-analysis-tools.svg)](https://pypi.org/project/jupyter-analysis-tools)
44
44
  [![PyPI Wheel](https://img.shields.io/pypi/wheel/jupyter-analysis-tools.svg)](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
@@ -28,6 +28,25 @@ OK \\psi\folder Microsoft Windows Network
28
28
  Der Befehl wurde erfolgreich ausgeführt.
29
29
  """
30
30
 
31
+ # sample output of 'mount' command on Linux
32
+ outMount = (
33
+ "sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)\n"
34
+ "proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)\n"
35
+ "tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=13148680k,mode=755,inode64)\n"
36
+ "//abc02.def.ault.de/X23/somename on /mnt/some (ugly) on type name type cifs "
37
+ "(rw,nosuid,nodev,relatime,vers=3.0,cache=strict,upcall_target=app,username=dhdhfh,"
38
+ "uid=1000,forceuid,gid=1000,forcegid,addr=10.0.1.2,file_mode=0660,dir_mode=0770,soft,nounix,"
39
+ "mapposix,rsize=4194304,wsize=4194304,bsize=1048576,retrans=1,echo_interval=60,actimeo=1,"
40
+ "closetimeo=1)\n"
41
+ "udev on /dev type devtmpfs (rw,nosuid,relatime,size=65700820k,nr_inodes=16425205,mode=755,"
42
+ "inode64)\n"
43
+ "//xyz04.fgsd.asd.com/G2S/GH31 on /mnt/gh 12 type cifs (rw,nosuid,nodev,relatime,vers=3.0,"
44
+ "cache=strict,upcall_target=app,username=dhdhfh,uid=1000,forceuid,gid=1000,forcegid,"
45
+ "addr=10.6.1.5,file_mode=0660,dir_mode=0770,soft,nounix,mapposix,rsize=4194304,wsize=4194304,"
46
+ "bsize=1048576,retrans=1,echo_interval=60,actimeo=1,closetimeo=1)\n"
47
+ "devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)"
48
+ )
49
+
31
50
 
32
51
  def test_appendToPATH(capsys):
33
52
  # Setting up a PATH for testing first (platform dependent).
@@ -71,6 +90,12 @@ def test_networkdriveMapping():
71
90
  "M:": "\\\\user\\drive\\uname",
72
91
  "T:": "\\\\test\\foldername",
73
92
  }
93
+ else: # Linux or macOS
94
+ map = networkdriveMapping(cmdOutput=outMount)
95
+ assert map == {
96
+ "/mnt/gh 12": "//xyz04.fgsd.asd.com/G2S/GH31",
97
+ "/mnt/some (ugly) on type name": "//abc02.def.ault.de/X23/somename",
98
+ }
74
99
 
75
100
 
76
101
  def test_makeNetworkdriveAbsolute():
@@ -79,6 +104,11 @@ def test_makeNetworkdriveAbsolute():
79
104
  newpath = makeNetworkdriveAbsolute(filepath, cmdOutput=outNetUse)
80
105
  assert filepath != newpath
81
106
  assert newpath == Path(r"\\user\drive\uname\some\folders\a file name.ext")
107
+ else: # Linux or macOS
108
+ filepath = Path("/mnt/some (ugly) on type name/some/folders/a file name.ext")
109
+ newpath = makeNetworkdriveAbsolute(filepath, cmdOutput=outMount)
110
+ assert filepath != newpath
111
+ assert newpath == Path("//abc02.def.ault.de/X23/somename/some/folders/a file name.ext")
82
112
 
83
113
 
84
114
  def test_naturalKey():