jupyter-analysis-tools 1.6.0__py3-none-any.whl → 1.6.2__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.6.0"
4
+ __version__ = "1.6.2"
5
5
 
6
6
  from .binning import reBin
7
7
  from .git import checkRepo, isNBstripoutActivated, isNBstripoutInstalled, isRepo
@@ -16,6 +16,7 @@ class DataStore:
16
16
  _userspace = None
17
17
 
18
18
  def __init__(self, url, username=None):
19
+ self.url = url
19
20
  self.username = username
20
21
  if self.username is None:
21
22
  self.username = getpass.getuser()
@@ -52,13 +53,15 @@ class DataStore:
52
53
  def identifier(objects, code):
53
54
  return objects[objects.code == code].identifier.tolist()[0]
54
55
 
55
- def createProject(self, projectName, space, space_prefix=None):
56
- """Finds the requested project in the DataStore. If it does not exist,
57
- creates a new project with the given code in the given space."""
56
+ def createProject(self, projectName, space, spacePrefix=None):
57
+ """Finds the requested project in the DataStore.
58
+ Matching project names can be limited to a given *spacePrefix*.
59
+ If the project is not found, a new project with the given code in the given space
60
+ is created."""
58
61
  # get available projects, accessible by the current user
59
62
  projectsAvail = self.ds.get_projects()
60
- if space_prefix:
61
- projectsAvail = [prj for prj in projectsAvail if f"/{space_prefix}_" in prj.identifier]
63
+ if spacePrefix:
64
+ projectsAvail = [prj for prj in projectsAvail if f"/{spacePrefix}_" in prj.identifier]
62
65
  projects = [prj for prj in projectsAvail if prj.code == projectName]
63
66
  assert len(projects) <= 1, f"Multiple projects found for '{projectName}'"
64
67
  dsProject = None
@@ -108,23 +111,24 @@ class DataStore:
108
111
 
109
112
  def createObject(
110
113
  self,
111
- projectName,
114
+ projectName: str,
112
115
  collectionName: str = None,
113
- space=None,
116
+ space: str = None,
117
+ spacePrefix: str = None,
114
118
  objType: str = None,
115
119
  props: dict = None,
116
120
  ):
117
- dsProject = self.createProject(projectName, space)
121
+ dsProject = self.createProject(projectName, space, spacePrefix=spacePrefix)
118
122
  dsColl = None
119
123
  if collectionName is None: # collectionName is required
120
124
  return None
121
125
  dsColl = self.createCollection(collectionName, dsProject, defaultObjType=objType)
122
- obj = None
123
126
  obj = self.ds.get_objects(type=objType, where={"$name": props["$name"]}).objects
124
127
  if len(obj):
128
+ obj = obj[0]
125
129
  prefix = objType
126
130
  msg = "'{}' exists already in {}! Updating ...".format(
127
- obj[0].props["$name"], obj[0].project.identifier
131
+ obj.props["$name"], obj.project.identifier
128
132
  )
129
133
  warnings.warn_explicit(msg, UserWarning, prefix, 0)
130
134
  else: # does not exist yet
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jupyter-analysis-tools
3
- Version: 1.6.0
3
+ Version: 1.6.2
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
@@ -33,12 +33,13 @@ Requires-Dist: scipy
33
33
  Requires-Dist: pandas
34
34
  Requires-Dist: matplotlib
35
35
  Requires-Dist: ipywidgets
36
+ Requires-Dist: pybis
36
37
  Dynamic: license-file
37
38
 
38
- # Jupyter Analysis Tools (v1.6.0)
39
+ # Jupyter Analysis Tools (v1.6.2)
39
40
 
40
41
  [![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.6.0.svg)](https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.6.0...main)
42
+ [![Commits since latest release](https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.6.2.svg)](https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.6.2...main)
42
43
  [![License](https://img.shields.io/pypi/l/jupyter-analysis-tools.svg)](https://en.wikipedia.org/wiki/MIT_license)
43
44
  [![Supported versions](https://img.shields.io/pypi/pyversions/jupyter-analysis-tools.svg)](https://pypi.org/project/jupyter-analysis-tools)
44
45
  [![PyPI Wheel](https://img.shields.io/pypi/wheel/jupyter-analysis-tools.svg)](https://pypi.org/project/jupyter-analysis-tools#files)
@@ -97,6 +98,26 @@ are installed:
97
98
 
98
99
  # CHANGELOG
99
100
 
101
+ ## v1.6.2 (2025-09-22)
102
+
103
+ ### Bug fixes
104
+
105
+ * **Project**: add pybis dependency, for datastore module ([`80350c7`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/80350c7e3f662dd8fa52bbbf46c66104407d930a))
106
+
107
+ ### Code style
108
+
109
+ * **DataStore**: formatting ([`5afbd91`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/5afbd91080cabe4dea23102a7c9248dc2bee1af4))
110
+
111
+ ## v1.6.1 (2025-09-19)
112
+
113
+ ### Bug fixes
114
+
115
+ * **DataStore**: regression of handling of existing objects ([`28bd44c`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/28bd44cf019aea0203ad252fd434860f45a1e54a))
116
+
117
+ * **DataStore**: proper forwarding of spacePrefix for filtering relevant spaces ([`c4117f3`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/c4117f3b04b9f6237f6d8471bef2d76c379e6f11))
118
+
119
+ * **DataStore**: use the URL provided by constructor ([`fcc46fb`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/fcc46fb941006b489054dc492f433e62d77cb605))
120
+
100
121
  ## v1.6.0 (2025-09-19)
101
122
 
102
123
  ### Bug fixes
@@ -1,8 +1,8 @@
1
- jupyter_analysis_tools/__init__.py,sha256=VWuAiXeplG5lYNi9nghWma5zGHb5kEB5Bc5jJQKdoxk,398
1
+ jupyter_analysis_tools/__init__.py,sha256=JwtG0xXgEn0pt0bv4gyH57IlJrEYbAWLVUsWYeKDnak,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
5
- jupyter_analysis_tools/datastore.py,sha256=gT7CHviYM-mg2SzWxzt_O_Bf3LaZBmQkpnVvO-ePsGA,6723
5
+ jupyter_analysis_tools/datastore.py,sha256=JZqEr-taNmNLbkDOoaRVP5m-D9t4h1nUTcpkil-7H64,6903
6
6
  jupyter_analysis_tools/distrib.py,sha256=uyh2jXDdXR6dfd36CAoE5_psoFF0bfA6l1wletPD7Xo,16515
7
7
  jupyter_analysis_tools/git.py,sha256=mqSk5nnAFrmk1_2KFuKVrDWOkRbGbAQOq2N1DfxhNpg,2216
8
8
  jupyter_analysis_tools/plotting.py,sha256=X5Orrwiof-9MuYMKDJEXIlIt0K6bQT6ktFFjXKIVApI,1962
@@ -11,10 +11,10 @@ jupyter_analysis_tools/ssfz2json.py,sha256=aEJo8No_PZ021RJGqDz9g2uZVh9y2G-wNvUB7
11
11
  jupyter_analysis_tools/ssfz_compare.py,sha256=__6qXALyX5pdUBYSEjzNoVHa470QX8Cg_LASpahtAGI,1557
12
12
  jupyter_analysis_tools/utils.py,sha256=c8q2-0v7wEjJ_3w5YTZdjFSf-RP1gPUpMJpv5KUyilU,8800
13
13
  jupyter_analysis_tools/widgets.py,sha256=rA8qPvY9nS1OtykZwXtCTG29K-N_MYFVb5Aj8yK40_s,2996
14
- jupyter_analysis_tools-1.6.0.dist-info/licenses/AUTHORS.rst,sha256=-twUESsY0XqFQ0MIC0ylKhglNwL8lyHmGXriM3RF-2s,93
15
- jupyter_analysis_tools-1.6.0.dist-info/licenses/LICENSE,sha256=jRVl3hmCq0Qv1wifm-EelEKhFWecdoWdhcxSte4a1_c,1125
16
- jupyter_analysis_tools-1.6.0.dist-info/METADATA,sha256=YqOXmurH4dIt9raibtSJc1vizocXFKXpB390mLvtgiE,46226
17
- jupyter_analysis_tools-1.6.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
18
- jupyter_analysis_tools-1.6.0.dist-info/entry_points.txt,sha256=-LU146dufa_JTwarciGzC6bjsl8pqY_8Z49ODYQ4lPY,124
19
- jupyter_analysis_tools-1.6.0.dist-info/top_level.txt,sha256=ei_0x-BF85FLoJ_h67ySwDFowtqus_gI4_0GR466PEU,23
20
- jupyter_analysis_tools-1.6.0.dist-info/RECORD,,
14
+ jupyter_analysis_tools-1.6.2.dist-info/licenses/AUTHORS.rst,sha256=-twUESsY0XqFQ0MIC0ylKhglNwL8lyHmGXriM3RF-2s,93
15
+ jupyter_analysis_tools-1.6.2.dist-info/licenses/LICENSE,sha256=jRVl3hmCq0Qv1wifm-EelEKhFWecdoWdhcxSte4a1_c,1125
16
+ jupyter_analysis_tools-1.6.2.dist-info/METADATA,sha256=_Itm52bF7kuLUu4uUqNQBzeb4dNqH3NEGaZmd4bqBok,47210
17
+ jupyter_analysis_tools-1.6.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
18
+ jupyter_analysis_tools-1.6.2.dist-info/entry_points.txt,sha256=-LU146dufa_JTwarciGzC6bjsl8pqY_8Z49ODYQ4lPY,124
19
+ jupyter_analysis_tools-1.6.2.dist-info/top_level.txt,sha256=ei_0x-BF85FLoJ_h67ySwDFowtqus_gI4_0GR466PEU,23
20
+ jupyter_analysis_tools-1.6.2.dist-info/RECORD,,