jupyter-analysis-tools 1.4.3__py3-none-any.whl → 1.5.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.
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # __init__.py
3
3
 
4
- __version__ = "1.4.3"
4
+ __version__ = "1.5.1"
5
5
 
6
6
  from .binning import reBin
7
7
  from .git import checkRepo, isNBstripoutActivated, isNBstripoutInstalled, isRepo
@@ -0,0 +1,57 @@
1
+ # -*- coding: utf-8 -*-
2
+ # ssfz2json.py
3
+
4
+ import argparse
5
+ import json
6
+ import sys
7
+ from pathlib import Path
8
+
9
+ from jupyter_analysis_tools.readdata import readSSFZ
10
+
11
+
12
+ def main():
13
+ parser = argparse.ArgumentParser(
14
+ description="""
15
+ Reads and parses the embedded metadata of a .SSFZ file created by Anton Paar SAXSquant
16
+ software, converts it to JSON format and outputs it to <stdout>.
17
+ An output file path for the JSON data can be provided by optional argument.
18
+ """
19
+ )
20
+ parser.add_argument(
21
+ "ssfzPath",
22
+ type=lambda p: Path(p).absolute(),
23
+ help="Path of the input .SSFZ file to read.",
24
+ )
25
+ parser.add_argument(
26
+ "-o",
27
+ "--out",
28
+ nargs="?",
29
+ default="stdout",
30
+ help=(
31
+ "Output file path to write the JSON data to. If the filename is omitted, "
32
+ "it is derived from the input file name by adding the .json suffix."
33
+ ),
34
+ )
35
+ args = parser.parse_args()
36
+ # print(args)
37
+ if not args.ssfzPath.is_file():
38
+ print(f"Provided file '{args.ssfzPath}' not found!")
39
+ return 1
40
+ data = readSSFZ(args.ssfzPath)
41
+ json_args = dict(sort_keys=True, indent=2)
42
+ if args.out == "stdout":
43
+ print(json.dumps(data, **json_args))
44
+ else:
45
+ if args.out is None:
46
+ args.out = args.ssfzPath.with_suffix(args.ssfzPath.suffix + ".json")
47
+ if not Path(args.out).parent.is_dir():
48
+ print(f"Directory of provided output file '{args.out}' does not exist!")
49
+ return 1
50
+ with open(args.out, "w") as fd:
51
+ json.dump(data, fd, **json_args)
52
+ print(f"Wrote '{args.out}'.")
53
+ return 0
54
+
55
+
56
+ if __name__ == "__main__":
57
+ sys.exit(main())
@@ -0,0 +1,54 @@
1
+ # -*- coding: utf-8 -*-
2
+ # ssfz2json.py
3
+
4
+ import argparse
5
+ import difflib
6
+ import json
7
+ import sys
8
+ from pathlib import Path
9
+
10
+ from jupyter_analysis_tools.readdata import readSSFZ
11
+
12
+
13
+ def main():
14
+ parser = argparse.ArgumentParser(
15
+ description="""
16
+ Reads and parses the embedded metadata of two .SSFZ files created by Anton Paar
17
+ SAXSquant software, converts them to JSON format and performs a diff-like comparison
18
+ which is output on <stdout>.
19
+ """
20
+ )
21
+ parser.add_argument(
22
+ "fromfile",
23
+ type=lambda p: Path(p).absolute(),
24
+ help="Path of the first .SSFZ file to compare.",
25
+ )
26
+ parser.add_argument(
27
+ "tofile",
28
+ type=lambda p: Path(p).absolute(),
29
+ help="Path of the second .SSFZ file to compare to.",
30
+ )
31
+ json_args = dict(sort_keys=True, indent=2)
32
+ args = parser.parse_args()
33
+ # print(args)
34
+ if not args.fromfile.is_file():
35
+ print(f"Provided file '{args.fromfile}' not found!")
36
+ return 1
37
+ if not args.tofile.is_file():
38
+ print(f"Provided file '{args.tofile}' not found!")
39
+ return 1
40
+ olddata = readSSFZ(args.fromfile)
41
+ newdata = readSSFZ(args.tofile)
42
+ diff = difflib.unified_diff(
43
+ json.dumps(olddata, **json_args).splitlines(keepends=True),
44
+ json.dumps(newdata, **json_args).splitlines(keepends=True),
45
+ fromfile=str(args.fromfile),
46
+ tofile=str(args.tofile),
47
+ )
48
+ for line in diff:
49
+ print(line, end="")
50
+ return 0
51
+
52
+
53
+ if __name__ == "__main__":
54
+ sys.exit(main())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jupyter-analysis-tools
3
- Version: 1.4.3
3
+ Version: 1.5.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.3)
38
+ # Jupyter Analysis Tools (v1.5.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.3.svg)](https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.4.3...main)
41
+ [![Commits since latest release](https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.5.1.svg)](https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.5.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,26 @@ are installed:
97
97
 
98
98
  # CHANGELOG
99
99
 
100
+ ## v1.5.1 (2025-08-04)
101
+
102
+ ### Bug fixes
103
+
104
+ * **readSSFZ**: split in two: ssfz2json for converting, ssfz_compare for diff-like compare ([`e8b24fe`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/e8b24fe796430bb4b09fa23dcd204e6162051f79))
105
+
106
+ ## v1.5.0 (2025-08-04)
107
+
108
+ ### Bug fixes
109
+
110
+ * **readSSFZ**: rename command readSSFZ -> ssfz2json for avoiding name collision with function in readdata module ([`dde1d10`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/dde1d109b70de0cd0cb712cfc4f19a3be2cbd880))
111
+
112
+ ### Features
113
+
114
+ * **readdata**: jupyter_analysis_tools.readSSFZ cmdline tool to convert .SSFZ to .JSON and diff-compare .SSFZ files (their metadata) ([`46dc633`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/46dc6338052a9dd875326d2a38cc5b6621439270))
115
+
116
+ ### Refactoring
117
+
118
+ * **utils**: formatting ([`b23f195`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/b23f1957149a9ae77a28f330eba3249d3fe3d2e5))
119
+
100
120
  ## v1.4.3 (2025-08-01)
101
121
 
102
122
  ### Bug fixes
@@ -1,4 +1,4 @@
1
- jupyter_analysis_tools/__init__.py,sha256=ZWwqIRGKVRxOwNMzr6UyicWL5Y9elQGg373dGP1Mq08,398
1
+ jupyter_analysis_tools/__init__.py,sha256=wJgXbkvBGUcYsY4GmME-p9uQjFMk9TvzAfbOjOl_1zc,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,14 @@ 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/ssfz2json.py,sha256=aEJo8No_PZ021RJGqDz9g2uZVh9y2G-wNvUB7xMLOGs,1747
10
+ jupyter_analysis_tools/ssfz_compare.py,sha256=__6qXALyX5pdUBYSEjzNoVHa470QX8Cg_LASpahtAGI,1557
9
11
  jupyter_analysis_tools/utils.py,sha256=c8q2-0v7wEjJ_3w5YTZdjFSf-RP1gPUpMJpv5KUyilU,8800
10
12
  jupyter_analysis_tools/widgets.py,sha256=rA8qPvY9nS1OtykZwXtCTG29K-N_MYFVb5Aj8yK40_s,2996
11
- jupyter_analysis_tools-1.4.3.dist-info/licenses/AUTHORS.rst,sha256=-twUESsY0XqFQ0MIC0ylKhglNwL8lyHmGXriM3RF-2s,93
12
- jupyter_analysis_tools-1.4.3.dist-info/licenses/LICENSE,sha256=jRVl3hmCq0Qv1wifm-EelEKhFWecdoWdhcxSte4a1_c,1125
13
- jupyter_analysis_tools-1.4.3.dist-info/METADATA,sha256=mwfPFJK0SJL_HGSfjiLbtWfMclgyQufodabdsqhKgu0,44709
14
- jupyter_analysis_tools-1.4.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
- jupyter_analysis_tools-1.4.3.dist-info/top_level.txt,sha256=ei_0x-BF85FLoJ_h67ySwDFowtqus_gI4_0GR466PEU,23
16
- jupyter_analysis_tools-1.4.3.dist-info/RECORD,,
13
+ jupyter_analysis_tools-1.5.1.dist-info/licenses/AUTHORS.rst,sha256=-twUESsY0XqFQ0MIC0ylKhglNwL8lyHmGXriM3RF-2s,93
14
+ jupyter_analysis_tools-1.5.1.dist-info/licenses/LICENSE,sha256=jRVl3hmCq0Qv1wifm-EelEKhFWecdoWdhcxSte4a1_c,1125
15
+ jupyter_analysis_tools-1.5.1.dist-info/METADATA,sha256=hagcHmj9cDY740-W1ENigKPUMzIHNIX-CZzr2kCjh2Y,45652
16
+ jupyter_analysis_tools-1.5.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
+ jupyter_analysis_tools-1.5.1.dist-info/entry_points.txt,sha256=-LU146dufa_JTwarciGzC6bjsl8pqY_8Z49ODYQ4lPY,124
18
+ jupyter_analysis_tools-1.5.1.dist-info/top_level.txt,sha256=ei_0x-BF85FLoJ_h67ySwDFowtqus_gI4_0GR466PEU,23
19
+ jupyter_analysis_tools-1.5.1.dist-info/RECORD,,
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ ssfz-compare = jupyter_analysis_tools.ssfz_compare:main
3
+ ssfz2json = jupyter_analysis_tools.ssfz2json:main