jupyter-analysis-tools 1.2.2__tar.gz → 1.3.0__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 (59) hide show
  1. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/.cookiecutterrc +1 -1
  2. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/CHANGELOG.md +16 -0
  3. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/PKG-INFO +19 -3
  4. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/README.rst +2 -2
  5. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/docs/conf.py +1 -1
  6. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/src/jupyter_analysis_tools/__init__.py +1 -1
  7. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/src/jupyter_analysis_tools/utils.py +25 -1
  8. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/src/jupyter_analysis_tools.egg-info/PKG-INFO +19 -3
  9. jupyter_analysis_tools-1.3.0/tests/utils.py +80 -0
  10. jupyter_analysis_tools-1.2.2/tests/utils.py +0 -34
  11. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/.editorconfig +0 -0
  12. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/.pre-commit-config.yaml +0 -0
  13. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/AUTHORS.rst +0 -0
  14. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/CONTRIBUTING.rst +0 -0
  15. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/LICENSE +0 -0
  16. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/MANIFEST.in +0 -0
  17. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/ci/requirements.txt +0 -0
  18. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/ci/templates/.github/workflows/build.yml +0 -0
  19. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/ci/templates/.github/workflows/ci-cd.yml +0 -0
  20. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/ci/templates/.github/workflows/coverage.yml +0 -0
  21. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/ci/templates/.github/workflows/docs.yml +0 -0
  22. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/ci/templates/.github/workflows/release.yml +0 -0
  23. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/ci/templates/.github/workflows/tests.yml +0 -0
  24. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/ci/update.py +0 -0
  25. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/docs/_templates/class.rst +0 -0
  26. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/docs/_templates/module.rst +0 -0
  27. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/docs/authors.rst +0 -0
  28. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/docs/changelog.rst +0 -0
  29. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/docs/contributing.rst +0 -0
  30. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/docs/index.rst +0 -0
  31. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/docs/installation.rst +0 -0
  32. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/docs/readme.rst +0 -0
  33. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/docs/reference/index.rst +0 -0
  34. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/docs/requirements.txt +0 -0
  35. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/docs/spelling_wordlist.txt +0 -0
  36. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/docs/usage.rst +0 -0
  37. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/pyproject.toml +0 -0
  38. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/setup.cfg +0 -0
  39. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/src/jupyter_analysis_tools/analysis.py +0 -0
  40. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/src/jupyter_analysis_tools/binning.py +0 -0
  41. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/src/jupyter_analysis_tools/datalocations.py +0 -0
  42. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/src/jupyter_analysis_tools/distrib.py +0 -0
  43. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/src/jupyter_analysis_tools/git.py +0 -0
  44. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/src/jupyter_analysis_tools/plotting.py +0 -0
  45. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/src/jupyter_analysis_tools/readdata.py +0 -0
  46. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/src/jupyter_analysis_tools/widgets.py +0 -0
  47. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/src/jupyter_analysis_tools.egg-info/SOURCES.txt +0 -0
  48. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/src/jupyter_analysis_tools.egg-info/dependency_links.txt +0 -0
  49. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/src/jupyter_analysis_tools.egg-info/requires.txt +0 -0
  50. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/src/jupyter_analysis_tools.egg-info/top_level.txt +0 -0
  51. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/templates/CHANGELOG.md.j2 +0 -0
  52. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/testdata/2015-03-20-Silica.ssf.json +0 -0
  53. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/testdata/2015-03-20-Silica.ssfz +0 -0
  54. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/testdata/S2842 water.json +0 -0
  55. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/testdata/S2842 water.pdh +0 -0
  56. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/testdata/S2843[9].pdh +0 -0
  57. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/tests/readdata.py +0 -0
  58. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/tests/requirements.txt +0 -0
  59. {jupyter_analysis_tools-1.2.2 → jupyter_analysis_tools-1.3.0}/tox.ini +0 -0
@@ -20,7 +20,7 @@ default_context:
20
20
  release_date: 'today'
21
21
  year_from: '2018'
22
22
  year_to: '2023'
23
- version: '1.2.2'
23
+ version: '1.3.0'
24
24
  pypi_host: 'pypi.org'
25
25
  license: 'MIT license'
26
26
  sphinx_theme: 'furo'
