jupyter-analysis-tools 0.1.8__tar.gz → 1.1.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 (54) hide show
  1. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/.cookiecutterrc +1 -1
  2. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/CHANGELOG.md +31 -1
  3. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/PKG-INFO +41 -5
  4. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/README.rst +2 -2
  5. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/ci/templates/.github/workflows/coverage.yml +1 -1
  6. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/docs/conf.py +2 -3
  7. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/pyproject.toml +8 -0
  8. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/src/jupyter_analysis_tools/__init__.py +1 -4
  9. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/src/jupyter_analysis_tools/binning.py +1 -2
  10. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/src/jupyter_analysis_tools/readdata.py +1 -4
  11. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/src/jupyter_analysis_tools/utils.py +38 -14
  12. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/src/jupyter_analysis_tools/widgets.py +1 -1
  13. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/src/jupyter_analysis_tools.egg-info/PKG-INFO +41 -5
  14. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/src/jupyter_analysis_tools.egg-info/SOURCES.txt +2 -2
  15. jupyter_analysis_tools-1.1.0/src/jupyter_analysis_tools.egg-info/requires.txt +5 -0
  16. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/tests/requirements.txt +1 -1
  17. jupyter_analysis_tools-1.1.0/tests/utils.py +33 -0
  18. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/tox.ini +1 -1
  19. jupyter_analysis_tools-0.1.8/src/jupyter_analysis_tools/notebook_utils.py +0 -36
  20. jupyter_analysis_tools-0.1.8/tests/test_jupyter_analysis_tools.py +0 -6
  21. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/.editorconfig +0 -0
  22. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/.pre-commit-config.yaml +0 -0
  23. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/AUTHORS.rst +0 -0
  24. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/CONTRIBUTING.rst +0 -0
  25. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/LICENSE +0 -0
  26. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/MANIFEST.in +0 -0
  27. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/ci/requirements.txt +0 -0
  28. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/ci/templates/.github/workflows/build.yml +0 -0
  29. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/ci/templates/.github/workflows/ci-cd.yml +0 -0
  30. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/ci/templates/.github/workflows/docs.yml +0 -0
  31. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/ci/templates/.github/workflows/release.yml +0 -0
  32. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/ci/templates/.github/workflows/tests.yml +0 -0
  33. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/ci/update.py +0 -0
  34. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/docs/_templates/class.rst +0 -0
  35. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/docs/_templates/module.rst +0 -0
  36. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/docs/authors.rst +0 -0
  37. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/docs/changelog.rst +0 -0
  38. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/docs/contributing.rst +0 -0
  39. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/docs/index.rst +0 -0
  40. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/docs/installation.rst +0 -0
  41. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/docs/readme.rst +0 -0
  42. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/docs/reference/index.rst +0 -0
  43. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/docs/requirements.txt +0 -0
  44. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/docs/spelling_wordlist.txt +0 -0
  45. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/docs/usage.rst +0 -0
  46. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/setup.cfg +0 -0
  47. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/src/jupyter_analysis_tools/analysis.py +0 -0
  48. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/src/jupyter_analysis_tools/datalocations.py +0 -0
  49. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/src/jupyter_analysis_tools/distrib.py +0 -0
  50. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/src/jupyter_analysis_tools/git.py +0 -0
  51. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/src/jupyter_analysis_tools/plotting.py +0 -0
  52. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/src/jupyter_analysis_tools.egg-info/dependency_links.txt +0 -0
  53. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/src/jupyter_analysis_tools.egg-info/top_level.txt +0 -0
  54. {jupyter_analysis_tools-0.1.8 → jupyter_analysis_tools-1.1.0}/templates/CHANGELOG.md.j2 +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: '0.1.8'
23
+ version: '1.1.0'
24
24
  pypi_host: 'pypi.org'
25
25
  license: 'MIT license'
26
26
  sphinx_theme: 'furo'
@@ -1,5 +1,35 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v1.1.0 (2025-07-10)
4
+
5
+ ### Bug fixes
6
+
7
+ * packaging: add dependencies for project and testing ([`2729a45`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/2729a45958893c9acd07af9463bbf7d657db626b))
8
+
9
+ ### Documentation
10
+
11
+ * utils: reformat doc strings ([`1cf9b9b`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/1cf9b9b969e075a75a41e19bfb526378b68a0ed7))
12
+
13
+ ### Features
14
+
15
+ * utils: addEnvScriptsToPATH() ([`a8c22e0`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/a8c22e0d37a5627d5955c1f7f7eebcb0bc99206e))
16
+
17
+ * notebook_utils: remove method for finding notebook file path currentNBpath() ([`13a5a60`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/13a5a60436c7926c478f2ab3f2c309a86b653218))
18
+
19
+ ### Refactoring
20
+
21
+ * utils: appendToPATH() using pathlib, verifed test included ([`35f37fc`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/35f37fc19cdcf4b575dc0525400f3c0212bb0faf))
22
+
23
+ ### Testing
24
+
25
+ * readdata: test data for reading PDH and SSFZ ([`9b919d2`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/9b919d24e1fa5679b49cebf576e471d6e4e9b655))
26
+
27
+ ## v1.0.0 (2025-07-09)
28
+
29
+ ### Bug fixes
30
+
31
+ * packaging: add required dependency packages to project config ([`43076e2`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/43076e2fd27e511545d8f1ec12752435cf5153c6))
32
+
3
33
  ## v0.1.8 (2025-01-30)
4
34
 
5
35
  ### Bug fixes
@@ -180,7 +210,7 @@
180
210
 
181
211
  * docs config: using urls defined in pyproject.toml ([`33d5f23`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/33d5f2338e3a95212c21396d9007bac1495f30a8))
182
212
 
183
- * moving isort config to separate file, not picked up from pyproject in a pre-commit hook ([`bfaf1e0`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/bfaf1e0ab5be225e5e4c34ffc8b1ea8bedb59688))
213
+ * moving isort config to separate file, not picked up from pyproject in a pre-commit hook ([`bfaf1e0`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/bfaf1e0ab5be225e5e4c34ffc8b1ea8bedb59688))
184
214
 
185
215
  * pre-commit uses pycqa repo for isort ([`4b4a31c`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/4b4a31c15e9a07455fe9796e17ddbce5f23456ed))
186
216
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: jupyter-analysis-tools
3
- Version: 0.1.8
3
+ Version: 1.1.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
@@ -30,6 +30,12 @@ Classifier: Intended Audience :: Science/Research
30
30
  Description-Content-Type: text/x-rst
31
31
  License-File: LICENSE
32
32
  License-File: AUTHORS.rst
33
+ Requires-Dist: numpy
34
+ Requires-Dist: scipy
35
+ Requires-Dist: pandas
36
+ Requires-Dist: matplotlib
37
+ Requires-Dist: ipywidgets
38
+ Dynamic: license-file
33
39
 
34
40
  ========
35
41
  Overview
@@ -47,8 +53,8 @@ Yet another Python library with helpers and utilities for data analysis and proc
47
53
  :target: https://pypi.org/project/jupyter-analysis-tools
48
54
  :alt: PyPI Package latest release
49
55
 
50
- .. |commits-since| image:: https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v0.1.8.svg
51
- :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v0.1.8...main
56
+ .. |commits-since| image:: https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.1.0.svg
57
+ :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.1.0...main
52
58
  :alt: Commits since latest release
53
59
 
54
60
  .. |license| image:: https://img.shields.io/pypi/l/jupyter-analysis-tools.svg
@@ -121,6 +127,36 @@ Note, to combine the coverage data from all the tox environments run:
121
127
 
122
128
  # CHANGELOG
123
129
 
130
+ ## v1.1.0 (2025-07-10)
131
+
132
+ ### Bug fixes
133
+
134
+ * packaging: add dependencies for project and testing ([`2729a45`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/2729a45958893c9acd07af9463bbf7d657db626b))
135
+
136
+ ### Documentation
137
+
138
+ * utils: reformat doc strings ([`1cf9b9b`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/1cf9b9b969e075a75a41e19bfb526378b68a0ed7))
139
+
140
+ ### Features
141
+
142
+ * utils: addEnvScriptsToPATH() ([`a8c22e0`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/a8c22e0d37a5627d5955c1f7f7eebcb0bc99206e))
143
+
144
+ * notebook_utils: remove method for finding notebook file path currentNBpath() ([`13a5a60`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/13a5a60436c7926c478f2ab3f2c309a86b653218))
145
+
146
+ ### Refactoring
147
+
148
+ * utils: appendToPATH() using pathlib, verifed test included ([`35f37fc`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/35f37fc19cdcf4b575dc0525400f3c0212bb0faf))
149
+
150
+ ### Testing
151
+
152
+ * readdata: test data for reading PDH and SSFZ ([`9b919d2`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/9b919d24e1fa5679b49cebf576e471d6e4e9b655))
153
+
154
+ ## v1.0.0 (2025-07-09)
155
+
156
+ ### Bug fixes
157
+
158
+ * packaging: add required dependency packages to project config ([`43076e2`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/43076e2fd27e511545d8f1ec12752435cf5153c6))
159
+
124
160
  ## v0.1.8 (2025-01-30)
125
161
 
126
162
  ### Bug fixes
@@ -301,7 +337,7 @@ Note, to combine the coverage data from all the tox environments run:
301
337
 
302
338
  * docs config: using urls defined in pyproject.toml ([`33d5f23`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/33d5f2338e3a95212c21396d9007bac1495f30a8))
303
339
 
304
- * moving isort config to separate file, not picked up from pyproject in a pre-commit hook ([`bfaf1e0`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/bfaf1e0ab5be225e5e4c34ffc8b1ea8bedb59688))
340
+ * moving isort config to separate file, not picked up from pyproject in a pre-commit hook ([`bfaf1e0`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/bfaf1e0ab5be225e5e4c34ffc8b1ea8bedb59688))
305
341
 
306
342
  * pre-commit uses pycqa repo for isort ([`4b4a31c`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/4b4a31c15e9a07455fe9796e17ddbce5f23456ed))
307
343
 
@@ -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/v0.1.8.svg
18
- :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v0.1.8...main
17
+ .. |commits-since| image:: https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.1.0.svg
18
+ :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.1.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
@@ -121,7 +121,7 @@ jobs:
121
121
  echo "{\"schemaVersion\":1,\"label\":\"Coverage\",\"message\":\"{{'${{ env.total }}'}}%\",\"color\":\"hsl($HUE, 100%, 40%)\"}" > "$BADGE_JSON"
122
122
  # Commit.
123
123
  cd ./pages
124
- rm {{'${{ env.report_dir }}/.gitignore'}}
124
+ rm -f {{'${{ env.report_dir }}/.gitignore'}}
125
125
  # ls -la {{'${{ env.report_dir }}'}} # for debugging
126
126
  # {{"${{ env.report_dir }}"}}/* "${REDIR_HTML#*/}" "${BADGE_JSON#*/}"
127
127
  git add -A
@@ -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 = "0.1.8"
32
+ version = "1.1.0"
33
33
  release = version
34
34
  commit_id = None
35
35
  try:
@@ -42,7 +42,6 @@ except subprocess.CalledProcessError as e:
42
42
 
