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 ndarray schema to 1.1 to fix issue 345 #350

Merged
merged 3 commits into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The stable ASDF Standard is v1.5.0

- Add new ``quantity-1.2.0`` schema to support ``datatype`` option. [#351]
- Bugfix for ``base_format`` in ``time-1.2.0`` schema. [#349]
- Add new ``ndarray-1.1.0`` schema to fix #345 [#350]

1.0.3 (2022-08-08)
------------------
Expand Down
8 changes: 4 additions & 4 deletions docs/source/schemas/core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ asdf library.

core/asdf-1.1.0
core/complex-1.0.0
core/ndarray-1.0.0
core/table-1.0.0
core/column-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.0.0
core/integer-1.1.0
core/externalarray-1.0.0
core/subclass_metadata-1.0.0
2 changes: 1 addition & 1 deletion docs/source/schemas/fits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ FITS. It can safely be ignored by most ASDF implementations.

.. asdf-autoschemas::

fits/fits-1.0.0
fits/fits-1.1.0
7 changes: 7 additions & 0 deletions docs/source/schemas/legacy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,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/defunit-1.0.0
unit/quantity-1.1.0
unit/unit-1.0.0
4 changes: 2 additions & 2 deletions docs/source/schemas/unit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ The ``unit`` module contains schema to support the units of physical quantities.

.. asdf-autoschemas::

unit/unit-1.0.0
unit/defunit-1.0.0
unit/unit-1.1.0
unit/defunit-1.1.0
unit/quantity-1.2.0
30 changes: 15 additions & 15 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,8 +8,8 @@ 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.0.0
schema_uri: http://stsci.edu/schemas/asdf/core/column-1.0.0
- 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
Expand Down Expand Up @@ -63,12 +63,12 @@ tags:
description: |-
A record of an operation that has been performed
upon a file.
- tag_uri: tag:stsci.edu:asdf/core/integer-1.0.0
schema_uri: http://stsci.edu/schemas/asdf/core/integer-1.0.0
- tag_uri: tag:stsci.edu:asdf/core/integer-1.1.0
schema_uri: http://stsci.edu/schemas/asdf/core/integer-1.1.0
title: Arbitrary precision integer value.
description: Represents an arbitrarily large integer value.
- tag_uri: tag:stsci.edu:asdf/core/ndarray-1.0.0
schema_uri: http://stsci.edu/schemas/asdf/core/ndarray-1.0.0
- tag_uri: tag:stsci.edu:asdf/core/ndarray-1.1.0
schema_uri: http://stsci.edu/schemas/asdf/core/ndarray-1.1.0
title: An *n*-dimensional array.
description: |-
There are two ways to store the data in an ndarray.
Expand All @@ -94,12 +94,12 @@ tags:
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.0.0
schema_uri: http://stsci.edu/schemas/asdf/core/table-1.0.0
- 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.0.0)
[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
Expand All @@ -108,8 +108,8 @@ tags:

Each column in the table must have the same first (slowest moving)
dimension.
- tag_uri: tag:stsci.edu:asdf/fits/fits-1.0.0
schema_uri: http://stsci.edu/schemas/asdf/fits/fits-1.0.0
- 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
Expand Down Expand Up @@ -154,8 +154,8 @@ tags:
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
- tag_uri: tag:stsci.edu:asdf/unit/defunit-1.1.0
schema_uri: http://stsci.edu/schemas/asdf/unit/defunit-1.1.0
title: Define a new physical unit.
description: |-
Defines a new unit. It can be used to either:
Expand All @@ -171,8 +171,8 @@ tags:
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
- tag_uri: tag:stsci.edu:asdf/unit/unit-1.1.0
schema_uri: http://stsci.edu/schemas/asdf/unit/unit-1.1.0
title: Physical unit.
description: |-
This represents a physical unit, in [VOUnit syntax, Version 1.0](http://www.ivoa.net/documents/VOUnits/index.html).
Expand Down
49 changes: 49 additions & 0 deletions resources/schemas/stsci.edu/asdf/core/column-1.1.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "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.

type: object
properties:
name:
description: |
The name of the column. Each name in a
[table](http://stsci.edu/schemas/asdf/core/table-1.1.0) must be
unique.
type: string
pattern: "[A-Za-z_][A-Za-z0-9_]*"

data:
description: |
The array data for the column.
allOf:
- $ref: ndarray-1.1.0

description:
description: |
An optional description of the column.
type: string
default: ''

unit:
description:
An optional unit for the column.
allOf:
- $ref: ../unit/unit-1.1.0

meta:
description:
Additional free-form metadata about the column.
type: object
default: {}

required: [name, data]
additionalProperties: false
...
55 changes: 55 additions & 0 deletions resources/schemas/stsci.edu/asdf/core/integer-1.1.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "http://stsci.edu/schemas/asdf/core/integer-1.1.0"
title: Arbitrary precision integer value.
description: |
Represents an arbitrarily large integer value.

examples:
-
- An integer value that is stored using an internal array
- asdf-standard-1.6.0
- |
!core/integer-1.1.0
sign: +
string: '1193942770599561143856918438330'
words: !core/ndarray-1.1.0
source: 0
datatype: uint32
byteorder: little
shape: [4]

-
- The same integer value is stored using an inline array
- asdf-standard-1.6.0
- |
!core/integer-1.1.0
sign: +
string: '1193942770599561143856918438330'
words: !core/ndarray-1.1.0
data: [1103110586, 1590521629, 299257845, 15]
datatype: uint32
shape: [4]

type: object
properties:
words:
$ref: "ndarray-1.1.0"
description: |
An array of unsigned 32-bit words representing the integer value, stored
as little endian (i.e. the first word of the array represents the least
significant bits of the integer value).
sign:
type: string
pattern: "^[+-]$"
description: |
String indicating whether the integer value is positive or negative.
string:
type: string
description: |
Optional string representation of the integer value. This field is only
intended to improve readability for humans, and therefore no assumptions
about format should be made by ASDF readers.
required: [words, sign]
...
Loading