jupyter-analysis-tools 1.1.0__tar.gz → 1.2.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 (59) hide show
  1. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/.cookiecutterrc +1 -1
  2. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/CHANGELOG.md +36 -0
  3. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/MANIFEST.in +1 -0
  4. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/PKG-INFO +41 -5
  5. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/README.rst +4 -4
  6. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/docs/conf.py +1 -1
  7. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/src/jupyter_analysis_tools/__init__.py +2 -1
  8. jupyter_analysis_tools-1.2.1/src/jupyter_analysis_tools/readdata.py +167 -0
  9. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/src/jupyter_analysis_tools/utils.py +2 -1
  10. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/src/jupyter_analysis_tools.egg-info/PKG-INFO +41 -5
  11. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/src/jupyter_analysis_tools.egg-info/SOURCES.txt +6 -0
  12. jupyter_analysis_tools-1.2.1/testdata/2015-03-20-Silica.ssf.json +810 -0
  13. jupyter_analysis_tools-1.2.1/testdata/2015-03-20-Silica.ssfz +0 -0
  14. jupyter_analysis_tools-1.2.1/testdata/S2842 water.json +1798 -0
  15. jupyter_analysis_tools-1.2.1/testdata/S2842 water.pdh +1782 -0
  16. jupyter_analysis_tools-1.2.1/testdata/S2843[9].pdh +936 -0
  17. jupyter_analysis_tools-1.2.1/tests/readdata.py +104 -0
  18. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/tests/utils.py +3 -2
  19. jupyter_analysis_tools-1.1.0/src/jupyter_analysis_tools/readdata.py +0 -47
  20. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/.editorconfig +0 -0
  21. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/.pre-commit-config.yaml +0 -0
  22. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/AUTHORS.rst +0 -0
  23. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/CONTRIBUTING.rst +0 -0
  24. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/LICENSE +0 -0
  25. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/ci/requirements.txt +0 -0
  26. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/ci/templates/.github/workflows/build.yml +0 -0
  27. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/ci/templates/.github/workflows/ci-cd.yml +0 -0
  28. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/ci/templates/.github/workflows/coverage.yml +0 -0
  29. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/ci/templates/.github/workflows/docs.yml +0 -0
  30. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/ci/templates/.github/workflows/release.yml +0 -0
  31. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/ci/templates/.github/workflows/tests.yml +0 -0
  32. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/ci/update.py +0 -0
  33. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/docs/_templates/class.rst +0 -0
  34. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/docs/_templates/module.rst +0 -0
  35. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/docs/authors.rst +0 -0
  36. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/docs/changelog.rst +0 -0
  37. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/docs/contributing.rst +0 -0
  38. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/docs/index.rst +0 -0
  39. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/docs/installation.rst +0 -0
  40. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/docs/readme.rst +0 -0
  41. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/docs/reference/index.rst +0 -0
  42. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/docs/requirements.txt +0 -0
  43. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/docs/spelling_wordlist.txt +0 -0
  44. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/docs/usage.rst +0 -0
  45. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/pyproject.toml +0 -0
  46. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/setup.cfg +0 -0
  47. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/src/jupyter_analysis_tools/analysis.py +0 -0
  48. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/src/jupyter_analysis_tools/binning.py +0 -0
  49. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/src/jupyter_analysis_tools/datalocations.py +0 -0
  50. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/src/jupyter_analysis_tools/distrib.py +0 -0
  51. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/src/jupyter_analysis_tools/git.py +0 -0
  52. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/src/jupyter_analysis_tools/plotting.py +0 -0
  53. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/src/jupyter_analysis_tools/widgets.py +0 -0
  54. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/src/jupyter_analysis_tools.egg-info/dependency_links.txt +0 -0
  55. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/src/jupyter_analysis_tools.egg-info/requires.txt +0 -0
  56. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/src/jupyter_analysis_tools.egg-info/top_level.txt +0 -0
  57. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/templates/CHANGELOG.md.j2 +0 -0
  58. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/tests/requirements.txt +0 -0
  59. {jupyter_analysis_tools-1.1.0 → jupyter_analysis_tools-1.2.1}/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.1.0'
23
+ version: '1.2.1'
24
24
  pypi_host: 'pypi.org'
25
25
  license: 'MIT license'
26
26
  sphinx_theme: 'furo'
