LLNL-PyDV 3.4.3__tar.gz → 3.6.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.
@@ -1,8 +1,7 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: LLNL-PyDV
3
- Version: 3.4.3
3
+ Version: 3.6.1
4
4
  Summary: PyDV: Python Data Visualizer
5
- Home-page: https://github.com/LLNL/PyDV
6
5
  License: BSD
7
6
  Author: Sarah El-Jurf
8
7
  Author-email: eljurf1@llnl.gov
@@ -24,6 +23,7 @@ Classifier: Programming Language :: Python :: 3.9
24
23
  Classifier: Programming Language :: Python :: 3.10
25
24
  Classifier: Programming Language :: Python :: 3.11
26
25
  Classifier: Programming Language :: Python :: 3.12
26
+ Classifier: Programming Language :: Python :: 3.13
27
27
  Classifier: Topic :: Scientific/Engineering
28
28
  Classifier: Topic :: Scientific/Engineering :: Mathematics
29
29
  Requires-Dist: PyQt5
@@ -35,28 +35,43 @@ Requires-Dist: scipy
35
35
  Project-URL: Bug Tracker, https://github.com/LLNL/PyDV/issues
36
36
  Project-URL: Documentation, https://pydv.readthedocs.io/en/latest/
37
37
  Project-URL: Discussions, https://github.com/LLNL/PyDV/discussions
38
+ Project-URL: Homepage, https://github.com/LLNL/PyDV
38
39
  Description-Content-Type: text/markdown
39
40
 
40
- ## PyDV
41
+ # PyDV
41
42
 
42
43
  A 1D graphics and data analysis tool, heavily based on the ULTRA plotting tool.
43
44
 
44
- ### PyDV Importable Interface Module ###
45
+ ## PyDV Importable Interface Module ###
45
46
  You can now call most of PyDV's functionality from within a Python script. Below is an example of how to do this.
46
-
47
- import sys
48
- sys.path.append("/usr/gapps/pydv/current")
49
- import pydvpy as pydvif
50
47
 
51
- curves = list()
52
- curves.append(pydvif.span(1,10,6))
53
- pydvif.save('myFile.txt', curves)
54
-
55
- ## Documentation
48
+ ### Most Current
49
+
50
+ ```
51
+ import sys
52
+ sys.path.append("/usr/gapps/pydv/current")
53
+ import pydvpy
54
+
55
+ curves = list()
56
+ curves.append(pydvpy.span(1,10,6))
57
+ pydvpy.save('myFile.txt', curves)
58
+ ```
59
+
60
+ ### PyPi or WEAVE Environment
61
+
62
+ ```
63
+ from pydv import pydvpy
64
+
65
+ curves = list()
66
+ curves.append(pydvpy.span(1,10,6))
67
+ pydvpy.save('myFile.txt', curves)
68
+ ```
69
+
70
+ # Documentation
56
71
 
