h5yaml 0.0.4__py3-none-any.whl → 0.0.5__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.
@@ -84,7 +84,6 @@ variables:
84
84
  valid_max: 65534
85
85
  /group_01/stats:
86
86
  _dtype: stats_dtype
87
- _vlen: True
88
87
  _dims: [time]
89
88
  comment: detector map statistics
90
89
  /group_02/detector_images:
@@ -97,3 +96,8 @@ variables:
97
96
  units: '1'
98
97
  valid_min: 0
99
98
  valid_max: 65534
99
+ /group_02/stats:
100
+ _dtype: stats_dtype
101
+ _vlen: True
102
+ _dims: [time]
103
+ comment: detector map statistics (vlen)
@@ -0,0 +1,94 @@
1
+ # YAML
2
+ #
3
+ # Configuration file to test the implementation of classes H5Yaml and NcYaml
4
+ #
5
+ # This file is part of h5_yaml:
6
+ # https://github.com/rmvanhees/h5_yaml.git
7
+ #
8
+ # Copyright (c) 2025 SRON
9
+ # All Rights Reserved
10
+ #
11
+ # License: BSD-3-Clause
12
+ #
13
+ # Define groups
14
+ groups:
15
+ - group_00
16
+ - group_01
17
+ - group_02
18
+
19
+ # Define dimensions
20
+ # Note dimensions with an attribute 'long_name' will also be generated as variable
21
+ dimensions:
22
+ number_of_images:
23
+ _dtype: u2
24
+ _size: 0
25
+ samples_per_image:
26
+ _dtype: u4
27
+ _size: 203500
28
+ column:
29
+ _dtype: u2
30
+ _size: 640
31
+ row:
32
+ _dtype: u2
33
+ _size: 512
34
+ time:
35
+ _dtype: f8
36
+ _size: 0
37
+ _FillValue: -32767
38
+ long_name: Attitude sample time (seconds of day)
39
+ calendar: proleptic_gregorian
40
+ units: seconds since %Y-%m-%d %H:%M:%S
41
+ valid_min: 0
42
+ valid_max: 92400
43
+
44
+ # Define compound types
45
+ # - compound elements must have a data-type, and can have a unit and long_name
46
+ compounds:
47
+ stats_dtype:
48
+ time: [u8, seconds since 1970-01-01T00:00:00, timestamp]
49
+ index: [u2, '1', index]
50
+ tbl_id: [u1, '1', binning id]
51
+ saa: [u1, '1', saa-flag]
52
+ coad: [u1, '1', co-addings]
53
+ texp: [f4, ms, exposure time]
54
+ lat: [f4, degree, latitude]
55
+ lon: [f4, degree, longitude]
56
+ avg: [f4, '1', '$S - S_{ref}$']
57
+ unc: [f4, '1', '\u03c3($S - S_{ref}$)']
58
+ dark_offs: [f4, '1', dark-offset]
59
+
60
+ # Define variables
61
+ variables:
62
+ /group_00/detector_images:
63
+ _dtype: u2
64
+ _dims: [number_of_images, column, row]
65
+ _FillValue: 65535
66
+ long_name: Detector pixel values
67
+ comment: unbinned full-frame data
68
+ units: '1'
69
+ valid_min: 0
70
+ valid_max: 65534
71
+ /group_01/detector_images:
72
+ _dtype: u2
73
+ _dims: [number_of_images, samples_per_image]
74
+ _FillValue: 65535
75
+ _compression: 1
76
+ long_name: Detector pixel values
77
+ comment: variable binned data (filled to the largest samples_per_image)
78
+ units: '1'
79
+ valid_min: 0
80
+ valid_max: 65534
81
+ /group_01/stats:
82
+ _dtype: stats_dtype
83
+ _dims: [time]
84
+ comment: detector map statistics
85
+ /group_02/detector_images:
86
+ _dtype: u2
87
+ _dims: [number_of_images]
88
+ _vlen: True
89
+ _FillValue: 65535
90
+ long_name: Detector pixel values
91
+ comment: variable binned (vlen) data
92
+ units: '1'
93
+ valid_min: 0
94
+ valid_max: 65534
@@ -236,7 +236,14 @@ class H5Yaml:
236
236
  shuffle = True
237
237
 
238
238
  if val.get("_vlen"):