@@ -1,5 +1,41 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v1.2.1 (2025-07-11)
4
+
5
+ ### Bug fixes
6
+
7
+ * readme: trigger new version after style changes ([`8b2b5e9`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/8b2b5e93c0f24ae59afaa764abdc508e994946b4))
8
+
9
+ ### Code style
10
+
11
+ * __init__: imports format ([`6f07790`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/6f07790a04e43736b1c0fbce0eac54d0b661a7cf))
12
+
13
+ * utils: satisfy flake8 ([`9657474`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/9657474e94a4d9887c4a6b653e0ffa403e666d02))
14
+
15
+ * readdata: satisfy flake8 ([`36bf6e8`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/36bf6e8be67a2ebd345c5557c2352710bcebed82))
16
+
17
+ ### Continuous integration
18
+
19
+ * workflow: publish only if the docs are good ([`a663ed3`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/a663ed3d1fd87079a4fd7cf419132a129280a562))
20
+
21
+ ### Testing
22
+
23
+ * utils: fix imports ([`ddd5369`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/ddd5369b8037f583c6900aea25522a56126c9d32))
24
+
25
+ ## v1.2.0 (2025-07-11)
26
+
27
+ ### Features
28
+
29
+ * readdata: readSSF() renamed from readSession(), tests added with expected JSON output ([`e2197f6`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/e2197f6bcb032c1bc1a9a7435e024dda763228c4))
30
+
31
+ * readPDHmeta: routine for reading metadata part from .PDH and .SSF files ([`ea6a1d5`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/ea6a1d554f3763fc05022ae8e4e8909f0993cd43))
32
+
33
+ ### Testing
34
+
35
+ * readdata: path separator depends on platform ([`1b2866f`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/1b2866f13307c2cf2dedc59f36d7372442ddbfd8))
36
+
37
+ * readdata: testdata files and testing, using pathlib instead of old os.path ([`aeacfa4`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/aeacfa4a949d7293f2cd3ce5e3004fddf20ecc02))
38
+
3
39
  ## v1.1.0 (2025-07-10)
4
40
 
5
41
  ### Bug fixes
@@ -17,3 +17,4 @@ include README.rst
17
17
 
18
18
  global-exclude *.py[cod] __pycache__/* *.so *.dylib .DS_Store */.ipynb_checkpoints/*
19
19
  recursive-include templates *.j2
20
+ recursive-include testdata *.pdh *.ssfz *.json
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jupyter-analysis-tools
3
- Version: 1.1.0
3
+ Version: 1.2.1
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.1.0.svg
57
- :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.1.0...main
56
+ .. |commits-since| image:: https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.2.1.svg
57
+ :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.2.1...main
58
58
  :alt: Commits since latest release
59
59
 
60
60
  .. |license| image:: https://img.shields.io/pypi/l/jupyter-analysis-tools.svg
@@ -104,9 +104,9 @@ https://BAMresearch.github.io/jupyter-analysis-tools
104
104
  Development
105
105
  ===========
106
106
 
107
- To run all the tests run::
107
+ Run all tests with::
108
108
 
109
- tox
109
+ tox -e py
110
110
 
111
111
  Note, to combine the coverage data from all the tox environments run:
112
112
 
@@ -127,6 +127,42 @@ Note, to combine the coverage data from all the tox environments run:
127
127
 
128
128
  # CHANGELOG
129
129
 
130
+ ## v1.2.1 (2025-07-11)
131
+
132
+ ### Bug fixes
133
+
134
+ * readme: trigger new version after style changes ([`8b2b5e9`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/8b2b5e93c0f24ae59afaa764abdc508e994946b4))
135
+
136
+ ### Code style
137
+
138
+ * __init__: imports format ([`6f07790`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/6f07790a04e43736b1c0fbce0eac54d0b661a7cf))
139
+
140
+ * utils: satisfy flake8 ([`9657474`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/9657474e94a4d9887c4a6b653e0ffa403e666d02))
141
+
142
+ * readdata: satisfy flake8 ([`36bf6e8`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/36bf6e8be67a2ebd345c5557c2352710bcebed82))
143
+
144
+ ### Continuous integration
145
+
146
+ * workflow: publish only if the docs are good ([`a663ed3`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/a663ed3d1fd87079a4fd7cf419132a129280a562))
147
+
148
+ ### Testing
149
+
150
+ * utils: fix imports ([`ddd5369`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/ddd5369b8037f583c6900aea25522a56126c9d32))
151
+
152
+ ## v1.2.0 (2025-07-11)
153
+
154
+ ### Features
155
+
156
+ * readdata: readSSF() renamed from readSession(), tests added with expected JSON output ([`e2197f6`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/e2197f6bcb032c1bc1a9a7435e024dda763228c4))
157
+
158
+ * readPDHmeta: routine for reading metadata part from .PDH and .SSF files ([`ea6a1d5`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/ea6a1d554f3763fc05022ae8e4e8909f0993cd43))
159
+
160
+ ### Testing
161
+
162
+ * readdata: path separator depends on platform ([`1b2866f`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/1b2866f13307c2cf2dedc59f36d7372442ddbfd8))
163
+
164
+ * readdata: testdata files and testing, using pathlib instead of old os.path ([`aeacfa4`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/aeacfa4a949d7293f2cd3ce5e3004fddf20ecc02))
165
+
130
166
  ## v1.1.0 (2025-07-10)
131
167
 
132
168
  ### 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.1.0.svg
18
- :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.1.0...main
17
+ .. |commits-since| image:: https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.2.1.svg
18
+ :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.2.1...main
19
19
  :alt: Commits since latest release
20
20
 
21
21
  .. |license| image:: https://img.shields.io/pypi/l/jupyter-analysis-tools.svg
@@ -65,9 +65,9 @@ https://BAMresearch.github.io/jupyter-analysis-tools
65
65
  Development
66
66
  ===========
67
67
 
68
- To run all the tests run::
68
+ Run all tests with::
69
69
 
70
- tox
70
+ tox -e py
71
71
 
72
72
  Note, to combine the coverage data from all the tox environments run:
73
73
 
@@ -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.1.0"
32
+ version = "1.2.1"
33
33
  release = version
34
34
  commit_id = None
35
35
  try:
@@ -1,12 +1,13 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # __init__.py
3
3
 
4
- __version__ = "1.1.0"
4
+ __version__ = "1.2.1"
5
5
 
6
6
  from .binning import reBin
7
7
  from .git import checkRepo, isNBstripoutActivated, isNBstripoutInstalled, isRepo
8
8
  from .readdata import readdata
9
9
  from .readdata import readdata as readPDH
10
+ from .readdata import readPDHmeta, readSSF
10
11
  from .utils import setLocaleUTF8
11
12
  from .widgets import PathSelector, showBoolStatus
12
13
 
@@ -0,0 +1,167 @@
1
+ # -*- coding: utf-8 -*-
2
+ # readdata.py
3
+
4
+ import warnings
5
+ import xml.etree.ElementTree as et
6
+ from pathlib import Path
7
+
8
+ import pandas as pd
9
+
10
+
11
+ def readdata(fpath, q_range=None, read_csv_args=None, print_filename=True):
12
+ """Read a datafile pandas Dataframe
13
+ extract a file_name
14
+ select q-range: q_min <= q <= q_max
15
+ """
16
+ fpath = Path(fpath)
17
+ if print_filename:
18
+ print(f"Reading file '{str(fpath)}'")
19
+ if read_csv_args is None:
20
+ read_csv_args = dict()
21
+ if "sep" not in read_csv_args:
22
+ read_csv_args.update(sep=r"\s+")
23
+ if "names" not in read_csv_args:
24
+ read_csv_args.update(names=("q", "I", "e"))
25
+ if "index_col" not in read_csv_args:
26
+ read_csv_args.update(index_col=False)
27
+ # print("f_read_data, read_csv_args:", read_csv_args) # for debugging
28
+
29
+ file_ext = fpath.suffix
30
+ if file_ext.lower() == ".pdh": # for PDH files
31
+ nrows = pd.read_csv(
32
+ fpath,
33
+ skiprows=2,
34
+ nrows=1,
35
+ usecols=[
36
+ 0,
37
+ ],
38
+ sep=r"\s+",
39
+ header=None,
40
+ ).values[0, 0]
41
+ read_csv_args.update(skiprows=5, nrows=nrows)
42
+ df = pd.read_csv(fpath, **read_csv_args)
43
+
44
+ # select q-range
45
+ if q_range is not None:
46
+ q_min, q_max = q_range
47
+ df = df[(df.q > q_min) & (df.q < q_max)]
48
+
49
+ filename = fpath.stem.split("[")[0]
50
+ return df, filename
51
+
52
+
53
+ def convertValue(val):
54
+ val = val.strip()
55
+ try:
56
+ return int(val)
57
+ except ValueError:
58
+ try:
59
+ return float(val)
60
+ except ValueError:
61
+ pass
62
+ return val
63
+
64
+
65
+ def xmlPDHToDict(root):
66
+ result = {}
67
+ stack = [(root, result)]
68
+ while stack:
69
+ elem, parentCont = stack.pop()
70
+ elemCont = {}
71
+ key = elem.attrib.pop("key", None)
72
+ idx = -1
73
+ if (
74
+ not len(list(elem)) and
75
+ not len(elem.attrib) and
76
+ not (elem.text and len(elem.text.strip()))
77
+ ):
78
+ continue # skip empty elements with a key only early
79
+ if elem.tag == "list":
80
+ elemCont = []
81
+ else: # add attributes & values to dict
82
+ # Attach text, if any
83
+ if elem.text and len(elem.text.strip()):
84
+ if elem.tag in ("value", "reference"):
85
+ elemCont["value"] = convertValue(elem.text)
86
+ else:
87
+ elemCont["#text"] = convertValue(elem.text)
88
+ # Attach attributes, if any
89
+ if elem.attrib:
90
+ elemCont.update(
91
+ {k: convertValue(v) for k, v in elem.attrib.items() if len(v.strip())}
92
+ )
93
+ if key == "unit" and "value" in elemCont: # fix some units
94
+ elemCont["value"] = elemCont["value"].replace("_", "")
95
+ if "unit" in elemCont:
96
+ elemCont["unit"] = elemCont["unit"].replace("_", "")
97
+ # reduce the extracted dict&attributes
98
+ idx = elemCont.get("index", -1) # insert last/append if no index given
99
+ value = elemCont.get("value", None)
100
+ if value is not None and (
101
+ len(elemCont) == 1 or (len(elemCont) == 2 and "index" in elemCont)
102
+ ):
103
+ elemCont = value # contains value only
104
+ parentKey = elem.tag
105
+ if key is not None and parentKey in ("list", "value", "group"):
106
+ # skip one level in hierarchy for these generic containers
107
+ parentKey = key
108
+ key = None
109
+ try:
110
+ if isinstance(parentCont, list):
111
+ parentCont.insert(idx, elemCont)
112
+ elif parentKey not in parentCont: # add as new list
113
+ if key is None: # make a list
114
+ parentCont[parentKey] = elemCont
115
+ else: # have a key
116
+ parentCont[parentKey] = {key: elemCont}
117
+ else: # parentKey exists already
118
+ if (
119
+ not isinstance(parentCont[parentKey], list) and
120
+ not isinstance(parentCont[parentKey], dict)
121
+ ):
122
+ # if its a plain value before, make a list out of it and append in next step
123
+ parentCont[parentKey] = [parentCont[parentKey]]
124
+ if isinstance(parentCont[parentKey], list):
125
+ parentCont[parentKey].append(elemCont)
126
+ elif key is not None:
127
+ parentCont[parentKey].update({key: elemCont})
128
+ else: # key is None
129
+ parentCont[parentKey].update(elemCont)
130
+ except AttributeError:
131
+ raise
132
+ # reversed for correct order
133
+ stack += [(child, elemCont) for child in reversed(list(elem))]
134
+ # fix some entry values, weird Anton Paar PDH format
135
+ try:
136
+ oldts = result["fileinfo"]["parameter"]["DateTime"]["value"]
137
+ # timestamp seems to be based on around 2009-01-01 (a day give or take)
138
+ delta = ((39 * 365 + 10) * 24 * 3600)
139
+ # make it compatible to datetime.datetime routines
140
+ result["fileinfo"]["parameter"]["DateTime"]["value"] = oldts + delta
141
+ except KeyError:
142
+ pass
143
+ return result
144
+
145
+
146
+ def readPDHmeta(fp):
147
+ fp = Path(fp)
148
+ if fp.suffix.lower() != ".pdh":
149
+ warnings.warn("readPDHmeta() supports .pdh files only!")
150
+ return # for PDH files
151
+ lines = ""
152
+ with open(fp) as fd:
153
+ lines = fd.readlines()
154
+ nrows = int(lines[2].split()[0])
155
+ xml = "".join(lines[nrows + 5 :])
156
+ return xmlPDHToDict(et.fromstring(xml))
157
+
158
+
159
+ def readSSF(fp):
160
+ fp = Path(fp)
161
+ if fp.suffix.lower() != ".ssf":
162
+ warnings.warn("readSession() supports .ssf files only!")
163
+ return # for PDH files
164
+ data = ""
165
+ with open(fp, encoding="utf-8-sig") as fd:
166
+ data = fd.read()
167
+ return xmlPDHToDict(et.fromstring(data))
@@ -89,7 +89,8 @@ def addEnvScriptsToPATH():
89
89
  """Prepends the *Scripts* directory of the current Python environment base directory to systems
90
90
  PATH variable.
91
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.
92
+ It is intended for Conda (Miniforge) environments on Windows that do not have this in their PATH
93
+ environment variable, causing them to miss many commands provided from this location.
93
94
  """
94
95
  envPath = [p for p in sys.path if p.endswith("Lib")]
95
96
  if not envPath:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jupyter-analysis-tools
3
- Version: 1.1.0
3
+ Version: 1.2.1
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.1.0.svg
57
- :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.1.0...main
56
+ .. |commits-since| image:: https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.2.1.svg
57
+ :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.2.1...main
58
58
  :alt: Commits since latest release
59
59
 
60
60
  .. |license| image:: https://img.shields.io/pypi/l/jupyter-analysis-tools.svg
@@ -104,9 +104,9 @@ https://BAMresearch.github.io/jupyter-analysis-tools
104
104
  Development
105
105
  ===========
106
106
 
107
- To run all the tests run::
107
+ Run all tests with::
108
108
 
109
- tox
109
+ tox -e py
110
110
 
111
111
  Note, to combine the coverage data from all the tox environments run:
112
112
 
@@ -127,6 +127,42 @@ Note, to combine the coverage data from all the tox environments run:
127
127
 
128
128
  # CHANGELOG
129
129
 
130
+ ## v1.2.1 (2025-07-11)
131
+
132
+ ### Bug fixes
133
+
134
+ * readme: trigger new version after style changes ([`8b2b5e9`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/8b2b5e93c0f24ae59afaa764abdc508e994946b4))
135
+
136
+ ### Code style
137
+
138
+ * __init__: imports format ([`6f07790`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/6f07790a04e43736b1c0fbce0eac54d0b661a7cf))
139
+
140
+ * utils: satisfy flake8 ([`9657474`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/9657474e94a4d9887c4a6b653e0ffa403e666d02))
141
+
142
+ * readdata: satisfy flake8 ([`36bf6e8`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/36bf6e8be67a2ebd345c5557c2352710bcebed82))
143
+
144
+ ### Continuous integration
145
+
146
+ * workflow: publish only if the docs are good ([`a663ed3`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/a663ed3d1fd87079a4fd7cf419132a129280a562))
147
+
148
+ ### Testing
149
+
150
+ * utils: fix imports ([`ddd5369`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/ddd5369b8037f583c6900aea25522a56126c9d32))
151
+
152
+ ## v1.2.0 (2025-07-11)
153
+
154
+ ### Features
155
+
156
+ * readdata: readSSF() renamed from readSession(), tests added with expected JSON output ([`e2197f6`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/e2197f6bcb032c1bc1a9a7435e024dda763228c4))
157
+
158
+ * readPDHmeta: routine for reading metadata part from .PDH and .SSF files ([`ea6a1d5`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/ea6a1d554f3763fc05022ae8e4e8909f0993cd43))
159
+
160
+ ### Testing
161
+
162
+ * readdata: path separator depends on platform ([`1b2866f`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/1b2866f13307c2cf2dedc59f36d7372442ddbfd8))
163
+
164
+ * readdata: testdata files and testing, using pathlib instead of old os.path ([`aeacfa4`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/aeacfa4a949d7293f2cd3ce5e3004fddf20ecc02))
165
+
130
166
  ## v1.1.0 (2025-07-10)
131
167
 
132
168
  ### Bug fixes
@@ -46,5 +46,11 @@ src/jupyter_analysis_tools.egg-info/dependency_links.txt
46
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
+ testdata/2015-03-20-Silica.ssf.json
50
+ testdata/2015-03-20-Silica.ssfz
51
+ testdata/S2842 water.json
52
+ testdata/S2842 water.pdh
53
+ testdata/S2843[9].pdh
54
+ tests/readdata.py
49
55
  tests/requirements.txt
50
56
  tests/utils.py