57
72
  [PyDV Users Manual](https://pydv.readthedocs.io/en/latest/) [![Documentation Status](https://readthedocs.org/projects/pydv/badge/?version=latest)](https://pydv.readthedocs.io/en/latest/?badge=latest)
58
73
 
59
- ## License
74
+ # License
60
75
 
61
76
  PyDV is distributed under the terms of the [BSD-3 License](LICENSE)
62
77
 
@@ -1,23 +1,37 @@
1
- ## PyDV
1
+ # PyDV
2
2
 
3
3
  A 1D graphics and data analysis tool, heavily based on the ULTRA plotting tool.
4
4
 
5
- ### PyDV Importable Interface Module ###
5
+ ## PyDV Importable Interface Module ###
6
6
  You can now call most of PyDV's functionality from within a Python script. Below is an example of how to do this.
7
-
8
- import sys
9
- sys.path.append("/usr/gapps/pydv/current")
10
- import pydvpy as pydvif
11
7
 
12
- curves = list()
13
- curves.append(pydvif.span(1,10,6))
14
- pydvif.save('myFile.txt', curves)
15
-
16
- ## Documentation
8
+ ### Most Current
9
+
10
+ ```
11
+ import sys
12
+ sys.path.append("/usr/gapps/pydv/current")
13
+ import pydvpy
14
+
15
+ curves = list()
16
+ curves.append(pydvpy.span(1,10,6))
17
+ pydvpy.save('myFile.txt', curves)
18
+ ```
19
+
20
+ ### PyPi or WEAVE Environment
21
+
22
+ ```
23
+ from pydv import pydvpy
24
+
25
+ curves = list()
26
+ curves.append(pydvpy.span(1,10,6))
27
+ pydvpy.save('myFile.txt', curves)
28
+ ```
29
+
30
+ # Documentation
17
31
 
18
32
  [PyDV Users Manual](https://pydv.readthedocs.io/en/latest/) [![Documentation Status](https://readthedocs.org/projects/pydv/badge/?version=latest)](https://pydv.readthedocs.io/en/latest/?badge=latest)
19
33
 
20
- ## License
34
+ # License
21
35
 
22
36
  PyDV is distributed under the terms of the [BSD-3 License](LICENSE)
23
37
 
@@ -66,80 +66,124 @@ from scipy import interpolate, integrate
66
66
 
67
67
  class Curve(object):
68
68
 
69
- name = ''
70
- filename = ''
71
- record_id = ''
72
- xlabel = ''
73
- ylabel = ''
74
- title = ''
75
- plotname = ''
76
- color = ''
77
- edited = False
78
- scatter = False
79
- linespoints = False
80
- linewidth = None
81
- linestyle = '-'
82
- drawstyle = 'default'
83
- dashes = None
84
- hidden = False
85
- x = np.empty(0)
86
- y = np.empty(0)
87
- ebar = None # errorbar
88
- erange = None # errorrange
89
- marker = '.' # Use matplotlib markers when setting directly
90
- markerstyle = None
91
- markersize = 3
92
- markerfacecolor = None
93
- markeredgecolor = None
94
- plotprecedence = 0
95
- legend_show = True
96
-
97
- def __init__(self, filename='', name='', record_id='', xlabel='', ylabel='', title='',
98
- step=False, xticks_labels=None):
99
- self.filename = filename
69
+ def __init__(self,
70
+ x=np.empty(0),
71
+ y=np.empty(0),
72
+ name='',
73
+ filename='',
74
+ xlabel='',
75
+ ylabel='',
76
+ title='',
77
+ record_id='',
78
+ step=False,
79
+ xticks_labels=None,
80
+ plotname='',
81
+ color='',
82
+ edited=False,
83
+ scatter=False,
84
+ linespoints=False,
85
+ linewidth=None,
86
+ linestyle='-',
87
+ drawstyle='default',
88
+ dashes=None,
89
+ hidden=False,
90
+ ebar=None, # errorbar
91
+ erange=None, # errorrange
92
+ marker='.', # Use matplotlib markers when setting directly
93
+ markerstyle=None,
94
+ markersize=3,
95
+ markerfacecolor=None,
96
+ markeredgecolor=None,
97
+ plotprecedence=0,
98
+ legend_show=True,
99
+ math_interp_left=None,
100
+ math_interp_right=None,
101
+ math_interp_period=None):
102
+ self.x = np.array(x, dtype=float)
103
+ self.y = np.array(y, dtype=float)
100
104
  self.name = name
101
- self.record_id = record_id
105
+ self.filename = filename
102
106
  self.xlabel = xlabel
103
107
  self.ylabel = ylabel
104
108
  self.title = title
109
+ self.record_id = record_id
105
110
  self.step = step
106
111
  self.xticks_labels = xticks_labels
112
+ self.plotname = plotname
113
+ self.color = color
114
+ self.edited = edited
115
+ self.scatter = scatter
116
+ self.linespoints = linespoints
117
+ self.linewidth = linewidth
118
+ self.linestyle = linestyle
119
+ self.drawstyle = drawstyle
120
+ self.dashes = dashes
121
+ self.hidden = hidden
122
+ self.ebar = ebar
123
+ self.erange = erange
124
+ self.marker = marker
125
+ self.markerstyle = markerstyle
126
+ self.markersize = markersize
127
+ self.markerfacecolor = markerfacecolor
128
+ self.markeredgecolor = markeredgecolor
129
+ self.plotprecedence = plotprecedence
130
+ self.legend_show = legend_show
131
+ self.math_interp_left = math_interp_left
132
+ self.math_interp_right = math_interp_right
133
+ self.math_interp_period = math_interp_period
134
+
135
+ # Other attributes
136
+ self._original_name = name
107
137
 
108
138
  def __add__(a, b):
109
- c = Curve('', '')
139
+ c = Curve()
110
140
  c.drawstyle = a.drawstyle
111
141
  c.plotname = str(a.plotname + ' + ' + b.plotname + ' ').strip(' ')
112
- ia, ib = getinterp(a, b)
142
+ ia, ib = getinterp(a, b,
143
+ a.math_interp_left, a.math_interp_right, a.math_interp_period,
144
+ b.math_interp_left, b.math_interp_right, b.math_interp_period)
113
145
  if ia.x is not None and ib.x is not None:
114
146
  c.x = ia.x
115
147
  c.y = ia.y + ib.y
148
+ c.math_interp_left = 0
149
+ c.math_interp_right = 0
116
150
  return c
117
151
 
118
152
  def __sub__(a, b):
119
- c = Curve('', '')
153
+ c = Curve()
120
154
  c.drawstyle = a.drawstyle
121
155
  c.plotname = str(a.plotname + ' - ' + b.plotname + ' ').strip(' ')
122
- ia, ib = getinterp(a, b)
156
+ ia, ib = getinterp(a, b,
157
+ a.math_interp_left, a.math_interp_right, a.math_interp_period,
158
+ b.math_interp_left, b.math_interp_right, b.math_interp_period)
123
159
  if ia.x is not None and ib.x is not None:
124
160
  c.x = ia.x
125
161
  c.y = ia.y - ib.y
162
+ c.math_interp_left = 0
163
+ c.math_interp_right = 0
126
164
  return c
127
165
 
128
166
  def __mul__(a, b):
129
- c = Curve('', '')
167
+ c = Curve()
130
168
  c.drawstyle = a.drawstyle
131
169
  c.plotname = str(a.plotname + ' * ' + b.plotname + ' ').strip(' ')
132
- ia, ib = getinterp(a, b)
170
+ ia, ib = getinterp(a, b,
171
+ a.math_interp_left, a.math_interp_right, a.math_interp_period,
172
+ b.math_interp_left, b.math_interp_right, b.math_interp_period)
133
173
  if ia.x is not None and ib.x is not None:
134
174
  c.x = ia.x
135
175
  c.y = ia.y * ib.y
176
+ c.math_interp_left = 0
177
+ c.math_interp_right = 0
136
178
  return c
137
179
 
138
180
  def __div__(a, b):
139
- c = Curve('', '')
181
+ c = Curve()
140
182
  c.drawstyle = a.drawstyle
141
183
  c.plotname = str(a.plotname + ' / ' + b.plotname + ' ').strip(' ')
142
- ia, ib = getinterp(a, b)
184
+ ia, ib = getinterp(a, b,
185
+ a.math_interp_left, a.math_interp_right, a.math_interp_period,
186
+ b.math_interp_left, b.math_interp_right, b.math_interp_period)
143
187
  if ia.x is not None and ib.x is not None:
144
188
  c.x = ia.x
145
189
 
@@ -150,14 +194,18 @@ class Curve(object):
150
194
  c.y = ia.y / ib.y
151
195
  for idx in zero_indices:
152
196
  c.y[idx] = float(sys.maxsize)
197
+ c.math_interp_left = 0
198
+ c.math_interp_right = 0
153
199
 
154
200
  return c
155
201
 
156
202
  def __truediv__(a, b):
157
- c = Curve('', '')
203
+ c = Curve()
158
204
  c.drawstyle = a.drawstyle
159
205
  c.plotname = str(a.plotname + ' / ' + b.plotname + ' ').strip(' ')
160
- ia, ib = getinterp(a, b)
206
+ ia, ib = getinterp(a, b,
207
+ a.math_interp_left, a.math_interp_right, a.math_interp_period,
208
+ b.math_interp_left, b.math_interp_right, b.math_interp_period)
161
209
  if ia.x is not None and ib.x is not None:
162
210
  c.x = ia.x
163
211
 
@@ -168,11 +216,13 @@ class Curve(object):
168
216
  c.y = ia.y / ib.y
169
217
  for idx in zero_indices:
170
218
  c.y[idx] = float(sys.maxsize)
219
+ c.math_interp_left = 0
220
+ c.math_interp_right = 0
171
221
 
172
222
  return c
173
223
 
174
224
  def __pow__(a, b):
175
- c = Curve('', '')
225
+ c = Curve()
176
226
  c.drawstyle = a.drawstyle
177
227
  c.plotname = str(a.plotname + '^' + str(b)).strip(' ')
178
228
  c.x = np.array(a.x)
@@ -183,7 +233,7 @@ class Curve(object):
183
233
  return c
184
234
 
185
235
  def __neg__(a):
186
- c = Curve('', '')
236
+ c = Curve()
187
237
  c.drawstyle = a.drawstyle
188
238
  c.plotname = str('-' + a.plotname)
189
239
  c.x = np.array(a.x)
@@ -195,27 +245,38 @@ class Curve(object):
195
245
  Return a new copy of the curve object
196
246
  """
197
247
 
198
- c = Curve(self.filename, self.name, self.record_id, self.xlabel, self.ylabel, self.title)
199
- c.plotname = self.plotname
200
- c.x = np.array(self.x)
201
- c.y = np.array(self.y)
202
- c.color = self.color
203
- c.edited = self.edited
204
- c.scatter = self.scatter
205
- c.linespoints = self.linespoints
206
- c.linewidth = self.linewidth
207
- c.linestyle = self.linestyle
208
- c.drawstyle = self.drawstyle
209
- c.dashes = self.dashes
210
- c.hidden = self.hidden
211
- c.marker = self.marker
212
- c.markerstyle = self.markerstyle
213
- c.markersize = self.markersize
214
- c.markeredgecolor = self.markeredgecolor
215
- c.markerfacecolor = self.markerfacecolor
216
- c.ebar = self.ebar
217
- c.erange = self.erange
218
- c.plotprecedence = self.plotprecedence
248
+ c = Curve(x=np.array(self.x, dtype=float),
249
+ y=np.array(self.y, dtype=float),
250
+ name=self.name,
251
+ filename=self.filename,
252
+ xlabel=self.xlabel,
253
+ ylabel=self.ylabel,
254
+ title=self.title,
255
+ record_id=self.record_id,
256
+ step=self.step,
257
+ xticks_labels=self.xticks_labels,
258
+ plotname=self.plotname,
259
+ color=self.color,
260
+ edited=self.edited,
261
+ scatter=self.scatter,
262
+ linespoints=self.linespoints,
263
+ linewidth=self.linewidth,
264
+ linestyle=self.linestyle,
265
+ drawstyle=self.drawstyle,
266
+ dashes=self.dashes,
267
+ hidden=self.hidden,
268
+ ebar=self.ebar,
269
+ erange=self.erange,
270
+ marker=self.marker,
271
+ markerstyle=self.markerstyle,
272
+ markersize=self.markersize,
273
+ markerfacecolor=self.markerfacecolor,
274
+ markeredgecolor=self.markeredgecolor,
275
+ plotprecedence=self.plotprecedence,
276
+ legend_show=self.legend_show,
277
+ math_interp_left=self.math_interp_left,
278
+ math_interp_right=self.math_interp_right,
279
+ math_interp_period=self.math_interp_period)
219
280
 
220
281
  return c
221
282
 
@@ -232,7 +293,10 @@ class Curve(object):
232
293
  return c
233
294
 
234
295
 
235
- def getinterp(a, b, left=None, right=None, samples=100, match='domain'):
296
+ def getinterp(a, b,
297
+ a_left=None, a_right=None, a_period=None,
298
+ b_left=None, b_right=None, b_period=None,
299
+ samples=100, match='domain'):
236
300
  """
237
301
  Gets the interpolated and domain matched versions of the two curves.
238
302
 
@@ -240,10 +304,18 @@ def getinterp(a, b, left=None, right=None, samples=100, match='domain'):
240
304
  :type a: curve
241
305
  :param b: Curve B
242
306
  :type b: curve
243
- :param left: Value to return for `x < a.x[0]`, default is `a.y[0]`.
244
- :type left: float, optional
245
- :param right: Value to return for `x > a.x[-1]`, default is `a.y[-1]`.
246
- :type: right: float, optional
307
+ :param a_left: `numpy.interp()` `left` parameter for internal curve math methods for Curve A
308
+ :type a_left: float, optional
309
+ :param a_right: `numpy.interp()` `right` parameter for internal curve math methods for Curve A
310
+ :type: a_right: float, optional
311
+ :param a_period: `numpy.interp()` `period` parameter for internal curve math methods for Curve A
312
+ :type: a_period: float, optional
313
+ :param b_left: `numpy.interp()` `left` parameter for internal curve math methods for Curve B
314
+ :type b_left: float, optional
315
+ :param b_right: `numpy.interp()` `right` parameter for internal curve math methods for Curve B
316
+ :type: b_right: float, optional
317
+ :param b_period: `numpy.interp()` `period` parameter for internal curve math methods for Curve B
318
+ :type: b_period: float, optional
247
319
  :param match {'domain','step'},optional: A string indicating how to interpolate the two curves
248
320
  :type match: str
249
321
  :returns: curve pair -- the interpolated and domain matched versions of a and b
@@ -254,11 +326,11 @@ def getinterp(a, b, left=None, right=None, samples=100, match='domain'):
254
326
 
255
327
  ia = a.copy()
256
328
  ia.x = np.array(ux)
257
- ia.y = np.interp(ux, a.x, a.y, left, right) # interpolate y vals
329
+ ia.y = np.interp(ux, a.x, a.y, a_left, a_right, a_period) # interpolate y vals
258
330
 
259
- ib = Curve('', '')
331
+ ib = Curve()
260
332
  ib.x = np.array(ux)
261
- ib.y = np.interp(ux, b.x, b.y, left, right) # interpolate y vals
333
+ ib.y = np.interp(ux, b.x, b.y, b_left, b_right, b_period) # interpolate y vals
262
334
 
263
335
  return ia, ib
264
336
  elif match == 'step':
@@ -272,11 +344,11 @@ def getinterp(a, b, left=None, right=None, samples=100, match='domain'):
272
344
 
273
345
  ia = a.copy()
274
346
  ia.x = ax
275
- ia.y = np.interp(ax, a.x, a.y, left, right) # interpolate y vals
347
+ ia.y = np.interp(ax, a.x, a.y, a_left, a_right, a_period) # interpolate y vals
276
348
 
277
- ib = Curve('', '')
349
+ ib = Curve()
278
350
  ib.x = bx
279
- ib.y = np.interp(bx, b.x, b.y, left, right) # interpolate y vals
351
+ ib.y = np.interp(bx, b.x, b.y, b_left, b_right, b_period) # interpolate y vals
280
352
 
281
353
  return ia, ib
282
354
  else:
@@ -325,7 +397,7 @@ def append(a, b):
325
397
  ux = list(set(a.x).union(set(b.x))) # get union of xvals
326
398
  ux.sort()
327
399
 
328
- aub = Curve('', '')
400
+ aub = Curve()
329
401
  aub.x = np.array(ux)
330
402
  aub.y = np.zeros(len(aub.x))
331
403
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env /usr/apps/weave/weave-develop-cpu/bin/python3
1
+ #!/usr/bin/env /usr/apps/weave/weave-prod-cpu/bin/python3
2
2
 
3
3
  import sys
4
4
  import os