@@ -1,5 +1,21 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v1.3.0 (2025-07-16)
4
+
5
+ ### Bug fixes
6
+
7
+ * utils.extract7z: informative info message ([`80d2f71`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/80d2f7134992d59f0bfd7f5e7bc27772f77cd452))
8
+
9
+ ### Continuous integration
10
+
11
+ * coverage: fix coverage artifact name for multiple matrix.os ([`f471599`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/f471599b8c86e29fd20b78f7cbd9291c3a6dd98a))
12
+
13
+ * testing: test on Windows as well ([`4a83c39`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/4a83c3924bcb820ef0728af40b86a0f6622dfef2))
14
+
15
+ ### Features
16
+
17
+ * utils.makeNetworkdriveAbsolute: new routines for translating a windows drive letter mount to its network location ([`823a6bf`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/823a6bfe126829381bc14d34578f342f4b9d3e8f))
18
+
3
19
  ## v1.2.2 (2025-07-15)
4
20
 
5
21
  ### Bug fixes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jupyter-analysis-tools
3
- Version: 1.2.2
3
+ Version: 1.3.0
4
4
  Summary: Yet another Python library with helpers and utilities for data analysis and processing.
5
5
  Author-email: Ingo Breßler <dev@ingobressler.net>
6
6
  License: MIT license
@@ -53,8 +53,8 @@ Yet another Python library with helpers and utilities for data analysis and proc
53
53
  :target: https://pypi.org/project/jupyter-analysis-tools
54
54
  :alt: PyPI Package latest release
55
55
 
56
- .. |commits-since| image:: https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.2.2.svg
57
- :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.2.2...main
56
+ .. |commits-since| image:: https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.3.0.svg
57
+ :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.3.0...main
58
58
  :alt: Commits since latest release
59
59
 
60
60
  .. |license| image:: https://img.shields.io/pypi/l/jupyter-analysis-tools.svg
@@ -127,6 +127,22 @@ Note, to combine the coverage data from all the tox environments run:
127
127
 
128
128
  # CHANGELOG
129
129
 
130
+ ## v1.3.0 (2025-07-16)
131
+
132
+ ### Bug fixes
133
+
134
+ * utils.extract7z: informative info message ([`80d2f71`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/80d2f7134992d59f0bfd7f5e7bc27772f77cd452))
135
+
136
+ ### Continuous integration
137
+
138
+ * coverage: fix coverage artifact name for multiple matrix.os ([`f471599`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/f471599b8c86e29fd20b78f7cbd9291c3a6dd98a))
139
+
140
+ * testing: test on Windows as well ([`4a83c39`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/4a83c3924bcb820ef0728af40b86a0f6622dfef2))
141
+
142
+ ### Features
143
+
144
+ * utils.makeNetworkdriveAbsolute: new routines for translating a windows drive letter mount to its network location ([`823a6bf`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/823a6bfe126829381bc14d34578f342f4b9d3e8f))
145
+
130
146
  ## v1.2.2 (2025-07-15)
131
147
 
132
148
  ### Bug fixes
@@ -14,8 +14,8 @@ Yet another Python library with helpers and utilities for data analysis and proc
14
14
  :target: https://pypi.org/project/jupyter-analysis-tools
15
15
  :alt: PyPI Package latest release
16
16
 
17
- .. |commits-since| image:: https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.2.2.svg
18
- :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.2.2...main
17
+ .. |commits-since| image:: https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.3.0.svg
18
+ :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.3.0...main
19
19
  :alt: Commits since latest release
20
20
 
21
21
  .. |license| image:: https://img.shields.io/pypi/l/jupyter-analysis-tools.svg
@@ -29,7 +29,7 @@ project = "Jupyter Analysis Tools"
29
29
  year = "2018-2023"
30
30
  author = "Ingo Breßler"
31
31
  copyright = "{0}, {1}".format(year, author)
32
- version = "1.2.2"
32
+ version = "1.3.0"
33
33
  release = version
34
34
  commit_id = None
35
35
  try:
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # __init__.py
3
3
 
4
- __version__ = "1.2.2"
4
+ __version__ = "1.3.0"
5
5
 
6
6
  from .binning import reBin
7
7
  from .git import checkRepo, isNBstripoutActivated, isNBstripoutInstalled, isRepo
@@ -105,6 +105,30 @@ def addEnvScriptsToPATH():
105
105
  os.environ["PATH"] = sep.join(environPATH)
