Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update core for ASDF standard 1.6.0 #422

Merged
merged 13 commits into from
Mar 5, 2024
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The stable ASDF Standard is v1.5.0
- Drop support for python 3.8 [#390]
- Add ``float16`` to ``ndarray-1.1.0`` [#411]
- Remove unneeded ``tag`` keyword from ``fits`` schema [#421]
- Move non-core tags to ``astronomy`` manifest [#422]

1.0.3 (2022-08-08)
------------------
Expand Down
13 changes: 5 additions & 8 deletions docs/source/schemas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,16 @@ of ASDF files serves the following purposes:

All ASDF implementations must implement the types defined by the `core schemas
<core-schema>` and validate against them when reading files. [#]_ The ASDF
Standard also defines two other categories of schemas, which are optional
for ASDF implementations:
Standard also defines other schemas, which are optional for ASDF implementations
and maintained as part of the standard (mainly for historical reasons):

* :ref:`unit <unit-schema>`
* :ref:`time <time-schema>`

.. Fits is deliberately omitted from this list.
* :ref:`astronomy <astronomy-schema>`

The ASDF Standard also defines two metaschemas which are used to validate the
ASDF schemas themselves:

* :ref:`yaml-schema`
* :ref:`ASDF Schema <asdf-schema-1.0.0>`
* :ref:`ASDF Schema <asdf-schema-1.1.0>`

More information on the schemas defined by ASDF can be found in :ref:`schema`.

Expand Down Expand Up @@ -63,7 +60,7 @@ so will have the following top-level attribute::

$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"

Some ASDF schemas use the :ref:`ASDF metaschema <asdf-schema-1.0.0>` instead
Some ASDF schemas use the :ref:`ASDF metaschema <asdf-schema-1.1.0>` instead
(e.g. `ndarray <core/ndarray-1.0.0>`). It is also possible to create custom
metaschemas, although these should always inherit from either YAML Schema or
the ASDF metaschema. [#]_
Expand Down
18 changes: 18 additions & 0 deletions docs/source/schemas/astronomy.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.. _astronomy-schema:

Astronomy
=========

The ASDF-standard contains a few astronomy-specific tags that
are optional but maintained as part of the standard (for historical
reasons). These include:

.. asdf-autoschemas::

fits/fits-1.1.0
table/column-1.1.0
table/table-1.1.0
time/time-1.2.0
unit/unit-1.0.0
unit/defunit-1.0.0
unit/quantity-1.2.0
5 changes: 1 addition & 4 deletions docs/source/schemas/core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@ asdf library.

core/asdf-1.1.0
core/complex-1.0.0
core/extension_metadata-1.0.0
core/ndarray-1.1.0
core/table-1.1.0
core/column-1.1.0
core/constant-1.0.0
core/software-1.0.0
core/history_entry-1.0.0
core/extension_metadata-1.0.0
core/integer-1.1.0
core/externalarray-1.0.0
core/subclass_metadata-1.0.0
11 changes: 0 additions & 11 deletions docs/source/schemas/fits.rst

This file was deleted.

15 changes: 2 additions & 13 deletions docs/source/schemas/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ must support the "core" module, but the other modules are optional.
:maxdepth: 2

core.rst
fits.rst
unit.rst
time.rst
astronomy.rst
legacy.rst

The ASDF Standard also defines two meta-schemas that are used for validating
Expand All @@ -33,16 +31,7 @@ custom schemas (see `extending-asdf`).

.. asdf-autoschemas::

asdf-schema-1.0.0

The following graph shows the dependencies between modules:

.. digraph:: modules

"fits" -> "core"
"unit" -> "core"
"time" -> "core"
"core" -> "unit"
asdf-schema-1.1.0

.. _manifest:

Expand Down
19 changes: 10 additions & 9 deletions docs/source/schemas/legacy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ The following legacy schemas and not part of the most recent ASDF standard versi

.. asdf-autoschemas::

core/asdf-1.0.0
core/column-1.0.0
core/integer-1.0.0
core/ndarray-1.0.0
core/table-1.0.0
fits/fits-1.0.0
time/time-1.0.0
time/time-1.1.0
unit/quantity-1.1.0
core/asdf-1.0.0
core/column-1.0.0
core/integer-1.0.0
core/ndarray-1.0.0
core/subclass_metadata-1.0.0
core/table-1.0.0
fits/fits-1.0.0
time/time-1.0.0
time/time-1.1.0
unit/quantity-1.1.0
8 changes: 8 additions & 0 deletions docs/source/schemas/manifest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,11 @@ by a single manifest document for that ASDF standard version.
core-1.4.0
core-1.5.0
core-1.6.0

The non-core (astronomy) tags are described separately:

.. asdf-autoschemas::
:schema_root: ../../resources/manifests
:standard_prefix: asdf-format.org/astronomy

astronomy-1.0.0
11 changes: 0 additions & 11 deletions docs/source/schemas/time.rst

This file was deleted.

12 changes: 0 additions & 12 deletions docs/source/schemas/unit.rst

This file was deleted.

96 changes: 96 additions & 0 deletions resources/manifests/asdf-format.org/astronomy/astronomy-1.0.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
id: asdf://asdf-format.org/astronomy/manifests/astronomy-1.0.0
extension_uri: asdf://asdf-format.org/astronomy/extensions/astronomy-1.0.0
title: ASDF astronomy extension 1.0.0
description: Astronomy related (non-core) ASDF objects
asdf_standard_requirement:
gte: 1.6.0
tags:
- tag_uri: tag:stsci.edu:asdf/table/column-1.1.0
schema_uri: http://stsci.edu/schemas/asdf/table/column-1.1.0
title: A column in a table.
description: |-
Each column contains a name and an array of data, and an optional description
and unit.
- tag_uri: tag:stsci.edu:asdf/unit/defunit-1.0.0
schema_uri: http://stsci.edu/schemas/asdf/unit/defunit-1.0.0
title: Define a new physical unit.
description: |-
Defines a new unit. It can be used to either:

- Define a new base unit.

- Create a new unit name that is a equivalent to a given unit.

The new unit must be defined before any unit tags that use it.
- tag_uri: tag:stsci.edu:asdf/fits/fits-1.1.0
schema_uri: http://stsci.edu/schemas/asdf/fits/fits-1.1.0
title: A FITS file inside of an ASDF file.
description: |-
This schema is useful for distributing ASDF files that can
automatically be converted to FITS files by specifying the exact
content of the resulting FITS file.

Not all kinds of data in FITS are directly representable in ASDF.
For example, applying an offset and scale to the data using the
`BZERO` and `BSCALE` keywords. In these cases, it will not be
possible to store the data in the native format from FITS and also
be accessible in its proper form in the ASDF file.

Only image and binary table extensions are supported.
- tag_uri: tag:stsci.edu:asdf/unit/quantity-1.2.0
schema_uri: http://stsci.edu/schemas/asdf/unit/quantity-1.2.0
title: Represents a Quantity object from astropy
description: |-
A Quantity object represents a value that has some unit
associated with the number.
- tag_uri: tag:stsci.edu:asdf/table/table-1.1.0
schema_uri: http://stsci.edu/schemas/asdf/table/table-1.1.0
title: A table.
description: |-
A table is represented as a list of columns, where each entry is a
[column](ref:table/column-1.1.0)
object, containing the data and some additional information.

The data itself may be stored inline as text, or in binary in either
row- or column-major order by use of the `strides` property on the
individual column arrays.

Each column in the table must have the same first (slowest moving)
dimension.
- tag_uri: tag:stsci.edu:asdf/time/time-1.2.0
schema_uri: http://stsci.edu/schemas/asdf/time/time-1.2.0
title: Represents an instance in time.
description: |-
A "time" is a single instant in time. It may explicitly specify the
way time is represented (the "format") and the "scale" which
specifies the offset and scaling relation of the unit of time.

Specific emphasis is placed on supporting time scales (e.g. UTC,
TAI, UT1, TDB) and time representations (e.g. JD, MJD, ISO 8601)
that are used in astronomy and required to calculate, e.g., sidereal
times and barycentric corrections.

Times may be represented as one of the following:

- an object, with explicit `value`, and optional `format`, `scale`
and `location`.

- a string, in which case the format is guessed from across
the unambiguous options (`iso`, `byear`, `jyear`, `yday`), and the
scale is hardcoded to `UTC`.

In either case, a single time tag may be used to represent an
n-dimensional array of times, using either an `ndarray` tag or
inline as (possibly nested) YAML lists. If YAML lists, the same
format must be used for all time values.

The precision of the numeric formats should only be assumed to be as
good as an IEEE-754 double precision (float64) value. If
higher-precision is required, the `iso` or `yday` format should be
used.
- tag_uri: tag:stsci.edu:asdf/unit/unit-1.0.0
schema_uri: http://stsci.edu/schemas/asdf/unit/unit-1.0.0
title: Physical unit.
description: |-
This represents a physical unit, in [VOUnit syntax, Version 1.0](http://www.ivoa.net/documents/VOUnits/index.html).
Where units are not explicitly tagged, they are assumed to be in VOUnit syntax.
95 changes: 0 additions & 95 deletions resources/manifests/asdf-format.org/core/core-1.6.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ tags:
schema_uri: http://stsci.edu/schemas/asdf/core/asdf-1.1.0
title: Top-level schema for every ASDF file.
description: This schema contains the top-level attributes for every ASDF file.
- tag_uri: tag:stsci.edu:asdf/core/column-1.1.0
schema_uri: http://stsci.edu/schemas/asdf/core/column-1.1.0
title: A column in a table.
description: |-
Each column contains a name and an array of data, and an optional description
and unit.
- tag_uri: tag:stsci.edu:asdf/core/complex-1.0.0
schema_uri: http://stsci.edu/schemas/asdf/core/complex-1.0.0
title: Complex number value.
Expand Down Expand Up @@ -88,92 +82,3 @@ tags:
schema_uri: http://stsci.edu/schemas/asdf/core/software-1.0.0
title: Describes a software package.
description: General-purpose description of a software package.
- tag_uri: tag:stsci.edu:asdf/core/subclass_metadata-1.0.0
schema_uri: http://stsci.edu/schemas/asdf/core/subclass_metadata-1.0.0
title: Metadata on a serialized subclass of an ASDF-enabled type.
description: |-
Identifies the specific subclass that was serialized,
to enable ASDF readers to correctly deserialize the object.
- tag_uri: tag:stsci.edu:asdf/core/table-1.1.0
schema_uri: http://stsci.edu/schemas/asdf/core/table-1.1.0
title: A table.
description: |-
A table is represented as a list of columns, where each entry is a
[column](ref:core/column-1.1.0)
object, containing the data and some additional information.

The data itself may be stored inline as text, or in binary in either
row- or column-major order by use of the `strides` property on the
individual column arrays.

Each column in the table must have the same first (slowest moving)
dimension.
- tag_uri: tag:stsci.edu:asdf/fits/fits-1.1.0
schema_uri: http://stsci.edu/schemas/asdf/fits/fits-1.1.0
title: A FITS file inside of an ASDF file.
description: |-
This schema is useful for distributing ASDF files that can
automatically be converted to FITS files by specifying the exact
content of the resulting FITS file.

Not all kinds of data in FITS are directly representable in ASDF.
For example, applying an offset and scale to the data using the
`BZERO` and `BSCALE` keywords. In these cases, it will not be
possible to store the data in the native format from FITS and also
be accessible in its proper form in the ASDF file.

Only image and binary table extensions are supported.
- tag_uri: tag:stsci.edu:asdf/time/time-1.2.0
schema_uri: http://stsci.edu/schemas/asdf/time/time-1.2.0
title: Represents an instance in time.
description: |-
A "time" is a single instant in time. It may explicitly specify the
way time is represented (the "format") and the "scale" which
specifies the offset and scaling relation of the unit of time.

Specific emphasis is placed on supporting time scales (e.g. UTC,
TAI, UT1, TDB) and time representations (e.g. JD, MJD, ISO 8601)
that are used in astronomy and required to calculate, e.g., sidereal
times and barycentric corrections.

Times may be represented as one of the following:

- an object, with explicit `value`, and optional `format`, `scale`
and `location`.

- a string, in which case the format is guessed from across
the unambiguous options (`iso`, `byear`, `jyear`, `yday`), and the
scale is hardcoded to `UTC`.

In either case, a single time tag may be used to represent an
n-dimensional array of times, using either an `ndarray` tag or
inline as (possibly nested) YAML lists. If YAML lists, the same
format must be used for all time values.

The precision of the numeric formats should only be assumed to be as
good as an IEEE-754 double precision (float64) value. If
higher-precision is required, the `iso` or `yday` format should be
used.
- tag_uri: tag:stsci.edu:asdf/unit/defunit-1.0.0
schema_uri: http://stsci.edu/schemas/asdf/unit/defunit-1.0.0
title: Define a new physical unit.
description: |-
Defines a new unit. It can be used to either:

- Define a new base unit.

- Create a new unit name that is a equivalent to a given unit.

The new unit must be defined before any unit tags that use it.
- tag_uri: tag:stsci.edu:asdf/unit/quantity-1.2.0
schema_uri: http://stsci.edu/schemas/asdf/unit/quantity-1.2.0
title: Represents a Quantity object from astropy
description: |-
A Quantity object represents a value that has some unit
associated with the number.
- tag_uri: tag:stsci.edu:asdf/unit/unit-1.0.0
schema_uri: http://stsci.edu/schemas/asdf/unit/unit-1.0.0
title: Physical unit.
description: |-
This represents a physical unit, in [VOUnit syntax, Version 1.0](http://www.ivoa.net/documents/VOUnits/index.html).
Where units are not explicitly tagged, they are assumed to be in VOUnit syntax.
Loading
Loading