lsst-felis 29.2025.1700__py3-none-any.whl → 29.2025.1900__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.
Potentially problematic release.
This version of lsst-felis might be problematic. Click here for more details.
- felis/cli.py +6 -1
- felis/datamodel.py +20 -0
- felis/tests/run_cli.py +79 -0
- {lsst_felis-29.2025.1700.dist-info → lsst_felis-29.2025.1900.dist-info}/METADATA +1 -1
- {lsst_felis-29.2025.1700.dist-info → lsst_felis-29.2025.1900.dist-info}/RECORD +11 -10
- {lsst_felis-29.2025.1700.dist-info → lsst_felis-29.2025.1900.dist-info}/WHEEL +1 -1
- {lsst_felis-29.2025.1700.dist-info → lsst_felis-29.2025.1900.dist-info}/entry_points.txt +0 -0
- {lsst_felis-29.2025.1700.dist-info → lsst_felis-29.2025.1900.dist-info}/licenses/COPYRIGHT +0 -0
- {lsst_felis-29.2025.1700.dist-info → lsst_felis-29.2025.1900.dist-info}/licenses/LICENSE +0 -0
- {lsst_felis-29.2025.1700.dist-info → lsst_felis-29.2025.1900.dist-info}/top_level.txt +0 -0
- {lsst_felis-29.2025.1700.dist-info → lsst_felis-29.2025.1900.dist-info}/zip-safe +0 -0
felis/cli.py
CHANGED
|
@@ -63,7 +63,10 @@ loglevel_choices = ["CRITICAL", "FATAL", "ERROR", "WARNING", "INFO", "DEBUG"]
|
|
|
63
63
|
help="Felis log file path",
|
|
64
64
|
)
|
|
65
65
|
@click.option(
|
|
66
|
-
"--id-generation",
|
|
66
|
+
"--id-generation/--no-id-generation",
|
|
67
|
+
is_flag=True,
|
|
68
|
+
help="Generate IDs for all objects that do not have them",
|
|
69
|
+
default=True,
|
|
67
70
|
)
|
|
68
71
|
@click.pass_context
|
|
69
72
|
def cli(ctx: click.Context, log_level: str, log_file: str | None, id_generation: bool) -> None:
|
|
@@ -72,6 +75,8 @@ def cli(ctx: click.Context, log_level: str, log_file: str | None, id_generation:
|
|
|
72
75
|
ctx.obj["id_generation"] = id_generation
|
|
73
76
|
if ctx.obj["id_generation"]:
|
|
74
77
|
logger.info("ID generation is enabled")
|
|
78
|
+
else:
|
|
79
|
+
logger.info("ID generation is disabled")
|
|
75
80
|
if log_file:
|
|
76
81
|
logging.basicConfig(filename=log_file, level=log_level)
|
|
77
82
|
else:
|
felis/datamodel.py
CHANGED
|
@@ -504,6 +504,26 @@ class Column(BaseObject):
|
|
|
504
504
|
"""
|
|
505
505
|
return DataType(value)
|
|
506
506
|
|
|
507
|
+
@model_validator(mode="after")
|
|
508
|
+
def check_votable_xtype(self) -> Column:
|
|
509
|
+
"""Set the default value for the ``votable_xtype`` field, which
|
|
510
|
+
corresponds to an Extended Datatype or ``xtype`` in the IVOA VOTable
|
|
511
|
+
standard.
|
|
512
|
+
|
|
513
|
+
Returns
|
|
514
|
+
-------
|
|
515
|
+
`Column`
|
|
516
|
+
The column being validated.
|
|
517
|
+
|
|
518
|
+
Notes
|
|
519
|
+
-----
|
|
520
|
+
This is currently only set automatically for the Felis ``timestamp``
|
|
521
|
+
datatype.
|
|
522
|
+
"""
|
|
523
|
+
if self.datatype == DataType.timestamp and self.votable_xtype is None:
|
|
524
|
+
self.votable_xtype = "timestamp"
|
|
525
|
+
return self
|
|
526
|
+
|
|
507
527
|
|
|
508
528
|
class Constraint(BaseObject):
|
|
509
529
|
"""Table constraint model."""
|
felis/tests/run_cli.py
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"""Test utility for running cli commands."""
|
|
2
|
+
|
|
3
|
+
# This file is part of felis.
|
|
4
|
+
#
|
|
5
|
+
# Developed for the LSST Data Management System.
|
|
6
|
+
# This product includes software developed by the LSST Project
|
|
7
|
+
# (https://www.lsst.org).
|
|
8
|
+
# See the COPYRIGHT file at the top-level directory of this distribution
|
|
9
|
+
# for details of code ownership.
|
|
10
|
+
#
|
|
11
|
+
# This program is free software: you can redistribute it and/or modify
|
|
12
|
+
# it under the terms of the GNU General Public License as published by
|
|
13
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
# (at your option) any later version.
|
|
15
|
+
#
|
|
16
|
+
# This program is distributed in the hope that it will be useful,
|
|
17
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
# GNU General Public License for more details.
|
|
20
|
+
#
|
|
21
|
+
# You should have received a copy of the GNU General Public License
|
|
22
|
+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
23
|
+
|
|
24
|
+
import logging
|
|
25
|
+
|
|
26
|
+
from click.testing import CliRunner
|
|
27
|
+
|
|
28
|
+
from felis.cli import cli
|
|
29
|
+
|
|
30
|
+
__all__ = ["run_cli"]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def run_cli(
|
|
34
|
+
cmd: list[str],
|
|
35
|
+
log_level: int = logging.WARNING,
|
|
36
|
+
catch_exceptions: bool = False,
|
|
37
|
+
expect_error: bool = False,
|
|
38
|
+
print_cmd: bool = False,
|
|
39
|
+
print_output: bool = False,
|
|
40
|
+
id_generation: bool = False,
|
|
41
|
+
) -> None:
|
|
42
|
+
"""Run a CLI command and check the exit code.
|
|
43
|
+
|
|
44
|
+
Parameters
|
|
45
|
+
----------
|
|
46
|
+
cmd : list[str]
|
|
47
|
+
The command to run.
|
|
48
|
+
log_level : int
|
|
49
|
+
The logging level to use, by default logging.WARNING.
|
|
50
|
+
catch_exceptions : bool
|
|
51
|
+
Whether to catch exceptions, by default False.
|
|
52
|
+
expect_error : bool
|
|
53
|
+
Whether to expect an error, by default False.
|
|
54
|
+
print_cmd : bool
|
|
55
|
+
Whether to print the command, by default False.
|
|
56
|
+
print_output : bool
|
|
57
|
+
Whether to print the output, by default False.
|
|
58
|
+
id_generation : bool
|
|
59
|
+
Whether to enable id generation, by default False.
|
|
60
|
+
"""
|
|
61
|
+
if not cmd:
|
|
62
|
+
raise ValueError("No command provided.")
|
|
63
|
+
full_cmd = ["--log-level", logging.getLevelName(log_level)] + cmd
|
|
64
|
+
if id_generation:
|
|
65
|
+
full_cmd = ["--id-generation"] + full_cmd
|
|
66
|
+
if print_cmd:
|
|
67
|
+
print(f"Running command: felis {' '.join(full_cmd)}")
|
|
68
|
+
runner = CliRunner()
|
|
69
|
+
result = runner.invoke(
|
|
70
|
+
cli,
|
|
71
|
+
full_cmd,
|
|
72
|
+
catch_exceptions=catch_exceptions,
|
|
73
|
+
)
|
|
74
|
+
if print_output:
|
|
75
|
+
print(result.output)
|
|
76
|
+
if expect_error:
|
|
77
|
+
assert result.exit_code != 0
|
|
78
|
+
else:
|
|
79
|
+
assert result.exit_code == 0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lsst-felis
|
|
3
|
-
Version: 29.2025.
|
|
3
|
+
Version: 29.2025.1900
|
|
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+)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
felis/__init__.py,sha256=HnwWzLaPOSnPzAoppSIHzTrGfixEgvkzJdBxa8-03cw,1294
|
|
2
|
-
felis/cli.py,sha256=
|
|
3
|
-
felis/datamodel.py,sha256=
|
|
2
|
+
felis/cli.py,sha256=hHixypAU3y0y4DiZ1vyKHp0QvMLWiR6_jVLl6st3Sgg,15668
|
|
3
|
+
felis/datamodel.py,sha256=iKL-B2CkiVLKDrlHFkRC9UXGg9uEEwsMEg34Hyws2tM,43686
|
|
4
4
|
felis/diff.py,sha256=z4ZzUocFYVa2y22BWUAMkeeLORmMtaWIDGTVaUE1OIM,7181
|
|
5
5
|
felis/metadata.py,sha256=cYx_qizkLBqcoxWV46h4TbwTi1KVJAkuA2OuUmD-K5k,13536
|
|
6
6
|
felis/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -15,11 +15,12 @@ felis/db/variants.py,sha256=eahthrbVeV8ZdGamWQccNmWgx6CCscGrU0vQRs5HZK8,5260
|
|
|
15
15
|
felis/schemas/tap_schema_std.yaml,sha256=sPW-Vk72nY0PFpCvP5d8L8fWvhkif-x32sGtcfDZ8bU,7131
|
|
16
16
|
felis/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
felis/tests/postgresql.py,sha256=B_xk4fLual5-viGDqP20r94okuc0pbSvytRH_L0fvMs,4035
|
|
18
|
-
|
|
19
|
-
lsst_felis-29.2025.
|
|
20
|
-
lsst_felis-29.2025.
|
|
21
|
-
lsst_felis-29.2025.
|
|
22
|
-
lsst_felis-29.2025.
|
|
23
|
-
lsst_felis-29.2025.
|
|
24
|
-
lsst_felis-29.2025.
|
|
25
|
-
lsst_felis-29.2025.
|
|
18
|
+
felis/tests/run_cli.py,sha256=Gg8loUIGj9t6KlkRKrEc9Z9b5dtlkpJy94ORuj4BrxU,2503
|
|
19
|
+
lsst_felis-29.2025.1900.dist-info/licenses/COPYRIGHT,sha256=vJAFLFTSF1mhy9eIuA3P6R-3yxTWKQgpig88P-1IzRw,129
|
|
20
|
+
lsst_felis-29.2025.1900.dist-info/licenses/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
|
|
21
|
+
lsst_felis-29.2025.1900.dist-info/METADATA,sha256=hxHC5UOffAThgTIaI5qTlYcJLfpU2b2-AxwlGa0FWVw,1433
|
|
22
|
+
lsst_felis-29.2025.1900.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
|
23
|
+
lsst_felis-29.2025.1900.dist-info/entry_points.txt,sha256=Gk2XFujA_Gp52VBk45g5kim8TDoMDJFPctsMqiq72EM,40
|
|
24
|
+
lsst_felis-29.2025.1900.dist-info/top_level.txt,sha256=F4SvPip3iZRVyISi50CHhwTIAokAhSxjWiVcn4IVWRI,6
|
|
25
|
+
lsst_felis-29.2025.1900.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
26
|
+
lsst_felis-29.2025.1900.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|