lsst-felis 27.2024.2900__tar.gz → 27.2024.3000__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.

Potentially problematic release.


This version of lsst-felis might be problematic. Click here for more details.

Files changed (31) hide show
  1. {lsst_felis-27.2024.2900/python/lsst_felis.egg-info → lsst_felis-27.2024.3000}/PKG-INFO +1 -1
  2. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/python/felis/datamodel.py +3 -3
  3. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/python/felis/tap.py +24 -7
  4. lsst_felis-27.2024.3000/python/felis/version.py +2 -0
  5. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000/python/lsst_felis.egg-info}/PKG-INFO +1 -1
  6. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/tests/test_tap.py +1 -3
  7. lsst_felis-27.2024.2900/python/felis/version.py +0 -2
  8. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/COPYRIGHT +0 -0
  9. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/LICENSE +0 -0
  10. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/README.rst +0 -0
  11. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/pyproject.toml +0 -0
  12. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/python/felis/__init__.py +0 -0
  13. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/python/felis/cli.py +0 -0
  14. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/python/felis/db/__init__.py +0 -0
  15. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/python/felis/db/dialects.py +0 -0
  16. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/python/felis/db/sqltypes.py +0 -0
  17. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/python/felis/db/utils.py +0 -0
  18. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/python/felis/db/variants.py +0 -0
  19. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/python/felis/metadata.py +0 -0
  20. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/python/felis/py.typed +0 -0
  21. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/python/felis/types.py +0 -0
  22. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/python/lsst_felis.egg-info/SOURCES.txt +0 -0
  23. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/python/lsst_felis.egg-info/dependency_links.txt +0 -0
  24. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/python/lsst_felis.egg-info/entry_points.txt +0 -0
  25. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/python/lsst_felis.egg-info/requires.txt +0 -0
  26. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/python/lsst_felis.egg-info/top_level.txt +0 -0
  27. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/python/lsst_felis.egg-info/zip-safe +0 -0
  28. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/setup.cfg +0 -0
  29. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/tests/test_cli.py +0 -0
  30. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/tests/test_datamodel.py +0 -0
  31. {lsst_felis-27.2024.2900 → lsst_felis-27.2024.3000}/tests/test_metadata.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lsst-felis
3
- Version: 27.2024.2900
3
+ Version: 27.2024.3000
4
4
  Summary: A vocabulary for describing catalogs and acting on those descriptions
5
5
  Author-email: Rubin Observatory Data Management <dm-admin@lists.lsst.org>
6
6
  License: GNU General Public License v3 or later (GPLv3+)
@@ -26,7 +26,7 @@ from __future__ import annotations
26
26
  import logging
27
27
  from collections.abc import Mapping, Sequence
28
28
  from enum import StrEnum, auto
29
- from typing import Annotated, Any, Literal, TypeAlias
29
+ from typing import Annotated, Any, TypeAlias
30
30
 
31
31
  from astropy import units as units # type: ignore
32
32
  from astropy.io.votable import ucd # type: ignore
@@ -178,7 +178,7 @@ class Column(BaseObject):
178
178
  tap_principal: int | None = Field(0, alias="tap:principal", ge=0, le=1)
179
179
  """Whether this is a TAP_SCHEMA principal column."""
180
180
 
181
- votable_arraysize: int | Literal["*"] | None = Field(None, alias="votable:arraysize")
181
+ votable_arraysize: int | str | None = Field(None, alias="votable:arraysize")
182
182
  """VOTable arraysize of the column."""
183
183
 
184
184
  tap_std: int | None = Field(0, alias="tap:std", ge=0, le=1)
@@ -711,7 +711,7 @@ class SchemaIdVisitor:
711
711
  class Schema(BaseObject):
712
712
  """Database schema model.
713
713
 
714
- This is the root object of the Felis data model.
714
+ This represents a database schema, which contains one or more tables.
715
715
  """
716
716
 
717
717
  version: SchemaVersion | str | None = None
@@ -24,6 +24,7 @@
24
24
  from __future__ import annotations
25
25
 
26
26
  import logging
27
+ import re
27
28
  from collections.abc import Iterable, MutableMapping
28
29
  from typing import Any
29
30
 
@@ -125,7 +126,7 @@ def init_tables(
125
126
  arraysize = Column(String(10))
126
127
  xtype = Column(String(SIMPLE_FIELD_LENGTH))
127
128
  # Size is deprecated
128
- # size = Column(Integer(), quote=True)
129
+ size = Column("size", Integer(), quote=True)
129
130
  description = Column(String(TEXT_FIELD_LENGTH))
130
131
  utype = Column(String(SIMPLE_FIELD_LENGTH))
131
132
  unit = Column(String(SIMPLE_FIELD_LENGTH))
@@ -406,12 +407,28 @@ class TapLoadingVisitor:
406
407
  felis_type = FelisType.felis_type(felis_datatype.value)
407
408
  column.datatype = column_obj.votable_datatype or felis_type.votable_name
408
409
 
409
- arraysize = None
410
- if felis_type.is_sized:
411
- arraysize = column_obj.votable_arraysize or column_obj.length or "*"
412
- if felis_type.is_timestamp:
413
- arraysize = column_obj.votable_arraysize or "*"
414
- column.arraysize = arraysize
410
+ column.arraysize = column_obj.votable_arraysize or column_obj.length
411
+ if (felis_type.is_timestamp or column_obj.datatype == "text") and column.arraysize is None:
412
+ column.arraysize = "*"
413
+
414
+ def _is_int(s: str) -> bool:
415
+ try:
416
+ int(s)
417
+ return True
418
+ except ValueError:
419
+ return False
420
+
421
+ # Handle the deprecated size attribute
422
+ arraysize = column_obj.votable_arraysize
423
+ if arraysize is not None and arraysize != "":
424
+ if isinstance(arraysize, int):
425
+ column.size = arraysize
426
+ elif _is_int(arraysize):
427
+ column.size = int(arraysize)
428
+ elif bool(re.match(r"^[0-9]+\*$", arraysize)):
429
+ column.size = int(arraysize.replace("*", ""))
430
+ if column.size is not None:
431
+ logger.debug(f"Set size to {column.size} for {column.column_name} from arraysize {arraysize}")
415
432
 
416
433
  column.xtype = column_obj.votable_xtype
417
434
  column.description = column_obj.description
@@ -0,0 +1,2 @@
1
+ __all__ = ["__version__"]
2
+ __version__ = "27.2024.3000"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lsst-felis
3
- Version: 27.2024.2900
3
+ Version: 27.2024.3000
4
4
  Summary: A vocabulary for describing catalogs and acting on those descriptions
5
5
  Author-email: Rubin Observatory Data Management <dm-admin@lists.lsst.org>
6
6
  License: GNU General Public License v3 or later (GPLv3+)
@@ -23,8 +23,6 @@ import os
23
23
  import shutil
24
24
  import tempfile
25
25
  import unittest
26
- from collections.abc import MutableMapping
27
- from typing import Any
28
26
 
29
27
  import sqlalchemy
30
28
  import yaml
@@ -39,7 +37,7 @@ TEST_YAML = os.path.join(TESTDIR, "data", "test.yml")
39
37
  class VisitorTestCase(unittest.TestCase):
40
38
  """Test the TAP loading visitor."""
41
39
 
42
- schema_obj: MutableMapping[str, Any] = {}
40
+ schema_obj: Schema
43
41
 
44
42
  def setUp(self) -> None:
45
43
  """Load data from a test file."""
@@ -1,2 +0,0 @@
1
- __all__ = ["__version__"]
2
- __version__ = "27.2024.2900"