239
- ds_dtype = h5py.vlen_dtype(ds_dtype)
239
+ ds_name = (
240
+ val["_dtype"].split("_")[0]
241
+ if "_" in val["_dtype"]
242
+ else val["_dtype"]
243
+ ) + "_vlen"
244
+ if ds_name not in fid:
245
+ fid[ds_name] = h5py.vlen_dtype(ds_dtype)
246
+ ds_dtype = fid[ds_name]
240
247
  fillvalue = None
241
248
  if ds_maxshape == (None,):
242
249
  ds_chunk = (16,)
h5yaml/yaml_nc.py CHANGED
@@ -258,7 +258,7 @@ class NcYaml:
258
258
  def tests() -> None:
259
259
  """..."""
260
260
  print("Calling NcYaml")
261
- NcYaml(files("h5yaml.Data") / "h5_testing.yaml").create("test_yaml.nc")
261
+ NcYaml(files("h5yaml.Data") / "nc_testing.yaml").create("test_yaml.nc")
262
262
 
263
263
 
264
264
  if __name__ == "__main__":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: h5yaml
3
- Version: 0.0.4
3
+ Version: 0.0.5
4
4
  Summary: Use YAML configuration file to generate HDF5/netCDF4 formated files.
5
5
  Project-URL: Homepage, https://github.com/rmvanhees/h5_yaml
6
6
  Project-URL: Source, https://github.com/rmvanhees/h5_yaml
@@ -0,0 +1,10 @@
1
+ h5yaml/conf_from_yaml.py,sha256=FT5oS4yqDFUYZqgria_OrmMK52ZcrTVoAPyPkLrHstc,982
2
+ h5yaml/yaml_h5.py,sha256=1ys0PLMrr4-kMhzfrURs2g6LUrPZ7xhIhDkROthv88M,12140
3
+ h5yaml/yaml_nc.py,sha256=9GqddTE5qmpumwoR5sJ0LZUDKW8RfnFi9LG98bm7tH8,9202
4
+ h5yaml/Data/h5_testing.yaml,sha256=kJqP9s9zMuIc18meObTeU57RfQTDaUW385xr3DuJZtc,2463
5
+ h5yaml/Data/nc_testing.yaml,sha256=hKL_B_4iHD1EQKA0AdwFinBak_hb_4nFXSeeyMJgDpU,2275
6
+ h5yaml/lib/chunksizes.py,sha256=sAYiTTL8ecBivBDxw-XIJu2yMlt0zNHTr-KS7tBFp2o,1392
7
+ h5yaml-0.0.5.dist-info/METADATA,sha256=-VGRDVil2VQKXUL4wuTG3VamtJslbRcVUN5ERjPyA44,7160
8
+ h5yaml-0.0.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
+ h5yaml-0.0.5.dist-info/licenses/LICENSE,sha256=MoOwtPnC77nFaIwRIAIE6fKhrzMd3G18mOXDPtAH8G0,1509
10
+ h5yaml-0.0.5.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- h5yaml/conf_from_yaml.py,sha256=FT5oS4yqDFUYZqgria_OrmMK52ZcrTVoAPyPkLrHstc,982
2
- h5yaml/yaml_h5py.py,sha256=MVPUqD5fNY3VYIi3ebaEY7uSR1sgYw-8DvIjrOWIaIk,11838
3
- h5yaml/yaml_nc.py,sha256=37NQ9FPuCrnOTN5R4otn0R-Sdwej1-cPwhODgY2L6pY,9202
4
- h5yaml/Data/h5_testing.yaml,sha256=_x3qBC8RNQ1h4c6B1JOH_y0L9DiDLsOEfyr60IcvpoI,2358
5
- h5yaml/lib/chunksizes.py,sha256=sAYiTTL8ecBivBDxw-XIJu2yMlt0zNHTr-KS7tBFp2o,1392
6
- h5yaml-0.0.4.dist-info/METADATA,sha256=Vvpv1h1t0cYvV5hBiXzdKe2CtU3TT2hWW0qwrIC8vLc,7160
7
- h5yaml-0.0.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8
- h5yaml-0.0.4.dist-info/licenses/LICENSE,sha256=MoOwtPnC77nFaIwRIAIE6fKhrzMd3G18mOXDPtAH8G0,1509
9
- h5yaml-0.0.4.dist-info/RECORD,,
File without changes