xarray-ms 0.3.9__tar.gz → 0.5.0__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 (67) hide show
  1. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/PKG-INFO +1 -1
  2. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/doc/source/changelog.rst +8 -0
  3. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/doc/source/conf.py +1 -1
  4. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/pyproject.toml +2 -2
  5. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/backend/msv2/factories/correlated.py +2 -2
  6. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/backend/msv2/measures_adapters.py +14 -2
  7. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/backend/msv2/measures_encoders.py +2 -17
  8. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/.github/ISSUE_TEMPLATE.md +0 -0
  9. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  10. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/.github/dependabot.yml +0 -0
  11. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/.github/workflows/ci.yml +0 -0
  12. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/.github/workflows/pre-commit.yml +0 -0
  13. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/.github/workflows/readthedocs.yml +0 -0
  14. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/.gitignore +0 -0
  15. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/.pre-commit-config.yaml +0 -0
  16. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/.readthedocs.yaml +0 -0
  17. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/LICENSE +0 -0
  18. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/README.rst +0 -0
  19. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/doc/Makefile +0 -0
  20. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/doc/make.bat +0 -0
  21. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/doc/source/api.rst +0 -0
  22. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/doc/source/index.rst +0 -0
  23. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/doc/source/install.rst +0 -0
  24. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/doc/source/introduction.rst +0 -0
  25. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/doc/source/links.rst +0 -0
  26. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/doc/source/partitioning.rst +0 -0
  27. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/doc/source/roadmap.rst +0 -0
  28. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/doc/source/tutorial.rst +0 -0
  29. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/hello.txt +0 -0
  30. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/tests/__init__.py +0 -0
  31. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/tests/conftest.py +0 -0
  32. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/tests/msv4_test_corpus/__init__.py +0 -0
  33. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/tests/msv4_test_corpus/conftest.py +0 -0
  34. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/tests/msv4_test_corpus/test_msv_corpus.py +0 -0
  35. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/tests/test_antenna.py +0 -0
  36. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/tests/test_backend.py +0 -0
  37. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/tests/test_basic.py +0 -0
  38. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/tests/test_field_and_source.py +0 -0
  39. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/tests/test_github.py +0 -0
  40. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/tests/test_imputation.py +0 -0
  41. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/tests/test_measures.py +0 -0
  42. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/tests/test_multiton.py +0 -0
  43. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/tests/test_read.py +0 -0
  44. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/tests/test_structure.py +0 -0
  45. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/tests/test_utils.py +0 -0
  46. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/tests/test_zarr_roundtrip.py +0 -0
  47. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/__init__.py +0 -0
  48. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/backend/msv2/array.py +0 -0
  49. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/backend/msv2/entrypoint.py +0 -0
  50. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/backend/msv2/entrypoint_utils.py +0 -0
  51. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/backend/msv2/factories/__init__.py +0 -0
  52. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/backend/msv2/factories/antenna.py +0 -0
  53. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/backend/msv2/factories/core.py +0 -0
  54. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/backend/msv2/factories/field_and_source.py +0 -0
  55. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/backend/msv2/imputation.py +0 -0
  56. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/backend/msv2/partition.py +0 -0
  57. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/backend/msv2/structure.py +0 -0
  58. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/backend/msv2/table_utils.py +0 -0
  59. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/casa_types.py +0 -0
  60. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/errors.py +0 -0
  61. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/msv4_types.py +0 -0
  62. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/multiton.py +0 -0
  63. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/query.py +0 -0
  64. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/testing/__init__.py +0 -0
  65. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/testing/simulator.py +0 -0
  66. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/testing/utils.py +0 -0
  67. {xarray_ms-0.3.9 → xarray_ms-0.5.0}/xarray_ms/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xarray-ms
3
- Version: 0.3.9
3
+ Version: 0.5.0
4
4
  Summary: xarray MSv4 views over MSv2 Measurement Sets
5
5
  Author-email: Simon Perkins <simon.perkins@gmail.com>
6
6
  License-File: LICENSE
@@ -3,6 +3,14 @@
3
3
  Changelog
4
4
  =========
5
5
 
6
+ 0.5.0 (02-03-2026)
7
+ ------------------
8
+ * Fix ``VisibilityCoder`` typo (:pr:`145`)
9
+ * Raise an exception if no MSv4 Frame Type is available in ``EpochCoder.decode`` (:pr:`145`)
10
+ * Replace an assert with an ``InvalidMeasurementSet`` exception if the
11
+ number of ``TabRefTypes`` doesn't match the ``TabRefCodes`` (:pr:`145`)
12
+ * Guard frame inference in a dictionary with a KeyError (:pr:`145`)
13
+
6
14
  0.3.9 (18-02-2026)
7
15
  ------------------
8
16
  * Define and use an ``OnMissingLiteralType`` (:pr:`144`)
@@ -11,7 +11,7 @@
11
11
  project = "xarray-ms"
12
12
  copyright = "2024 - 2025 NRF (SARAO) and Rhodes University (RATT) Centre"
13
13
  author = "Simon Perkins"
14
- release = "0.3.9"
14
+ release = "0.5.0"
15
15
 
16
16
  # -- General configuration ---------------------------------------------------
17
17
  # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "xarray-ms"
3
- version = "0.3.9"
3
+ version = "0.5.0"
4
4
  description = "xarray MSv4 views over MSv2 Measurement Sets"
5
5
  authors = [{name = "Simon Perkins", email = "simon.perkins@gmail.com"}]
6
6
  readme = "README.rst"
@@ -54,7 +54,7 @@ extend-select = ["I"]
54
54
  # github_url = "https://github.com/<user or organization>/<project>/"
55
55
 
56
56
  [tool.tbump.version]
57
- current = "0.3.9"
57
+ current = "0.5.0"
58
58
 
59
59
  # Example of a semver regexp.
60
60
  # Make sure this matches current_version before
@@ -23,7 +23,7 @@ from xarray_ms.backend.msv2.imputation import (
23
23
  from xarray_ms.backend.msv2.measures_encoders import (
24
24
  MSv2Coder,
25
25
  MSv2CoderFactory,
26
- VisiblityCoder,
26
+ VisibilityCoder,
27
27
  )
28
28
  from xarray_ms.backend.msv2.structure import MSv2StructureFactory, PartitionKeyT
29
29
  from xarray_ms.casa_types import ColumnDesc, Polarisations
@@ -57,7 +57,7 @@ MSV4_to_MSV2_COLUMN_SCHEMAS = {
57
57
  ),
58
58
  "FLAG": MSv2ColumnSchema("FLAG", ("frequency", "polarization"), 1, None),
59
59
  "VISIBILITY": MSv2ColumnSchema(
60
- "DATA", ("frequency", "polarization"), np.nan + np.nan * 1j, VisiblityCoder()
60
+ "DATA", ("frequency", "polarization"), np.nan + np.nan * 1j, VisibilityCoder()
61
61
  ),
62
62
  "WEIGHT_ROW": MSv2ColumnSchema(
63
63
  "WEIGHT",
@@ -380,7 +380,11 @@ class ArrowTableMeasuresAdapter(ColumnDescMeasuresAdapter, MeasuresMixin):
380
380
  # The measures information may contain it's own reference types and codes
381
381
  if isinstance(tab_ref_types := measinfo.get("TabRefTypes"), Sequence):
382
382
  if isinstance(tab_ref_codes := measinfo.get("TabRefCodes"), Sequence):
383
- assert len(tab_ref_types) == len(tab_ref_codes)
383
+ if len(tab_ref_types) != len(tab_ref_codes):
384
+ raise InvalidMeasurementSet(
385
+ f"TabRefTypes {tab_ref_types} and TabRefCodes {tab_ref_codes} "
386
+ f"have different lengths in {self.column_name} MEASINFO"
387
+ )
384
388
  else:
385
389
  tab_ref_codes = [MeasuresEnum[t].value for t in tab_ref_types]
386
390
 
@@ -390,7 +394,15 @@ class ArrowTableMeasuresAdapter(ColumnDescMeasuresAdapter, MeasuresMixin):
390
394
  code_frame_map = {m.value: m.name for m in MeasuresEnum}
391
395
 
392
396
  # Try and find a unique frame
393
- if len(frames := {code_frame_map[c] for c in var_ref_col}) == 0:
397
+ try:
398
+ frames = {code_frame_map[c] for c in var_ref_col}
399
+ except KeyError as e:
400
+ raise InvalidMeasurementSet(
401
+ f"Code {e.args[0]} in {var_ref_col_name} is not in the "
402
+ f"code frame map {code_frame_map} for column {self.column_name}"
403
+ ) from e
404
+
405
+ if len(frames) == 0:
394
406
  return None
395
407
 
396
408
  if len(frames) > 1:
@@ -107,21 +107,6 @@ class MeasuresCoder(MSv2Coder):
107
107
  self.measures_adapter = measures_adapter
108
108
 
109
109
 
110
- class QuantityCoder(MeasuresCoder):
111
- """Encodes a quantum unit"""
112
-
113
- def encode(self, variable: Variable, name: T_Name = None) -> Variable:
114
- dims, data, attrs, encoding = unpack_for_encoding(variable)
115
- attrs = {k: v for k, v in attrs.items() if k not in {"type", "units"}}
116
- return Variable(dims, data, attrs, encoding, fastpath=True)
117
-
118
- def decode(self, variable: Variable, name: T_Name = None) -> Variable:
119
- dims, data, attrs, encoding = unpack_for_decoding(variable)
120
- attrs["type"] = "quantity"
121
- attrs["units"] = self.measures_adapter.quantum_unit("raise")
122
- return Variable(dims, data, attrs, encoding, fastpath=True)
123
-
124
-
125
110
  class SuppliedAttributesCoder(MSv2Coder):
126
111
  """Adds and removes the supplied attributes during decoding and encoding"""
127
112
 
@@ -149,7 +134,7 @@ class SuppliedQuantityCoder(SuppliedAttributesCoder):
149
134
  super().__init__({"type": "quantity", "units": units})
150
135
 
151
136
 
152
- class VisiblityCoder(SuppliedQuantityCoder):
137
+ class VisibilityCoder(SuppliedQuantityCoder):
153
138
  """Visibility coder"""
154
139
 
155
140
  def __init__(self):
@@ -227,7 +212,7 @@ class EpochCoder(MeasuresCoder):
227
212
 
228
213
  def decode(self, variable: Variable, name: T_Name = None) -> Variable:
229
214
  dims, data, attrs, encoding = unpack_for_decoding(variable)
230
- attrs["type"] = self.measures_adapter.msv4_type()
215
+ attrs["type"] = self.measures_adapter.msv4_type("raise")
231
216
  attrs["units"] = self.measures_adapter.quantum_unit("raise")
232
217
  attrs["format"] = "unix"
233
218
  if (msv2_frame := self.measures_adapter.msv2_frame("raise")) == "UTC":
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
File without changes
File without changes
File without changes
File without changes
File without changes