bufrust 1.0.1__tar.gz → 1.0.2__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 (155) hide show
  1. {bufrust-1.0.1 → bufrust-1.0.2}/Cargo.lock +1 -1
  2. {bufrust-1.0.1 → bufrust-1.0.2}/Cargo.toml +1 -1
  3. {bufrust-1.0.1 → bufrust-1.0.2}/PKG-INFO +1 -1
  4. {bufrust-1.0.1 → bufrust-1.0.2}/pyproject.toml +1 -1
  5. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/__init__.py +1 -1
  6. bufrust-1.0.2/python/bufrust/definitions/bufr/tables/0/wmo/10 +1 -0
  7. bufrust-1.0.2/python/bufrust/definitions/bufr/tables/0/wmo/11 +1 -0
  8. bufrust-1.0.2/python/bufrust/definitions/bufr/tables/0/wmo/12 +1 -0
  9. bufrust-1.0.2/python/bufrust/definitions/bufr/tables/0/wmo/7 +1 -0
  10. bufrust-1.0.2/python/bufrust/definitions/bufr/tables/0/wmo/8 +1 -0
  11. bufrust-1.0.2/python/bufrust/definitions/bufr/tables/0/wmo/9 +1 -0
  12. {bufrust-1.0.1 → bufrust-1.0.2}/src/lib.rs +11 -0
  13. {bufrust-1.0.1 → bufrust-1.0.2}/src/tables.rs +34 -6
  14. {bufrust-1.0.1 → bufrust-1.0.2}/tests/fixture_decode.rs +25 -0
  15. bufrust-1.0.2/tests/fixtures/rjtd_iucc10.bufr +0 -0
  16. {bufrust-1.0.1 → bufrust-1.0.2}/.gitignore +0 -0
  17. {bufrust-1.0.1 → bufrust-1.0.2}/LICENSE +0 -0
  18. {bufrust-1.0.1 → bufrust-1.0.2}/README.md +0 -0
  19. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/ECCODES_LICENSE +0 -0
  20. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/ECCODES_NOTICE +0 -0
  21. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/0/98/0/2/element.table +0 -0
  22. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/0/98/0/6/element.table +0 -0
  23. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/0/98/0/element.table +0 -0
  24. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/0/98/0/sequence.def +0 -0
  25. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/1/254/0/element.table +0 -0
  26. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/1/39/0/element.table +0 -0
  27. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/1/39/0/sequence.def +0 -0
  28. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/1/78/0/element.table +0 -0
  29. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/1/78/0/sequence.def +0 -0
  30. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/1/78/10/element.table +0 -0
  31. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/1/78/10/sequence.def +0 -0
  32. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/1/98/0/2/element.table +0 -0
  33. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/1/98/0/6/element.table +0 -0
  34. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/1/98/0/element.table +0 -0
  35. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/1/98/0/sequence.def +0 -0
  36. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/101/98/0/element.table +0 -0
  37. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/101/98/0/sequence.def +0 -0
  38. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/19-1/254/0/element.table +0 -0
  39. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/19-1/254/0/sequence.def +0 -0
  40. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/19-1/98/0/6/element.table +0 -0
  41. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/19-1/98/0/element.table +0 -0
  42. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/19-1/98/0/sequence.def +0 -0
  43. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/2/78/0/element.table +0 -0
  44. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/2/78/0/sequence.def +0 -0
  45. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/2/98/0/element.table +0 -0
  46. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/2/98/0/sequence.def +0 -0
  47. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/3/78/0/element.table +0 -0
  48. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/3/78/0/sequence.def +0 -0
  49. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/3/98/0/element.table +0 -0
  50. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/3/98/0/sequence.def +0 -0
  51. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/4/78/0/element.table +0 -0
  52. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/4/78/0/sequence.def +0 -0
  53. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/4/98/0/element.table +0 -0
  54. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/5/78/0/element.table +0 -0
  55. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/5/78/0/sequence.def +0 -0
  56. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/6/78/0/element.table +0 -0
  57. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/6/78/0/sequence.def +0 -0
  58. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/7/78/0/element.table +0 -0
  59. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/7/78/0/sequence.def +0 -0
  60. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/8/78/0/element.table +0 -0
  61. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/8/78/0/sequence.def +0 -0
  62. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/8/78/3/element.table +0 -0
  63. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/local/8/78/3/sequence.def +0 -0
  64. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/0/element.table +0 -0
  65. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/0/sequence.def +0 -0
  66. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/13/element.table +0 -0
  67. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/13/sequence.def +0 -0
  68. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/14/element.table +0 -0
  69. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/14/sequence.def +0 -0
  70. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/15/element.table +0 -0
  71. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/15/sequence.def +0 -0
  72. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/16/element.table +0 -0
  73. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/16/sequence.def +0 -0
  74. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/17/element.table +0 -0
  75. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/17/sequence.def +0 -0
  76. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/18/element.table +0 -0
  77. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/18/sequence.def +0 -0
  78. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/19/element.table +0 -0
  79. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/19/sequence.def +0 -0
  80. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/2/element.table +0 -0
  81. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/2/sequence.def +0 -0
  82. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/20/element.table +0 -0
  83. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/20/sequence.def +0 -0
  84. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/21/element.table +0 -0
  85. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/21/sequence.def +0 -0
  86. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/22/element.table +0 -0
  87. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/22/sequence.def +0 -0
  88. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/23/element.table +0 -0
  89. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/23/sequence.def +0 -0
  90. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/24/element.table +0 -0
  91. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/24/sequence.def +0 -0
  92. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/25/element.table +0 -0
  93. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/25/sequence.def +0 -0
  94. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/26/element.table +0 -0
  95. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/26/sequence.def +0 -0
  96. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/27/element.table +0 -0
  97. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/27/sequence.def +0 -0
  98. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/28/element.table +0 -0
  99. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/28/sequence.def +0 -0
  100. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/29/element.table +0 -0
  101. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/29/sequence.def +0 -0
  102. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/30/element.table +0 -0
  103. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/30/sequence.def +0 -0
  104. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/31/element.table +0 -0
  105. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/31/sequence.def +0 -0
  106. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/32/element.table +0 -0
  107. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/32/sequence.def +0 -0
  108. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/33/element.table +0 -0
  109. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/33/sequence.def +0 -0
  110. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/34/element.table +0 -0
  111. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/34/sequence.def +0 -0
  112. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/35/element.table +0 -0
  113. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/35/sequence.def +0 -0
  114. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/36/element.table +0 -0
  115. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/36/sequence.def +0 -0
  116. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/37/element.table +0 -0
  117. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/37/sequence.def +0 -0
  118. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/38/element.table +0 -0
  119. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/38/sequence.def +0 -0
  120. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/39/element.table +0 -0
  121. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/39/sequence.def +0 -0
  122. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/40/element.table +0 -0
  123. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/40/sequence.def +0 -0
  124. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/41/element.table +0 -0
  125. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/41/sequence.def +0 -0
  126. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/42/element.table +0 -0
  127. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/42/sequence.def +0 -0
  128. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/43/element.table +0 -0
  129. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/43/sequence.def +0 -0
  130. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/44/element.table +0 -0
  131. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/44/sequence.def +0 -0
  132. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/45/element.table +0 -0
  133. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/45/sequence.def +0 -0
  134. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/6/element.table +0 -0
  135. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/0/wmo/6/sequence.def +0 -0
  136. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/3/local/1/98/0/element.table +0 -0
  137. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/3/local/1/98/0/sequence.def +0 -0
  138. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/3/wmo/11/element.table +0 -0
  139. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/3/wmo/11/sequence.def +0 -0
  140. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/3/wmo/6/element.table +0 -0
  141. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/definitions/bufr/tables/3/wmo/6/sequence.def +0 -0
  142. {bufrust-1.0.1 → bufrust-1.0.2}/python/bufrust/py.typed +0 -0
  143. {bufrust-1.0.1 → bufrust-1.0.2}/scripts/bump-version.py +0 -0
  144. {bufrust-1.0.1 → bufrust-1.0.2}/scripts/download-eccodes-bufr-tests.ps1 +0 -0
  145. {bufrust-1.0.1 → bufrust-1.0.2}/src/bin/check_eccodes_numeric.rs +0 -0
  146. {bufrust-1.0.1 → bufrust-1.0.2}/src/bitstream.rs +0 -0
  147. {bufrust-1.0.1 → bufrust-1.0.2}/src/data.rs +0 -0
  148. {bufrust-1.0.1 → bufrust-1.0.2}/src/descriptor.rs +0 -0
  149. {bufrust-1.0.1 → bufrust-1.0.2}/src/error.rs +0 -0
  150. {bufrust-1.0.1 → bufrust-1.0.2}/src/message.rs +0 -0
  151. {bufrust-1.0.1 → bufrust-1.0.2}/tests/eccodes_bufr4_numeric.rs +0 -0
  152. {bufrust-1.0.1 → bufrust-1.0.2}/tests/eccodes_bufr4_refs.rs +0 -0
  153. {bufrust-1.0.1 → bufrust-1.0.2}/tests/fixtures/ecmwf_cyclone_tracks.bufr +0 -0
  154. {bufrust-1.0.1 → bufrust-1.0.2}/tests/fixtures/rjtd_drifting_buoy.bufr +0 -0
  155. {bufrust-1.0.1 → bufrust-1.0.2}/tests/table_loading.rs +0 -0
@@ -10,7 +10,7 @@ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
10
10
 
11
11
  [[package]]
12
12
  name = "bufrust"
13
- version = "1.0.1"
13
+ version = "1.0.2"
14
14
  dependencies = [
15
15
  "csv",
16
16
  "pyo3",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "bufrust"
3
- version = "1.0.1"
3
+ version = "1.0.2"
4
4
  edition = "2021"
5
5
  rust-version = "1.80"
6
6
  license = "Apache-2.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bufrust
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Classifier: Development Status :: 5 - Production/Stable
5
5
  Classifier: Intended Audience :: Science/Research
6
6
  Classifier: Programming Language :: Rust
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "bufrust"
7
- version = "1.0.1"
7
+ version = "1.0.2"
8
8
  description = "Fast BUFR edition 4 parser and decoder powered by Rust"
9
9
  requires-python = ">=3.9"
10
10
  readme = "README.md"
@@ -24,7 +24,7 @@ from ._bufrust import (
24
24
  parse_file,
25
25
  )
26
26
 
27
- __version__ = "1.0.1"
27
+ __version__ = "1.0.2"
28
28
 
29
29
 
30
30
  class BufrustError(ValueError):
@@ -45,6 +45,7 @@ fn expand_descriptors(table_dir: &str, descriptors: Vec<u32>) -> PyResult<Vec<u3
45
45
 
46
46
  #[pyfunction]
47
47
  fn decode_values(data: &[u8], table_dir: &str) -> PyResult<Vec<DecodedValue>> {
48
+ let data = first_message_data(data).map_err(tables::to_py_err)?;
48
49
  let message = parse_message(data).map_err(tables::to_py_err)?;
49
50
  let tables = TableSet::from_eccodes_dir(table_dir).map_err(tables::to_py_err)?;
50
51
  let section4 = &data
@@ -54,6 +55,7 @@ fn decode_values(data: &[u8], table_dir: &str) -> PyResult<Vec<DecodedValue>> {
54
55
 
55
56
  #[pyfunction]
56
57
  fn decode_values_with_tables(data: &[u8], tables: &TableSet) -> PyResult<Vec<DecodedValue>> {
58
+ let data = first_message_data(data).map_err(tables::to_py_err)?;
57
59
  let message = parse_message(data).map_err(tables::to_py_err)?;
58
60
  let section4 = &data
59
61
  [message.section4_data_offset..message.section4_data_offset + message.section4_data_length];
@@ -65,6 +67,7 @@ fn decode_values_with_definitions(
65
67
  data: &[u8],
66
68
  definitions_root: &str,
67
69
  ) -> PyResult<Vec<DecodedValue>> {
70
+ let data = first_message_data(data).map_err(tables::to_py_err)?;
68
71
  let message = parse_message(data).map_err(tables::to_py_err)?;
69
72
  let tables = TableSet::from_eccodes_definitions(definitions_root, &message)
70
73
  .map_err(tables::to_py_err)?;
@@ -74,6 +77,7 @@ fn decode_values_with_definitions(
74
77
  }
75
78
 
76
79
  pub fn decode_values_with_builtin_tables(data: &[u8]) -> Result<Vec<DecodedValue>> {
80
+ let data = first_message_data(data)?;
77
81
  let message = parse_message(data)?;
78
82
  let tables = TableSet::from_builtin_definitions(&message)?;
79
83
  let section4 = &data
@@ -81,6 +85,13 @@ pub fn decode_values_with_builtin_tables(data: &[u8]) -> Result<Vec<DecodedValue
81
85
  decode_uncompressed_values(&message, &tables, section4)
82
86
  }
83
87
 
88
+ fn first_message_data(data: &[u8]) -> Result<&[u8]> {
89
+ split_messages(data)?
90
+ .into_iter()
91
+ .next()
92
+ .ok_or(BufrError::MissingMagic)
93
+ }
94
+
84
95
  #[pymodule]
85
96
  fn _bufrust(m: &Bound<'_, PyModule>) -> PyResult<()> {
86
97
  m.add_class::<BufrMessage>()?;
@@ -87,12 +87,13 @@ impl TableSet {
87
87
 
88
88
  pub fn from_eccodes_definitions(root: impl AsRef<Path>, message: &BufrMessage) -> Result<Self> {
89
89
  let root = root.as_ref();
90
- let master_dir = root
91
- .join("bufr")
92
- .join("tables")
93
- .join(message.master_table_number.to_string())
94
- .join("wmo")
95
- .join(message.master_tables_version_number.to_string());
90
+ let master_dir = resolve_eccodes_table_dir(
91
+ root.join("bufr")
92
+ .join("tables")
93
+ .join(message.master_table_number.to_string())
94
+ .join("wmo")
95
+ .join(message.master_tables_version_number.to_string()),
96
+ )?;
96
97
  let mut tables = Self::from_eccodes_dir(master_dir)?;
97
98
  if message.local_tables_version_number != 0 {
98
99
  let local_dir = local_table_dir(root, message);
@@ -450,6 +451,33 @@ fn matching_files(path: &Path, prefix: &str, suffix: &str) -> Result<Vec<PathBuf
450
451
  Ok(files)
451
452
  }
452
453
 
454
+ fn resolve_eccodes_table_dir(path: PathBuf) -> Result<PathBuf> {
455
+ if path.is_dir() {
456
+ return Ok(path);
457
+ }
458
+ if path.is_file() {
459
+ let alias = std::fs::read_to_string(&path)?;
460
+ let alias = alias.trim();
461
+ if alias.is_empty()
462
+ || alias.contains(std::path::MAIN_SEPARATOR)
463
+ || alias.contains('/')
464
+ || alias.contains('\\')
465
+ {
466
+ return Err(BufrError::Table(format!(
467
+ "invalid ecCodes table alias {} -> {alias:?}",
468
+ path.display()
469
+ )));
470
+ }
471
+ if let Some(parent) = path.parent() {
472
+ return resolve_eccodes_table_dir(parent.join(alias));
473
+ }
474
+ }
475
+ Err(BufrError::Table(format!(
476
+ "ecCodes table directory does not exist: {}",
477
+ path.display()
478
+ )))
479
+ }
480
+
453
481
  fn unit_to_type(unit: &str) -> &'static str {
454
482
  match unit {
455
483
  "CCITT IA5" => "string",
@@ -33,3 +33,28 @@ fn decodes_rjtd_drifting_buoy_fixture() {
33
33
  assert_eq!(values[0].descriptor, 001087);
34
34
  assert_eq!(values[0].value, Some(2_102_606.0));
35
35
  }
36
+
37
+ #[test]
38
+ fn decodes_rjtd_iucc10_fixture() {
39
+ let bytes = include_bytes!("fixtures/rjtd_iucc10.bufr");
40
+ let messages = parse_messages(bytes).unwrap();
41
+
42
+ assert_eq!(messages.len(), 1);
43
+ assert_eq!(messages[0].originating_centre, 34);
44
+ assert_eq!(messages[0].data_category, 12);
45
+ assert_eq!(messages[0].master_tables_version_number, 12);
46
+ assert_eq!(messages[0].typical_year, 2025);
47
+ assert_eq!(messages[0].typical_month, 8);
48
+ assert_eq!(messages[0].typical_day, 22);
49
+
50
+ let values = decode_values_with_builtin_tables(bytes).unwrap();
51
+ assert_eq!(values.len(), 32);
52
+ assert_eq!(values[7].descriptor, 001007);
53
+ assert_eq!(values[7].value, Some(174.0));
54
+ assert_eq!(values[10].descriptor, 001027);
55
+ assert_eq!(values[10].text.as_deref(), Some("nameless"));
56
+ assert_eq!(values[14].descriptor, 005002);
57
+ assert_eq!(values[14].value, Some(17.34));
58
+ assert_eq!(values[15].descriptor, 006002);
59
+ assert_eq!(values[15].value, Some(117.8));
60
+ }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes