datastock 0.0.30__tar.gz → 0.0.32__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 (45) hide show
  1. {datastock-0.0.30/datastock.egg-info → datastock-0.0.32}/PKG-INFO +12 -2
  2. {datastock-0.0.30 → datastock-0.0.32}/datastock/_class1_check.py +13 -12
  3. {datastock-0.0.30 → datastock-0.0.32}/datastock/_class3.py +8 -0
  4. {datastock-0.0.30 → datastock-0.0.32}/datastock/_plot_BvsA_as_distribution.py +2 -1
  5. {datastock-0.0.30 → datastock-0.0.32}/datastock/_plot_as_array.py +53 -11
  6. {datastock-0.0.30 → datastock-0.0.32}/datastock/_plot_as_mobile_lines.py +2 -1
  7. {datastock-0.0.30 → datastock-0.0.32}/datastock/_plot_as_profile1d.py +2 -1
  8. {datastock-0.0.30 → datastock-0.0.32}/datastock/version.py +1 -1
  9. {datastock-0.0.30 → datastock-0.0.32/datastock.egg-info}/PKG-INFO +12 -2
  10. {datastock-0.0.30 → datastock-0.0.32}/LICENSE +0 -0
  11. {datastock-0.0.30 → datastock-0.0.32}/MANIFEST.in +0 -0
  12. {datastock-0.0.30 → datastock-0.0.32}/README.md +0 -0
  13. {datastock-0.0.30 → datastock-0.0.32}/_updateversion.py +0 -0
  14. {datastock-0.0.30 → datastock-0.0.32}/datastock/_DataCollection_utils.py +0 -0
  15. {datastock-0.0.30 → datastock-0.0.32}/datastock/__init__.py +0 -0
  16. {datastock-0.0.30 → datastock-0.0.32}/datastock/_class.py +0 -0
  17. {datastock-0.0.30 → datastock-0.0.32}/datastock/_class0.py +0 -0
  18. {datastock-0.0.30 → datastock-0.0.32}/datastock/_class1.py +0 -0
  19. {datastock-0.0.30 → datastock-0.0.32}/datastock/_class1_binning.py +0 -0
  20. {datastock-0.0.30 → datastock-0.0.32}/datastock/_class1_compute.py +0 -0
  21. {datastock-0.0.30 → datastock-0.0.32}/datastock/_class1_domain.py +0 -0
  22. {datastock-0.0.30 → datastock-0.0.32}/datastock/_class1_interpolate.py +0 -0
  23. {datastock-0.0.30 → datastock-0.0.32}/datastock/_class1_uniformize.py +0 -0
  24. {datastock-0.0.30 → datastock-0.0.32}/datastock/_class2.py +0 -0
  25. {datastock-0.0.30 → datastock-0.0.32}/datastock/_class2_interactivity.py +0 -0
  26. {datastock-0.0.30 → datastock-0.0.32}/datastock/_direct_calls.py +0 -0
  27. {datastock-0.0.30 → datastock-0.0.32}/datastock/_export_dataframe.py +0 -0
  28. {datastock-0.0.30 → datastock-0.0.32}/datastock/_find_plateau.py +0 -0
  29. {datastock-0.0.30 → datastock-0.0.32}/datastock/_generic_check.py +0 -0
  30. {datastock-0.0.30 → datastock-0.0.32}/datastock/_generic_utils.py +0 -0
  31. {datastock-0.0.30 → datastock-0.0.32}/datastock/_plot_BvsA_as_distribution_check.py +0 -0
  32. {datastock-0.0.30 → datastock-0.0.32}/datastock/_plot_correlations.py +0 -0
  33. {datastock-0.0.30 → datastock-0.0.32}/datastock/_plot_misc.py +0 -0
  34. {datastock-0.0.30 → datastock-0.0.32}/datastock/_plot_text.py +0 -0
  35. {datastock-0.0.30 → datastock-0.0.32}/datastock/_saveload.py +0 -0
  36. {datastock-0.0.30 → datastock-0.0.32}/datastock/tests/__init__.py +0 -0
  37. {datastock-0.0.30 → datastock-0.0.32}/datastock/tests/output/__init__.py +0 -0
  38. {datastock-0.0.30 → datastock-0.0.32}/datastock/tests/test_01_DataStock.py +0 -0
  39. {datastock-0.0.30 → datastock-0.0.32}/datastock.egg-info/SOURCES.txt +0 -0
  40. {datastock-0.0.30 → datastock-0.0.32}/datastock.egg-info/dependency_links.txt +0 -0
  41. {datastock-0.0.30 → datastock-0.0.32}/datastock.egg-info/requires.txt +0 -0
  42. {datastock-0.0.30 → datastock-0.0.32}/datastock.egg-info/top_level.txt +0 -0
  43. {datastock-0.0.30 → datastock-0.0.32}/pyproject.toml +0 -0
  44. {datastock-0.0.30 → datastock-0.0.32}/setup.cfg +0 -0
  45. {datastock-0.0.30 → datastock-0.0.32}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: datastock
3
- Version: 0.0.30
3
+ Version: 0.0.32
4
4
  Summary: A python library for generic class and data handling
5
5
  Home-page: https://github.com/ToFuProject/datastock
6
6
  Author: Didier VEZINET
@@ -17,8 +17,18 @@ Classifier: Programming Language :: Python :: 3.8
17
17
  Classifier: Natural Language :: English
18
18
  Requires-Python: >=3.6
19
19
  Description-Content-Type: text/markdown
20
- Provides-Extra: dev
21
20
  License-File: LICENSE
21
+ Requires-Dist: numpy
22
+ Requires-Dist: scipy
23
+ Requires-Dist: matplotlib
24
+ Requires-Dist: astropy
25
+ Provides-Extra: dev
26
+ Requires-Dist: check-manifest; extra == "dev"
27
+ Requires-Dist: coverage; extra == "dev"
28
+ Requires-Dist: pytest; extra == "dev"
29
+ Requires-Dist: sphinx; extra == "dev"
30
+ Requires-Dist: sphinx-gallery; extra == "dev"
31
+ Requires-Dist: sphinx_bootstrap_theme; extra == "dev"
22
32
 
23
33
  [![Conda]( https://anaconda.org/conda-forge/datastock/badges/version.svg)](https://anaconda.org/conda-forge/datastock)
24
34
  [![](https://anaconda.org/conda-forge/datastock/badges/downloads.svg)](https://anaconda.org/conda-forge/datastock)
@@ -590,14 +590,14 @@ def _check_dref(
590
590
  isinstance(v0, dict)
591
591
  and (
592
592
  isinstance(v0.get('data'), (np.ndarray, list, tuple))
593
- or isinstance(v0.get('size'), (int, np.int_))
593
+ or isinstance(v0.get('size'), (int, np.integer))
594
594
  )
595
595
  )
596
596
  if not c0:
597
597
  msg = "v0 must be a dict with either 'data' or 'size'"
598
598
  raise Exception(msg)
599
599
 
600
- if isinstance(v0.get('size'), (int, np.int_)):
600
+ if isinstance(v0.get('size'), (int, np.integer)):
601
601
  dref[k0]['size'] = int(v0['size'])
602
602
 
603
603
  dref2[key] = dict(dref[k0])
@@ -1553,9 +1553,9 @@ def _set_param(
1553
1553
  # Set value
1554
1554
 
1555
1555
  # Check value - TBC: allow list
1556
- ltypes = [str, int, np.integer, float, np.floating, tuple]
1556
+ ltypes = (int, np.integer, float, str, tuple)
1557
1557
  lc = [
1558
- isinstance(value, tuple(ltypes)),
1558
+ isinstance(value, ltypes),
1559
1559
  isinstance(value, (list, tuple, np.ndarray))
1560
1560
  and distribute is False,
1561
1561
  isinstance(value, (list, tuple, np.ndarray))
@@ -1569,15 +1569,15 @@ def _set_param(
1569
1569
  ]
1570
1570
  if not (value is None or any(lc)):
1571
1571
  msg = (
1572
- """
1572
+ f"""
1573
1573
  Accepted types for value include:
1574
1574
  - None
1575
- - {}: common to all
1575
+ - {ltypes}: common to all
1576
1576
  - list, np.ndarray: key by key
1577
1577
  - dict of scalar / str
1578
1578
 
1579
- The length of value must match the selected keys ({})
1580
- """.format(ltypes, len(key))
1579
+ The length of value must match the selected keys ({len(key)})
1580
+ """
1581
1581
  )
1582
1582
  raise Exception(msg)
1583
1583
 
@@ -1690,7 +1690,7 @@ def _ind_tofrom_key(
1690
1690
  and (
1691
1691
  (ind.dtype == np.bool and ind.size == len(dd))
1692
1692
  or (
1693
- ind.dtype == np.int
1693
+ ind.dtype == int
1694
1694
  and np.all(np.isfinite(ind))
1695
1695
  and np.max(ind) <= len(dd)
1696
1696
  )
@@ -1798,10 +1798,11 @@ def _select(dd=None, dd_name=None, log=None, returnas=None, **kwdargs):
1798
1798
  # Get raw bool indices
1799
1799
 
1800
1800
  # Get list of accessible param
1801
- ltypes = (int, np.int_, float, np.float_)
1801
+ ltypes = (float, int, np.integer)
1802
1802
  lquant = [
1803
1803
  kk for kk in kwdargs.keys()
1804
- if any([isinstance(dd[k0][kk], ltypes) for k0 in dd.keys()])
1804
+ if any([isinstance(dd[k0][kk], ltypes) for k0 in dd.keys()
1805
+ ])
1805
1806
  ]
1806
1807
 
1807
1808
  # Prepare array of bool indices and populate
@@ -1973,7 +1974,7 @@ def _show_extract(dobj=None, lk=None):
1973
1974
  if isinstance(v0, float):
1974
1975
  lv0.append(f'{v0:.2e}')
1975
1976
  elif isinstance(v0, np.ndarray) and v0.size == 3:
1976
- if v0.dtype == np.float:
1977
+ if v0.dtype == float:
1977
1978
  lv0.append(
1978
1979
  np.array2string(
1979
1980
  v0,
@@ -38,6 +38,7 @@ class DataStock3(DataStock2):
38
38
  inverty=None,
39
39
  bck=None,
40
40
  interp=None,
41
+ show_commands=None,
41
42
  # figure-specific
42
43
  dax=None,
43
44
  dmargin=None,
@@ -72,6 +73,7 @@ class DataStock3(DataStock2):
72
73
  inverty=inverty,
73
74
  bck=bck,
74
75
  interp=interp,
76
+ show_commands=show_commands,
75
77
  # figure-specific
76
78
  dax=dax,
77
79
  dmargin=dmargin,
@@ -102,6 +104,7 @@ class DataStock3(DataStock2):
102
104
  rotation=None,
103
105
  inverty=None,
104
106
  bck=None,
107
+ show_commands=None,
105
108
  # figure-specific
106
109
  dax=None,
107
110
  dmargin=None,
@@ -131,6 +134,7 @@ class DataStock3(DataStock2):
131
134
  rotation=rotation,
132
135
  inverty=inverty,
133
136
  bck=bck,
137
+ show_commands=show_commands,
134
138
  # figure-specific
135
139
  dax=dax,
136
140
  dmargin=dmargin,
@@ -158,6 +162,7 @@ class DataStock3(DataStock2):
158
162
  lkeys=None,
159
163
  bstr_dict=None,
160
164
  rotation=None,
165
+ show_commands=None,
161
166
  # figure-specific
162
167
  dax=None,
163
168
  dmargin=None,
@@ -185,6 +190,7 @@ class DataStock3(DataStock2):
185
190
  lkeys=lkeys,
186
191
  bstr_dict=bstr_dict,
187
192
  rotation=rotation,
193
+ show_commands=show_commands,
188
194
  # figure-specific
189
195
  dax=dax,
190
196
  dmargin=dmargin,
@@ -247,6 +253,7 @@ class DataStock3(DataStock2):
247
253
  keyB=None,
248
254
  keyX=None,
249
255
  axis=None,
256
+ show_commands=None,
250
257
  # customization of scatter plot
251
258
  dlim=None,
252
259
  color_dict=None,
@@ -289,6 +296,7 @@ class DataStock3(DataStock2):
289
296
  keyB=keyB,
290
297
  keyX=keyX,
291
298
  axis=axis,
299
+ show_commands=show_commands,
292
300
  # customization of scatter plot
293
301
  dlim=dlim,
294
302
  color_dict=color_dict,
@@ -37,6 +37,7 @@ def plot_BvsA_as_distribution(
37
37
  keyB=None,
38
38
  keyX=None,
39
39
  axis=None,
40
+ show_commands=None,
40
41
  # customization of scatter plot
41
42
  dlim=None,
42
43
  dlim_logic=None,
@@ -471,7 +472,7 @@ def plot_BvsA_as_distribution(
471
472
  coll2.disconnect_old()
472
473
  coll2.connect()
473
474
 
474
- coll2.show_commands()
475
+ coll2.show_commands(verb=show_commands)
475
476
  return coll2
476
477
  else:
477
478
  return coll2, dgroup
@@ -65,6 +65,7 @@ def plot_as_array(
65
65
  inverty=None,
66
66
  bck=None,
67
67
  interp=None,
68
+ show_commands=None,
68
69
  # figure-specific
69
70
  dax=None,
70
71
  dmargin=None,
@@ -324,7 +325,7 @@ def plot_as_array(
324
325
  coll2.disconnect_old()
325
326
  coll2.connect()
326
327
 
327
- coll2.show_commands()
328
+ coll2.show_commands(verb=show_commands)
328
329
  return coll2
329
330
  else:
330
331
  return coll2, dgroup
@@ -412,10 +413,18 @@ def _check_keyXYZ(
412
413
  or _check_uniform_log(k0=k0, ddata=coll._ddata)
413
414
  ]
414
415
 
415
- keyX = _generic_check._check_var(
416
- keyX, 'keyX',
417
- allowed=lok,
418
- )
416
+ try:
417
+ keyX = _generic_check._check_var(
418
+ keyX, keyXstr,
419
+ allowed=lok,
420
+ )
421
+ except Exception as err:
422
+ msg = (
423
+ err.args[0]
424
+ + f"\nContraint on uniformity: {uniform}"
425
+ )
426
+ err.args = (msg,)
427
+ raise err
419
428
 
420
429
  refX = coll._ddata[keyX]['ref'][0]
421
430
 
@@ -425,6 +434,22 @@ def _check_keyXYZ(
425
434
  elif keyX in refs:
426
435
  keyX, refX = 'index', keyX
427
436
 
437
+ elif keyX == 'index':
438
+ if already is None:
439
+ refX = refs[dim_min - 1]
440
+ elif all([kk in already for kk in refs]): # TBC
441
+ # sameref
442
+ refX = refs[dim_min - 1]
443
+ msg = (
444
+ "Special case\n"
445
+ "\t- refs: {refs}\n"
446
+ f"\t- '{keyXstr}': {keyX}\n"
447
+ f"\t- already: {already}"
448
+ )
449
+ raise Exception(msg)
450
+ else:
451
+ refX = [kk for kk in refs if kk not in already][0]
452
+
428
453
  else:
429
454
  msg = (
430
455
  f"Arg '{keyXstr}' refers to unknow data:\n"
@@ -1132,8 +1157,13 @@ def plot_as_array_2d(
1132
1157
  ax2.set_ylabel('data')
1133
1158
  ax2.set_xlabel(labX)
1134
1159
 
1135
- ax1.set_xlim(ymin, ymax)
1136
- ax2.set_ylim(ymin, ymax)
1160
+ if np.isfinite(ymin):
1161
+ ax1.set_xlim(left=ymin)
1162
+ ax2.set_ylim(bottom=ymin)
1163
+ if np.isfinite(ymax):
1164
+ ax1.set_xlim(right=ymax)
1165
+ ax2.set_ylim(top=ymax)
1166
+
1137
1167
 
1138
1168
  # axes for text
1139
1169
  ax3 = fig.add_subplot(gs[:3, 3], frameon=False)
@@ -2065,7 +2095,10 @@ def _plot_as_array_3d_label_axes(
2065
2095
  ax.yaxis.set_label_position('right')
2066
2096
  ax.xaxis.set_label_position('top')
2067
2097
 
2068
- ax.set_xlim(ymin, ymax)
2098
+ if np.isfinite(ymin):
2099
+ ax.set_xlim(left=ymin)
2100
+ if np.isfinite(ymax):
2101
+ ax.set_xlim(right=ymax)
2069
2102
 
2070
2103
  # y text ticks
2071
2104
  if ystr:
@@ -2090,7 +2123,10 @@ def _plot_as_array_3d_label_axes(
2090
2123
  ax.set_ylabel('data')
2091
2124
  ax.set_xlabel(labX)
2092
2125
 
2093
- ax.set_ylim(ymin, ymax)
2126
+ if np.isfinite(ymin):
2127
+ ax.set_ylim(bottom=ymin)
2128
+ if np.isfinite(ymax):
2129
+ ax.set_ylim(top=ymax)
2094
2130
 
2095
2131
  # x text ticks
2096
2132
  if xstr:
@@ -2113,7 +2149,10 @@ def _plot_as_array_3d_label_axes(
2113
2149
  ax.set_ylabel('data')
2114
2150
  ax.set_xlabel(labZ)
2115
2151
 
2116
- ax.set_ylim(ymin, ymax)
2152
+ if np.isfinite(ymin):
2153
+ ax.set_ylim(bottom=ymin)
2154
+ if np.isfinite(ymax):
2155
+ ax.set_ylim(top=ymax)
2117
2156
 
2118
2157
  # z text ticks
2119
2158
  if zstr:
@@ -2901,7 +2940,10 @@ def _plot_as_array_4d_label_axes(
2901
2940
  ax.yaxis.set_label_position('right')
2902
2941
  ax.xaxis.set_label_position('top')
2903
2942
 
2904
- ax.set_xlim(ymin, ymax)
2943
+ if np.isfinite(ymin):
2944
+ ax.set_xlim(left=ymin)
2945
+ if np.isfinite(ymax):
2946
+ ax.set_xlim(right=ymax)
2905
2947
 
2906
2948
  # y text ticks
2907
2949
  if ystr:
@@ -58,6 +58,7 @@ def plot_as_mobile_lines(
58
58
  lkeys=None,
59
59
  bstr_dict=None,
60
60
  rotation=None,
61
+ show_commands=None,
61
62
  # figure-specific
62
63
  dax=None,
63
64
  dmargin=None,
@@ -184,7 +185,7 @@ def plot_as_mobile_lines(
184
185
  coll2.disconnect_old()
185
186
  coll2.connect()
186
187
 
187
- coll2.show_commands()
188
+ coll2.show_commands(verb=show_commands)
188
189
  return coll2
189
190
  else:
190
191
  return coll2, dgroup
@@ -62,6 +62,7 @@ def plot_as_profile1d(
62
62
  rotation=None,
63
63
  inverty=None,
64
64
  bck=None,
65
+ show_commands=None,
65
66
  # figure-specific
66
67
  dax=None,
67
68
  dmargin=None,
@@ -173,7 +174,7 @@ def plot_as_profile1d(
173
174
  coll2.disconnect_old()
174
175
  coll2.connect()
175
176
 
176
- coll2.show_commands()
177
+ coll2.show_commands(verb=show_commands)
177
178
  return coll2
178
179
  else:
179
180
  return coll2, dgroup
@@ -1,2 +1,2 @@
1
1
  # Do not edit, pipeline versioning governed by git tags!
2
- __version__ = '0.0.30'
2
+ __version__ = '0.0.32'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: datastock
3
- Version: 0.0.30
3
+ Version: 0.0.32
4
4
  Summary: A python library for generic class and data handling
5
5
  Home-page: https://github.com/ToFuProject/datastock
6
6
  Author: Didier VEZINET
@@ -17,8 +17,18 @@ Classifier: Programming Language :: Python :: 3.8
17
17
  Classifier: Natural Language :: English
18
18
  Requires-Python: >=3.6
19
19
  Description-Content-Type: text/markdown
20
- Provides-Extra: dev
21
20
  License-File: LICENSE
21
+ Requires-Dist: numpy
22
+ Requires-Dist: scipy
23
+ Requires-Dist: matplotlib
24
+ Requires-Dist: astropy
25
+ Provides-Extra: dev
26
+ Requires-Dist: check-manifest; extra == "dev"
27
+ Requires-Dist: coverage; extra == "dev"
28
+ Requires-Dist: pytest; extra == "dev"
29
+ Requires-Dist: sphinx; extra == "dev"
30
+ Requires-Dist: sphinx-gallery; extra == "dev"
31
+ Requires-Dist: sphinx_bootstrap_theme; extra == "dev"
22
32
 
23
33
  [![Conda]( https://anaconda.org/conda-forge/datastock/badges/version.svg)](https://anaconda.org/conda-forge/datastock)
24
34
  [![](https://anaconda.org/conda-forge/datastock/badges/downloads.svg)](https://anaconda.org/conda-forge/datastock)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes