units/quantity-0.1.0#

Represents a Quantity object from pint.

Description

A Quantity object represents a value that has some unit associated with the number.

Outline

Schema Definitions

This type is an object with the following properties:
  • value
    objectRequired
    A scalar or vector of values.

    This node must validate against one of the following:

  • units
    asdf://weldx.bam.de/weldx/tags/units/units-0.1.*Required
    The unit corresponding to the values

Examples

A quantity consisting of a scalar value and unit:

!<asdf://weldx.bam.de/weldx/tags/units/quantity-0.1.0>
  value: 3.14159
  units: !<asdf://weldx.bam.de/weldx/tags/units/units-0.1.0> kilometer

A quantity with an array of values:

!<asdf://weldx.bam.de/weldx/tags/units/quantity-0.1.0>
  value: !core/ndarray-1.0.0 [1, 2, 3, 4]
  units: !<asdf://weldx.bam.de/weldx/tags/units/units-0.1.0> ampere

A quantity with an n-dimensional array of values:

!<asdf://weldx.bam.de/weldx/tags/units/quantity-0.1.0>
  value: !core/ndarray-1.0.0
    datatype: float64
    data: [[1, 2, 3],
           [4, 5, 6]]
  units: !<asdf://weldx.bam.de/weldx/tags/units/units-0.1.0> meter / second

Original Schema

%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "asdf://weldx.bam.de/weldx/schemas/units/quantity-0.1.0"

title: >
  Represents a Quantity object from pint.
description: |
  A Quantity object represents a value that has some unit
  associated with the number.

examples:
  -
    - A quantity consisting of a scalar value and unit
    - |
        !<asdf://weldx.bam.de/weldx/tags/units/quantity-0.1.0>
          value: 3.14159
          units: !<asdf://weldx.bam.de/weldx/tags/units/units-0.1.0> kilometer
  -
    - A quantity with an array of values
    - |
        !<asdf://weldx.bam.de/weldx/tags/units/quantity-0.1.0>
          value: !core/ndarray-1.0.0 [1, 2, 3, 4]
          units: !<asdf://weldx.bam.de/weldx/tags/units/units-0.1.0> ampere
  -
    - A quantity with an n-dimensional array of values
    - |
        !<asdf://weldx.bam.de/weldx/tags/units/quantity-0.1.0>
          value: !core/ndarray-1.0.0
            datatype: float64
            data: [[1, 2, 3],
                   [4, 5, 6]]
          units: !<asdf://weldx.bam.de/weldx/tags/units/units-0.1.0> meter / second


type: object
properties:
  value:
    description: |
      A scalar or vector of values.
    oneOf:
      - type: number
      - tag: "tag:stsci.edu:asdf/core/ndarray-1.*"
  units:
    description: |
      The unit corresponding to the values
    tag: "asdf://weldx.bam.de/weldx/tags/units/units-0.1.*"
required: [value, units]
propertyOrder: [value, units]
...