43
43
  autodoc_mock_imports = [
44
44
  "ipykernel",
45
- "notebook",
46
45
  "pandas",
47
46
  "ipywidgets",
48
47
  "matplotlib",
@@ -82,5 +81,5 @@ linkcheck_ignore = [
82
81
  join(project_meta["project"]["urls"]["repository"], "commit", r"[0-9a-fA-F]+"),
83
82
  ]
84
83
  linkcheck_anchors_ignore_for_url = [
85
- r"https://pypi\.org/project/[^/]+/\#",
84
+ r"https://pypi\.org/project/[^/]+",
86
85
  ]
@@ -26,6 +26,9 @@ classifiers = [
26
26
  "Intended Audience :: Developers",
27
27
  "Intended Audience :: Science/Research",
28
28
  ]
29
+ dependencies = [
30
+ "numpy", "scipy", "pandas", "matplotlib", "ipywidgets"
31
+ ]
29
32
 
30
33
  [project.urls]
31
34
  homepage = "https://BAMresearch.github.io/jupyter-analysis-tools"
@@ -80,3 +83,8 @@ group_by_package = true
80
83
  known_first_party = "jupyter_analysis_tools"
81
84
  ensure_newline_before_comments = true
82
85
  extend_skip = ["ci/templates", ".ipynb_checkpoints"]
86
+
87
+ [tool.docformatter]
88
+ recursive = true
89
+ wrap-summaries = 100
90
+ wrap-descriptions = 100
@@ -1,16 +1,13 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # __init__.py
3
3
 
4
- __version__ = "0.1.8"
4
+ __version__ = "1.1.0"
5
5
 
6
6
  from .binning import reBin
7
7
  from .git import checkRepo, isNBstripoutActivated, isNBstripoutInstalled, isRepo
8
- from .notebook_utils import currentNBpath
9
8
  from .readdata import readdata
10
9
  from .readdata import readdata as readPDH
11
10
  from .utils import setLocaleUTF8
12
11
  from .widgets import PathSelector, showBoolStatus
13
12
 
14
13
  setLocaleUTF8()
15
-
16
- # vim: set ts=4 sts=4 sw=4 tw=0:
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
+ # binning.py
3
4
 
4
5
  """
5
6
  Overview
@@ -440,5 +441,3 @@ if __name__ == "__main__":
440
441
  adict = vars(adict)
441
442
  # run the reBin program
442
443
  reBin(**adict)
443
-
444
- # vim: set ts=4 sts=4 sw=4 tw=0:
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- # read1d.py
2
+ # readdata.py
3
3
 
4
4
  import os
5
5
 
@@ -45,6 +45,3 @@ def readdata(fn, q_range=None, read_csv_args=None, print_filename=True):
45
45
 
46
46
  file_name = os.path.basename(fn).split("[")[0]
47
47
  return df_data, file_name
48
-
49
-
50
- # vim: set ts=4 sts=4 sw=4 tw=0:
@@ -17,7 +17,7 @@ indent = " "
17
17
 
18
18
 
19
19
  def setLocaleUTF8():
20
- """Fix the Jupyter locale which is not UTF-8 by default on some systems (older Windows?)."""
20
+ """Fix the Jupyter locale which is not UTF-8 by default on Windows."""
21
21
  locOld = locale.getpreferredencoding(False).lower()
22
22
 
23
23
  def getpreferredencoding(do_setlocale=True):
@@ -42,8 +42,7 @@ def isWindows():
42
42
 
43
43
 
44
44
  def isList(obj):
45
- """Return true if the provided object is list-like including a numpy array
46
- but not a string.
45
+ """Return true if the provided object is list-like including a numpy array but not a string.
47
46
 
48
47
  >>> isList([1, 2, 'a'])
49
48
  True
@@ -68,18 +67,41 @@ def shortenWinPath(path):
68
67
  return win32api.GetShortPathName(path)
69
68
 
70
69
 
71
- def appendToPATH(parentPath, subdirs=None):
70
+ def appendToPATH(parentPath, subdirs=None, verbose=False):
72
71
  """Adds the given path with each subdirectory to the PATH environment variable."""
73
- if not os.path.isdir(parentPath):
72
+ parentPath = Path(parentPath)
73
+ if not parentPath.is_dir():
74
74
  return # nothing to do
75
75
  if subdirs is None:
76
76
  subdirs = ["."]
77
+ sep = ";" if isWindows() else ":"
78
+ PATH = os.environ["PATH"].split(sep)
77
79
  for path in subdirs:
78
- path = os.path.realpath(os.path.join(parentPath, *path.split("/")))
79
- print(indent, path, "\t[{}]".format(os.path.isdir(path)))
80
- if path in os.environ["PATH"]:
81
- continue
82
- os.environ["PATH"] += ";" + path
80
+ path = parentPath / path
81
+ if verbose:
82
+ print(indent, path, "[exists: {}]".format(path.is_dir()))
83
+ if path not in PATH:
84
+ PATH.append(str(path))
85
+ os.environ["PATH"] = sep.join(PATH)
86
+
87
+
88
+ def addEnvScriptsToPATH():
89
+ """Prepends the *Scripts* directory of the current Python environment base directory to systems
90
+ PATH variable.
91
+
92
+ It is intended for Conda (Miniforge) environments on Windows that do not have this in their PATH environment variable, causing them to miss many commands provided from this location.
93
+ """
94
+ envPath = [p for p in sys.path if p.endswith("Lib")]
95
+ if not envPath:
96
+ return # probably not a Miniforge environment
97
+ envPath = envPath[0]
98
+ envPath = Path(envPath).parent / "Scripts"
99
+ sep = ";" if isWindows() else ":"
100
+ environPATH = os.environ["PATH"].split(sep)
101
+ # print(environPATH)
102
+ if envPath.exists() and str(envPath) not in environPATH:
103
+ environPATH = [str(envPath)] + environPATH
104
+ os.environ["PATH"] = sep.join(environPATH)
83
105
 
84
106
 
85
107
  def checkWinFor7z():
@@ -126,9 +148,11 @@ def pushd(new_dir):
126
148
 
127
149
 
128
150
  def setPackage(globalsdict):
129
- """Sets the current directory of the notebook as python package
130
- to make relative module imports work.
131
- Usage: `setPackage(globals())`"""
151
+ """Sets the current directory of the notebook as python package to make relative module imports
152
+ work.
153
+
154
+ Usage: `setPackage(globals())`
155
+ """
132
156
  path = Path().resolve()
133
157
  searchpath = str(path.parent)
134
158
  if searchpath not in sys.path:
@@ -145,7 +169,7 @@ def grouper(iterable, n, fillvalue=None):
145
169
 
146
170
 
147
171
  def fmtErr(val, std, precision=2, width=None):
148
- """Formats a given value and its std. deviation to physics notation, e.g. '1.23(4)'."""
172
+ """Formats a given value and its stdandard deviation to physics notation, e.g. '1.23(4)'."""
149
173
  if width is None:
150
174
  width = ""
151
175
  fmt = "{:" + str(width) + "." + str(precision) + "f}({:.0f})"
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- # ui.py
2
+ # widgets.py
3
3
 
4
4
  import os
5
5
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: jupyter-analysis-tools
3
- Version: 0.1.8
3
+ Version: 1.1.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
@@ -30,6 +30,12 @@ Classifier: Intended Audience :: Science/Research
30
30
  Description-Content-Type: text/x-rst
31
31
  License-File: LICENSE
32
32
  License-File: AUTHORS.rst
33
+ Requires-Dist: numpy
34
+ Requires-Dist: scipy
35
+ Requires-Dist: pandas
36
+ Requires-Dist: matplotlib
37
+ Requires-Dist: ipywidgets
38
+ Dynamic: license-file
33
39
 
34
40
  ========
35
41
  Overview
@@ -47,8 +53,8 @@ Yet another Python library with helpers and utilities for data analysis and proc
47
53
  :target: https://pypi.org/project/jupyter-analysis-tools
48
54
  :alt: PyPI Package latest release
49
55
 
50
- .. |commits-since| image:: https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v0.1.8.svg
51
- :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v0.1.8...main
56
+ .. |commits-since| image:: https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.1.0.svg
57
+ :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.1.0...main
52
58
  :alt: Commits since latest release
53
59
 
54
60
  .. |license| image:: https://img.shields.io/pypi/l/jupyter-analysis-tools.svg
@@ -121,6 +127,36 @@ Note, to combine the coverage data from all the tox environments run:
121
127
 
122
128
  # CHANGELOG
123
129
 
130
+ ## v1.1.0 (2025-07-10)
131
+
132
+ ### Bug fixes
133
+
134
+ * packaging: add dependencies for project and testing ([`2729a45`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/2729a45958893c9acd07af9463bbf7d657db626b))
135
+
136
+ ### Documentation
137
+
138
+ * utils: reformat doc strings ([`1cf9b9b`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/1cf9b9b969e075a75a41e19bfb526378b68a0ed7))
139
+
140
+ ### Features
141
+
142
+ * utils: addEnvScriptsToPATH() ([`a8c22e0`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/a8c22e0d37a5627d5955c1f7f7eebcb0bc99206e))
143
+
144
+ * notebook_utils: remove method for finding notebook file path currentNBpath() ([`13a5a60`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/13a5a60436c7926c478f2ab3f2c309a86b653218))
145
+
146
+ ### Refactoring
147
+
148
+ * utils: appendToPATH() using pathlib, verifed test included ([`35f37fc`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/35f37fc19cdcf4b575dc0525400f3c0212bb0faf))
149
+
150
+ ### Testing
151
+
152
+ * readdata: test data for reading PDH and SSFZ ([`9b919d2`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/9b919d24e1fa5679b49cebf576e471d6e4e9b655))
153
+
154
+ ## v1.0.0 (2025-07-09)
155
+
156
+ ### Bug fixes
157
+
158
+ * packaging: add required dependency packages to project config ([`43076e2`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/43076e2fd27e511545d8f1ec12752435cf5153c6))
159
+
124
160
  ## v0.1.8 (2025-01-30)
125
161
 
126
162
  ### Bug fixes
@@ -301,7 +337,7 @@ Note, to combine the coverage data from all the tox environments run:
301
337
 
302
338
  * docs config: using urls defined in pyproject.toml ([`33d5f23`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/33d5f2338e3a95212c21396d9007bac1495f30a8))
303
339
 
304
- * moving isort config to separate file, not picked up from pyproject in a pre-commit hook ([`bfaf1e0`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/bfaf1e0ab5be225e5e4c34ffc8b1ea8bedb59688))
340
+ * moving isort config to separate file, not picked up from pyproject in a pre-commit hook ([`bfaf1e0`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/bfaf1e0ab5be225e5e4c34ffc8b1ea8bedb59688))
305
341
 
306
342
  * pre-commit uses pycqa repo for isort ([`4b4a31c`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/4b4a31c15e9a07455fe9796e17ddbce5f23456ed))
307
343
 
@@ -36,7 +36,6 @@ src/jupyter_analysis_tools/binning.py
36
36
  src/jupyter_analysis_tools/datalocations.py
37
37
  src/jupyter_analysis_tools/distrib.py
38
38
  src/jupyter_analysis_tools/git.py
39
- src/jupyter_analysis_tools/notebook_utils.py
40
39
  src/jupyter_analysis_tools/plotting.py
41
40
  src/jupyter_analysis_tools/readdata.py
42
41
  src/jupyter_analysis_tools/utils.py
@@ -44,7 +43,8 @@ src/jupyter_analysis_tools/widgets.py
44
43
  src/jupyter_analysis_tools.egg-info/PKG-INFO
45
44
  src/jupyter_analysis_tools.egg-info/SOURCES.txt
46
45
  src/jupyter_analysis_tools.egg-info/dependency_links.txt
46
+ src/jupyter_analysis_tools.egg-info/requires.txt
47
47
  src/jupyter_analysis_tools.egg-info/top_level.txt
48
48
  templates/CHANGELOG.md.j2
49
49
  tests/requirements.txt
50
- tests/test_jupyter_analysis_tools.py
50
+ tests/utils.py
@@ -0,0 +1,5 @@
1
+ numpy
2
+ scipy
3
+ pandas
4
+ matplotlib
5
+ ipywidgets
@@ -1,6 +1,6 @@
1
1
  ipykernel
2
- notebook
3
2
  pandas
4
3
  ipywidgets
5
4
  matplotlib
6
5
  scipy
6
+ pytest-notebook
@@ -0,0 +1,33 @@
1
+ # -*- coding: utf-8 -*-
2
+ # tests/utils.py
3
+
4
+ from jupyter_analysis_tools.utils import appendToPATH, isWindows
5
+
6
+
7
+ def test_appendToPATH(capsys):
8
+ # Setting up a PATH for testing first (platform dependent).
9
+ import os
10
+ import unittest
11
+ testpath = "/usr/local/sbin:/usr/local/bin:/sbin:/usr/games:/usr/local/games:/snap/bin"
12
+ if isWindows():
13
+ testpath = "something else"
14
+ os.environ["PATH"] = testpath
15
+ assert os.environ["PATH"] == testpath
16
+
17
+ if not isWindows(): # Linux edition
18
+ appendToPATH("/tmp", ("one", "two"), verbose=True)
19
+ captured = capsys.readouterr()
20
+ assert captured.out == """\
21
+ /tmp/one [exists: False]
22
+ /tmp/two [exists: False]
23
+ """
24
+ assert os.environ["PATH"] == testpath+":/tmp/one:/tmp/two"
25
+
26
+ else: # Windows edition
27
+ appendToPATH(r"C:\Windows", ("one", "two"), verbose=True)
28
+ captured = capsys.readouterr()
29
+ assert captured.out == """\
30
+ C:\\Windows\\one [exists: False]
31
+ C:\\Windows\\two [exists: False]
32
+ """
33
+ assert os.environ["PATH"] == testpath+r";C:\Windows\one;C:\Windows\two"
@@ -82,7 +82,7 @@ commands =
82
82
  deps =
83
83
  coverage
84
84
  skip_install = true
85
- allowlist_externals=/bin/rm,/usr/bin/rm
85
+ allowlist_externals=/bin/rm,/usr/bin/rm,rm
86
86
  commands =
87
87
  coverage erase
88
88
  rm -Rf dist build htmlcov src/jupyter_analysis_tools.egg-info
@@ -1,36 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # notebook_utils.py
3
-
4
- import json
5
- import os
6
- import urllib
7
-
8
- import ipykernel
9
-
10
- try:
11
- from notebook import notebookapp
12
- except ImportError:
13
- from notebook import app as notebookapp
14
-
15
-
16
- def currentNBpath():
17
- """Returns the absolute path of the Notebook or None if it cannot be determined
18
- NOTE: works only for *Jupyter Notebook* (not Jupyter Lab)
19
- and when the security is token-based or there is also no password.
20
- """
21
- connection_file = os.path.basename(ipykernel.get_connection_file())
22
- kernel_id = connection_file.split("-", 1)[1].split(".")[0]
23
-
24
- for srv in notebookapp.list_running_servers():
25
- try:
26
- if srv["token"] == "" and not srv["password"]: # No token and no password, ahem...
27
- req = urllib.request.urlopen(srv["url"] + "api/sessions")
28
- else:
29
- req = urllib.request.urlopen(srv["url"] + "api/sessions?token=" + srv["token"])
30
- sessions = json.load(req)
31
- for sess in sessions:
32
- if sess["kernel"]["id"] == kernel_id:
33
- return os.path.join(srv["notebook_dir"], sess["notebook"]["path"])
34
- except OSError:
35
- pass # There may be stale entries in the runtime directory
36
- return None
@@ -1,6 +0,0 @@
1
- # from jupyter_analysis_tools import *
2
-
3
-
4
- # dummy test to verify the setup
5
- def test_main():
6
- pass