Skip to content

Commit

Permalink
Merge pull request #312 from lsst/tickets/DM-49039
Browse files Browse the repository at this point in the history
DM-49039: Change schema directory to lsst.sdm.schemas
  • Loading branch information
JeremyMcCormick authored Feb 27, 2025
2 parents 463462e + 2d4b2ab commit 70c4db0
Show file tree
Hide file tree
Showing 43 changed files with 96 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Checklist

When making changes to YAML files in the [schemas](/lsst/sdm_schemas/blob/main/python/lsst/sdm_schemas/schemas) directory:
When making changes to YAML files in the [schemas](/lsst/sdm_schemas/blob/main/python/lsst/sdm/schemas) directory:

- [ ] If applicable, incremented the schema version number, following the guidelines in the [contribution guide](/lsst/sdm_schemas/blob/main/CONTRIBUTING.md)
- [ ] Referred to the [documentation on specific schemas](/lsst/sdm_schemas/blob/main/CONTRIBUTING.md#specific-schema-documentation) for additional versioning information, change constraints, or tasks that may need to be performed, based on which schema is being updated
2 changes: 1 addition & 1 deletion .github/workflows/compare.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Set relative path to schema directory
run: |
echo "SCHEMA_DIR=python/lsst/sdm_schemas/schemas" >> $GITHUB_ENV
echo "SCHEMA_DIR=python/lsst/sdm/schemas" >> $GITHUB_ENV
- name: Get list of changed YAML files
working-directory: current-ref
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ python/lsst_sdm_schemas.egg-info
__pycache__

# LSST version
python/lsst/sdm_schemas/version.py
python/lsst/sdm/schemas/version.py

# SCons build
config.log
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Aside from special cases, a pull request will have to pass all of these checks b
These checks will:

- [Build TAP_SCHEMA and DataLink resources](.github/workflows/build.yaml)
- [Compare Schemas for Changes](.github/workflows/compare.yaml) - Schemas that are in the [deployed list](./python/lsst/sdm_schemas/schemas/deployed-schemas.txt) will fail this check.
- [Compare Schemas for Changes](.github/workflows/compare.yaml) - Schemas that are in the [deployed list](./python/lsst/sdm/schemas/deployed-schemas.txt) will fail this check.
- [Build the Schema Browser website](.github/workflows/docs.yaml)
- [Check that `main` is not merged into the branch](.github/workflows/rebase_checker.yaml)
- [Test that the schemas can be used to create databases](.github/workflows/test_databases.yaml)
Expand All @@ -42,7 +42,7 @@ The checks will rerun anytime the PR branch is updated.
Schema Versioning
-----------------

Individual schemas may have their own internal [version](https://felis.lsst.io/user-guide/model.html#schema-version) for tracking changes, which is defined at the top of the file, as in [apdb.yaml](./python/lsst/sdm_schemas/schemas/apdb.yaml).
Individual schemas may have their own internal [version](https://felis.lsst.io/user-guide/model.html#schema-version) for tracking changes, which is defined at the top of the file, as in [apdb.yaml](./python/lsst/sdm/schemas/apdb.yaml).
(This is distinct from tags or versions of sdm_schemas itself, and not all schemas may be using them.)
This version may need to be updated when making changes.

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,41 @@ This repository stores schema definitions for user-facing data
products comprising the Science Data Model (SDM) of the
[Rubin Observatory](https://rubinobservatory.org/).
These schemas are defined in YAML files designed to be read with
[Felis](https://github.com/lsst-dm/felis), a tool which can convert this data
[Felis](https://github.com/lsst/felis), a tool which can convert this data
to derived formats including SQL DDL and
[TAP_SCHEMA](https://www.ivoa.net/documents/TAP/20180830/PR-TAP-1.1-20180830.html#tth_sEc4).
These schema definitions serve as the "source of truth" for the observatory's core data models.

Schemas
-------

The following schemas are maintained in this repository under the [schemas](./python/lsst/sdm_schemas/schemas) directory:
The following schemas are maintained in this repository under the [schemas](./python/lsst/sdm/schemas) directory:

* [imsim](./python/lsst/sdm_schemas/schemas/imsim.yaml) describes the outputs
* [imsim](./python/lsst/sdm/schemas/imsim.yaml) describes the outputs
of the pipelines for LSSTCam-imSim, used to generate the data preview
schemas, which are fixed at the time of their release, while `imsim` will
continue to evolve. This schema is used by
[ci_imsim](https://github.com/lsst/ci_imsim) to verify that the tabular data
of the pipeline output files is conformant with the schema definition.

* The various Data Preview (DP) schemas such as
[dp02_dc2](./python/lsst/sdm_schemas/schemas/dp02_dc2.yaml) represent
[dp02_dc2](./python/lsst/sdm/schemas/dp02_dc2.yaml) represent
content that is being actively served by the various data previews.
These are created from `imsim` at a specific point in time.

* [apdb](./python/lsst/sdm_schemas/schemas/apdb.yaml) describes the schema
* [apdb](./python/lsst/sdm/schemas/apdb.yaml) describes the schema
of the Alert Production Database (APDB) used for Alert Production with
`ap_pipe` and for nightly `ap_verify` runs within continuous integration.
Previous processing runs may differ from the current schema. The
user-queryable Prompt Products Database (PPDB) is expected to have a very similar schema to the APDB.

* [hsc](./python/lsst/sdm_schemas/schemas/hsc.yaml) describes the outputs of
* [hsc](./python/lsst/sdm/schemas/hsc.yaml) describes the outputs of
the latest data release production pipelines for HyperSuprimeCam. This
schema is used by [ci_hsc](https://github.com/lsst/ci_hsc) for verification
of its output files.

* The various `cdb` schemas such as
[cdb_latiss](./python/lsst/sdm_schemas/schemas/cdb_latiss.yaml) describe the
[cdb_latiss](./python/lsst/sdm/schemas/cdb_latiss.yaml) describe the
data model of the [Consolidated Database](https://github.com/lsst-dm/consdb)
or ConsDB, an image metadata database containing summarizations of
Engineering Facilities Database (EFD) telemetry by exposure and visit time windows.
Expand Down
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ scripts.BasicSConstruct(
"sdm_schemas",
disableCc=True,
noCfgFile=True,
versionModuleName="python/lsst/sdm_schemas/version.py"
versionModuleName=None
)
4 changes: 2 additions & 2 deletions docs/APDB.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Alert Production Database (APDB) Schema
=======================================

The [apdb](../python/lsst/sdm_schemas/schemas/apdb.yaml) schema describes the Alert Production Database (APDB), which contains the results of processing from the [Alert Production Pipeline](https://github.com/lsst/ap_pipe).
The [apdb](../python/lsst/sdm/schemas/apdb.yaml) schema describes the Alert Production Database (APDB), which contains the results of processing from the [Alert Production Pipeline](https://github.com/lsst/ap_pipe).

Schema Versioning
-----------------

The versioning system of the APDB is outlined in [DMTN-269](https://dmtn-269.lsst.io/).
The deployed database schema is a product of the [schema in sdm_schemas](../python/lsst/sdm_schemas/schemas/apdb.yaml) with additional processing by the APDB client library from the [dax_apdb](https://github.com/lsst/dax_apdb) repository.
The deployed database schema is a product of the [schema in sdm_schemas](../python/lsst/sdm/schemas/apdb.yaml) with additional processing by the APDB client library from the [dax_apdb](https://github.com/lsst/dax_apdb) repository.
Compatibility of the client executable with the actual database schema is determined by the version number in the YAML file and the version stored in the database metadata.

Backward compatibility in the context of the APDB implies that a client using a schema with a higher minor version will be able to read and write into a database with a lower minor version -- in other words, an existing database instance need not be migrated to match the newer client interface.
Expand Down
4 changes: 2 additions & 2 deletions docs/DRP.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ When new major data release productions occur, e.g., a new Data Preview or Data
HSC Schema
----------

The [HSC schema](../python/lsst/sdm_schemas/schemas/hsc.yaml) maps to the live pipelines as configured for the Subaru Hypersuprime-Cam instrument and its Strategic Survey Program, one of the primary precursor datasets used for LSST development.
The [HSC schema](../python/lsst/sdm/schemas/hsc.yaml) maps to the live pipelines as configured for the Subaru Hypersuprime-Cam instrument and its Strategic Survey Program, one of the primary precursor datasets used for LSST development.
The [ci_hsc_gen3](/lsst/ci_hsc_gen3) package is run in nightly Jenkins tests, as well as optionally prior to other pipeline code merges, and checks that the HSC schema matches the Parquet datasets produced by the pipeline definition at [`drp_pipe/pipelines/HSC/DRP-ci_hsc.yaml`](/lsst/drp_pipe/blob/main/pipelines/HSC/DRP-ci_hsc.yaml).
The other HSC pipelines in [drp_pipe](/lsst/drp_pipe) should produce files with the same schemas as well, because they share almost all configuration with the [ci_hsc](/lsst/ci_hsc) pipeline.

ImSim Schema
------------

The [ImSim schema](../python/lsst/sdm_schemas/schemas/imsim.yaml) similarly maps to the live pipelines as configured for the LSST ImSim simulator, in particular as run for the [LSST Dark Energy Science Collaboration](https://lsstdesc.org/)'s "Data Challenge 2" project ([DESC DC2](https://dp0-2.lsst.io/)).
The [ImSim schema](../python/lsst/sdm/schemas/imsim.yaml) similarly maps to the live pipelines as configured for the LSST ImSim simulator, in particular as run for the [LSST Dark Energy Science Collaboration](https://lsstdesc.org/)'s "Data Challenge 2" project ([DESC DC2](https://dp0-2.lsst.io/)).
This is the same simulated dataset used for LSST's Data Preview 0.1 and 0.2, but the pipelines have evolved considerably since those productions.
The [ci_imsim](/lsst/ci_imsim) package is run nightly in Jenkins, as well as optionally prior to other pipeline code merges, and checks that the ImSim schema match the Parquet datasets produced by the pipeline definition at [`drp_pipe/pipelines/LSSTCam-imSim/DRP-ci_imsim.yaml`](https://github.com/lsst/drp_pipe/blob/main/pipelines/LSSTCam-imSim/DRP-ci_imsim.yaml).
The other `LSSTCam-imSim` pipelines in `drp_pipe` should produce files with the same schemas as well, because they share almost all configuration with the `ci_imsim` pipeline.
Expand Down
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ dynamic = ["version"]
[tool.setuptools.dynamic]
version = { attr = "lsst_versions.get_lsst_version" }

[tool.lsst_versions]
write_to = "python/lsst/sdm_schemas/version.py"

[project.urls]
Homepage = "https://sdm-schemas.lsst.io"
Source = "https://github.com/lsst/sdm_schemas"
Expand All @@ -55,4 +52,4 @@ license-files = ["COPYRIGHT", "LICENSE"]
where = ["python"]

[tool.setuptools.package-data]
"lsst.sdm_schemas" = ["schemas/*.yaml"]
"lsst.sdm.schemas" = ["**/*.yaml"]
24 changes: 24 additions & 0 deletions python/lsst/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This file is part of sdm_schemas.
#
# Developed for the LSST Data Management System.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

import pkgutil

__path__ = pkgutil.extend_path(__path__, __name__)
24 changes: 24 additions & 0 deletions python/lsst/sdm/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This file is part of sdm_schemas.
#
# Developed for the LSST Data Management System.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

import pkgutil

__path__ = pkgutil.extend_path(__path__, __name__)
28 changes: 28 additions & 0 deletions python/lsst/sdm/schemas/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file is part of sdm_schemas.
#
# Developed for the LSST Data Management System.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

from importlib.metadata import PackageNotFoundError, version

try:
__version__ = version("lsst-sdm-schemas")
except PackageNotFoundError:
# Package not installed or scons not run.
__version__ = "0.0.0"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
2 changes: 1 addition & 1 deletion tests/test_schema_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class SchemaResourceTestCase(unittest.TestCase):

def test_read_resource(self) -> None:
"""Test that schema data can be read from a resource."""
resource = importlib.resources.files("lsst.sdm_schemas.schemas").joinpath(
resource = importlib.resources.files("lsst.sdm.schemas").joinpath(
"dp02_dc2.yaml"
)
raw_data = resource.read_text()
Expand Down
2 changes: 1 addition & 1 deletion yml

0 comments on commit 70c4db0

Please sign in to comment.