106
106
 
107
107
 
108
+ def networkdriveMapping(cmdOutput: str = None):
109
+ """Returns a dict of mapping drive letters to network paths (on Windows)."""
110
+ if isWindows():
111
+ if cmdOutput is None:
112
+ proc = subprocess.run(["net", "use"], capture_output=True, text=True, encoding="cp850")
113
+ cmdOutput = proc.stdout
114
+ rows = [line.split() for line in cmdOutput.splitlines() if "Windows Network" in line]
115
+ rows = dict(
116
+ [row[1:3] for row in rows if row[1].endswith(":") and row[2].startswith("\\\\")]
117
+ )
118
+ return rows
119
+ return {}
120
+
121
+
122
+ def makeNetworkdriveAbsolute(filepath, cmdOutput: str = None):
123
+ """Replaces the drive letter of the given path by the respective network path, if possible."""
124
+ if isWindows() and not filepath.drive.startswith(r"\\"):
125
+ drivemap = networkdriveMapping(cmdOutput=cmdOutput)
126
+ prefix = drivemap.get(filepath.drive, None)
127
+ if prefix is not None:
128
+ filepath = Path(prefix).joinpath(*filepath.parts[1:])
129
+ return filepath
130
+
131
+
108
132
  def checkWinFor7z():
109
133
  """Extend the PATH environment variable for access to the 7-zip executable."""
110
134
  if not isWindows():
@@ -127,7 +151,7 @@ def extract7z(fn, workdir=None):
127
151
  assert os.path.isfile(os.path.join(workdir, fn)), "Provided 7z archive '{}' not found!".format(
128
152
  fn
129
153
  )
130
- print("Extracting archived McDLS results:")
154
+ print(f"Extracting '{fn}':")
131
155
  proc = subprocess.run(
132
156
  ["7z", "x", fn],
133
157
  cwd=workdir,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jupyter-analysis-tools
3
- Version: 1.2.2
3
+ Version: 1.3.0
4
4
  Summary: Yet another Python library with helpers and utilities for data analysis and processing.
5
5
  Author-email: Ingo Breßler <dev@ingobressler.net>
6
6
  License: MIT license
@@ -53,8 +53,8 @@ Yet another Python library with helpers and utilities for data analysis and proc
53
53
  :target: https://pypi.org/project/jupyter-analysis-tools
54
54
  :alt: PyPI Package latest release
55
55
 
56
- .. |commits-since| image:: https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.2.2.svg
57
- :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.2.2...main
56
+ .. |commits-since| image:: https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.3.0.svg
57
+ :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.3.0...main
58
58
  :alt: Commits since latest release
59
59
 
60
60
  .. |license| image:: https://img.shields.io/pypi/l/jupyter-analysis-tools.svg
@@ -127,6 +127,22 @@ Note, to combine the coverage data from all the tox environments run:
127
127
 
128
128
  # CHANGELOG
129
129
 
130
+ ## v1.3.0 (2025-07-16)
131
+
132
+ ### Bug fixes
133
+
134
+ * utils.extract7z: informative info message ([`80d2f71`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/80d2f7134992d59f0bfd7f5e7bc27772f77cd452))
135
+
136
+ ### Continuous integration
137
+
138
+ * coverage: fix coverage artifact name for multiple matrix.os ([`f471599`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/f471599b8c86e29fd20b78f7cbd9291c3a6dd98a))
139
+
140
+ * testing: test on Windows as well ([`4a83c39`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/4a83c3924bcb820ef0728af40b86a0f6622dfef2))
141
+
142
+ ### Features
143
+
144
+ * utils.makeNetworkdriveAbsolute: new routines for translating a windows drive letter mount to its network location ([`823a6bf`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/823a6bfe126829381bc14d34578f342f4b9d3e8f))
145
+
130
146
  ## v1.2.2 (2025-07-15)
131
147
 
132
148
  ### Bug fixes
@@ -0,0 +1,80 @@
1
+ # -*- coding: utf-8 -*-
2
+ # tests/utils.py
3
+
4
+
5
+ import os
6
+ from pathlib import Path
7
+
8
+ from jupyter_analysis_tools.utils import (
9
+ appendToPATH,
10
+ isWindows,
11
+ makeNetworkdriveAbsolute,
12
+ networkdriveMapping,
13
+ )
14
+
15
+ # output of 'net use' command on Windows
16
+ outNetUse = r"""Neue Verbindungen werden gespeichert.
17
+
18
+
19
+ Status Lokal Remote Netzwerk
20
+
21
+ -------------------------------------------------------------------------------
22
+ OK G: \\ALPHA\BETA Microsoft Windows Network
23
+ OK K: \\GAM\MMA Microsoft Windows Network
24
+ OK M: \\user\drive\uname Microsoft Windows Network
25
+ OK T: \\test\foldername Microsoft Windows Network
26
+ OK \\psi\folder Microsoft Windows Network
27
+ Der Befehl wurde erfolgreich ausgeführt.
28
+ """
29
+
30
+
31
+ def test_appendToPATH(capsys):
32
+ # Setting up a PATH for testing first (platform dependent).
33
+ testpath = "/usr/local/sbin:/usr/local/bin:/sbin:/usr/games:/usr/local/games:/snap/bin"
34
+ if isWindows():
35
+ testpath = "something else"
36
+ os.environ["PATH"] = testpath
37
+ assert os.environ["PATH"] == testpath
38
+
39
+ if not isWindows(): # Linux edition
40
+ appendToPATH("/tmp", ("one", "two"), verbose=True)
41
+ captured = capsys.readouterr()
42
+ assert (
43
+ captured.out
44
+ == """\
45
+ /tmp/one [exists: False]
46
+ /tmp/two [exists: False]
47
+ """
48
+ )
49
+ assert os.environ["PATH"] == testpath + ":/tmp/one:/tmp/two"
50
+
51
+ else: # Windows edition
52
+ appendToPATH(r"C:\Windows", ("one", "two"), verbose=True)
53
+ captured = capsys.readouterr()
54
+ assert (
55
+ captured.out
56
+ == """\
57
+ C:\\Windows\\one [exists: False]
58
+ C:\\Windows\\two [exists: False]
59
+ """
60
+ )
61
+ assert os.environ["PATH"] == testpath + r";C:\Windows\one;C:\Windows\two"
62
+
63
+
64
+ def test_networkdriveMapping():
65
+ if isWindows():
66
+ map = networkdriveMapping(cmdOutput=outNetUse)
67
+ assert map == {
68
+ "G:": "\\\\ALPHA\\BETA",
69
+ "K:": "\\\\GAM\\MMA",
70
+ "M:": "\\\\user\\drive\\uname",
71
+ "T:": "\\\\test\\foldername",
72
+ }
73
+
74
+
75
+ def test_makeNetworkdriveAbsolute():
76
+ if isWindows():
77
+ filepath = Path(r"M:\some\folders\a file name.ext")
78
+ newpath = makeNetworkdriveAbsolute(filepath, cmdOutput=outNetUse)
79
+ assert filepath != newpath
80
+ assert newpath == Path(r"\\user\drive\uname\some\folders\a file name.ext")
@@ -1,34 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # tests/utils.py
3
-
4
-
5
- import os
6
-
7
- from jupyter_analysis_tools.utils import appendToPATH, isWindows
8
-
9
-
10
- def test_appendToPATH(capsys):
11
- # Setting up a PATH for testing first (platform dependent).
12
- testpath = "/usr/local/sbin:/usr/local/bin:/sbin:/usr/games:/usr/local/games:/snap/bin"
13
- if isWindows():
14
- testpath = "something else"
15
- os.environ["PATH"] = testpath
16
- assert os.environ["PATH"] == testpath
17
-
18
- if not isWindows(): # Linux edition
19
- appendToPATH("/tmp", ("one", "two"), verbose=True)
20
- captured = capsys.readouterr()
21
- assert captured.out == """\
22
- /tmp/one [exists: False]
23
- /tmp/two [exists: False]
24
- """
25
- assert os.environ["PATH"] == testpath+":/tmp/one:/tmp/two"
26
-
27
- else: # Windows edition
28
- appendToPATH(r"C:\Windows", ("one", "two"), verbose=True)
29
- captured = capsys.readouterr()
30
- assert captured.out == """\
31
- C:\\Windows\\one [exists: False]
32
- C:\\Windows\\two [exists: False]
33
- """
34
- assert os.environ["PATH"] == testpath+r";C:\Windows\one;C:\Windows\two"