Skip to content

Commit 489aa65

Browse files
committed
Merge branch 'develop' into 'main'
Develop See merge request weave/pydv!206
2 parents 56bc797 + f6b4360 commit 489aa65

File tree

13 files changed

+279
-87
lines changed

13 files changed

+279
-87
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
env:
1919
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
2020
with:
21-
tag_name: pydv-3.8.2
22-
release_name: PyDV 3.8.2
21+
tag_name: pydv-3.9.0
22+
release_name: PyDV 3.9.0
2323
draft: false
2424
prerelease: false

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SHELL := /bin/bash
22

3-
PYDV_ENV := $(if $(PYDV_ENV),$(PYDV_ENV),$(HOME)/pydv_env)
3+
PYDV_ENV := $(if $(PYDV_ENV),$(PYDV_ENV),/usr/workspace/$(USER)/pydv_env)
44

55
PKG_REGISTRY_URL = $(CI_API_V4_URL)/projects/$(CI_PROJECT_ID)/packages/generic/archive
66
DEPLOY_PATH = /usr/gapps/pydv

docs/release_notes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
Release Notes
44
=============
5+
3.9.0
6+
------
7+
* Support for sina hdf5 files
8+
* Bugfix for `fit`
9+
510
3.8.2
611
------
712
* Bugfix for xminmax mask

pydv/pdv.py

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,9 @@ def do_rdcsv(self, line):
510510
def do_rdsina(self, line):
511511
self.do_readsina(line)
512512

513+
def do_rdsinah5(self, line):
514+
self.do_readsinahdf5(line)
515+
513516
def do_cur(self, line):
514517
self.do_curve(line)
515518

@@ -636,6 +639,8 @@ def do_help(self, arg):
636639
arg = 'readcsv'
637640
elif (arg == 'rdsina'):
638641
arg = 'readsina'
642+
elif (arg == 'rdsinah5'):
643+
arg = 'readsinahdf5'
639644
elif (arg == 'convol'):
640645
arg = 'convolve'
641646
elif (arg == 'convolb'):
@@ -1110,6 +1115,9 @@ def do_read(self, line):
11101115
elif line[-1].endswith(".json"):
11111116
self.do_readsina(" ".join(line))
11121117
return
1118+
elif line[-1].endswith(".hdf5") or line[-1].endswith(".h5") or line[-1].endswith(".hdf"):
1119+
self.do_readsinahdf5(" ".join(line))
1120+
return
11131121

11141122
if n == 1:
11151123
self.load(line[0])
@@ -1174,10 +1182,8 @@ def do_readcsv(self, line):
11741182

11751183
def do_readsina(self, line):
11761184
"""
1177-
Read all curves from Sina data file. PyDV assumes there is only one record in the Sina file, and if there are
1178-
more than one then PyDV only reads the first. PyDV also assumes there is only one independent variable per
1179-
curve_set; if there are more than one then PyDV may exhibit undefined behavior. The next available prefix
1180-
(see the prefix command) is automatically assigned the menu index of the first curve in each data file read.
1185+
Read all curves from Sina data file. The next available prefix (see the prefix command) is automatically
1186+
assigned the menu index of the first curve in each data file read.
11811187
11821188
.. code::
11831189
@@ -1196,6 +1202,28 @@ def do_readsina(self, line):
11961202
self.redraw = False
11971203
self.plotter.updateDialogs()
11981204

1205+
def do_readsinahdf5(self, line):
1206+
"""
1207+
Read all curves from Sina hdf5 data file. The next available prefix (see the prefix command) is automatically
1208+
assigned the menu index of the first curve in each data file read.
1209+
1210+
.. code::
1211+
1212+
[PyDV]: <readsinahdf5 | rdsinah5> <filename.hdf5>
1213+
1214+
Ex:
1215+
[PyDV]: readsinahdf5 my_file.hdf5
1216+
"""
1217+
1218+
try:
1219+
line = line.split()
1220+
self.load_sinahdf5(line[0])
1221+
except:
1222+
pdvutil.print_own_docstring(self)
1223+
finally:
1224+
self.redraw = False
1225+
self.plotter.updateDialogs()
1226+
11991227
def do_setxcolumn(self, line):
12001228
"""
12011229
Set x column for reading column formatted data files (.gnu or .csv).
@@ -9440,6 +9468,16 @@ def load_sina(self, fname):
94409468
self.curvelist += curves
94419469
self.filelist.append((fname, len(curves)))
94429470

9471+
def load_sinahdf5(self, fname):
9472+
"""
9473+
Load a Sina HDF5 data file, add parsed curves to the curvelist
9474+
"""
9475+
9476+
curves = pydvpy.readsinahdf5(fname, self.debug)
9477+
if len(curves) > 0:
9478+
self.curvelist += curves
9479+
self.filelist.append((fname, len(curves)))
9480+
94439481
def loadrc(self):
94449482
"""
94459483
Read in a resource definition file

0 commit comments

Comments
 (0)