diff --git a/docs/_static/custom.css b/docs/_static/custom.css deleted file mode 100644 index 3b01e4b..0000000 --- a/docs/_static/custom.css +++ /dev/null @@ -1,43 +0,0 @@ -div.admonition { - transition: width 0.5s; - -webkit-transition: width 0.5s; - overflow: hidden; -} - -div.admonition:active { - width: 150% -} - -div.note:active { - width: 100% -} - -div.highlight-yaml { - transition: width 0.5s; - -webkit-transition: width 0.5s; - overflow: hidden; -} - -div.highlight-yaml:active { - width: 150% -} - -div.highlight-default { - transition: width 0.5s; - -webkit-transition: width 0.5s; - overflow: hidden; -} - -div.highlight-default:active { - width: 150% -} - -div.highlight-python { - transition: width 0.5s; - -webkit-transition: width 0.5s; - overflow: hidden; -} - -div.highlight-python:active { - width: 150% -} diff --git a/docs/_templates/autosummary/base.rst b/docs/_templates/autosummary/base.rst deleted file mode 100644 index 1621719..0000000 --- a/docs/_templates/autosummary/base.rst +++ /dev/null @@ -1,2 +0,0 @@ -{% extends "autosummary_core/base.rst" %} -{# The template this is inherited from is in astropy/sphinx/ext/templates/autosummary_core. If you want to modify this template, it is strongly recommended that you still inherit from the astropy template. #} diff --git a/docs/_templates/autosummary/class.rst b/docs/_templates/autosummary/class.rst deleted file mode 100644 index 0fa59f2..0000000 --- a/docs/_templates/autosummary/class.rst +++ /dev/null @@ -1,2 +0,0 @@ -{% extends "autosummary_core/class.rst" %} -{# The template this is inherited from is in astropy/sphinx/ext/templates/autosummary_core. If you want to modify this template, it is strongly recommended that you still inherit from the astropy template. #} diff --git a/docs/_templates/autosummary/module.rst b/docs/_templates/autosummary/module.rst deleted file mode 100644 index 230cd6e..0000000 --- a/docs/_templates/autosummary/module.rst +++ /dev/null @@ -1,2 +0,0 @@ -{% extends "autosummary_core/module.rst" %} -{# The template this is inherited from is in astropy/sphinx/ext/templates/autosummary_core. If you want to modify this template, it is strongly recommended that you still inherit from the astropy template. #} diff --git a/docs/changes.rst b/docs/changes.rst deleted file mode 100644 index 773e5f7..0000000 --- a/docs/changes.rst +++ /dev/null @@ -1,6 +0,0 @@ -.. _change_log: - -Change Log -========== - -.. include:: ../CHANGES.rst diff --git a/docs/conf.py b/docs/conf.py index cb8d070..38b9dc3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -28,21 +28,9 @@ from pathlib import Path # Ensure documentation examples are determinstically random. -import numpy import tomli from pkg_resources import get_distribution -try: - numpy.random.seed(int(os.environ["SOURCE_DATE_EPOCH"])) -except KeyError: - pass - -try: - from sphinx_astropy.conf.v1 import * # noqa -except ImportError: - print("ERROR: the documentation requires the sphinx-astropy package to be installed") - sys.exit(1) - # Get configuration information from `pyproject.toml` with open(Path(__file__).parent.parent / "pyproject.toml", "rb") as configuration_file: conf = tomli.load(configuration_file) @@ -60,24 +48,10 @@ # If your documentation needs a minimal Sphinx version, state it here. # needs_sphinx = '1.2' -intersphinx_mapping["pypa-packaging"] = ("https://packaging.python.org/en/latest/", None) # noqa -intersphinx_mapping["asdf"] = ("https://asdf.readthedocs.io/en/latest/", None) # noqa -intersphinx_mapping["asdf-standard"] = ("https://asdf-standard.readthedocs.io/en/latest/", None) # noqa -intersphinx_mapping["asdf-astropy"] = ("https://asdf-astropy.readthedocs.io/en/latest/", None) # noqa -intersphinx_mapping["pytest"] = ("https://docs.pytest.org/en/latest/", None) # noqa - # To perform a Sphinx version check that needs to be more specific than # major.minor, call `check_sphinx_version("x.y.z")` here. # check_sphinx_version("1.2.1") -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns.append("_templates") # noqa - -# This is added to the end of RST files - a good place to put substitutions to -# be used globally. -rst_epilog += """""" # noqa - # -- Project information ------------------------------------------------------ # The version info for the project you're documenting, acts as replacement for @@ -142,16 +116,3 @@ man_pages = [("index", project.lower(), project + " Documentation", [author], 1)] sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname("__file__")), "sphinxext")) -extensions += ["sphinx_asdf"] # noqa - - -def setup(app): - app.add_css_file("custom.css") - - -# -- sphinx_asdf configuration --------------------------------------------- - -# Top-level directory containing ASDF schemas (relative to current directory) -asdf_schema_path = "../resources/stsci.edu" -# This is the prefix common to all schema IDs in this repository -asdf_schema_standard_prefix = "schemas" diff --git a/docs/contributing.rst b/docs/contributing.rst deleted file mode 100644 index e39d33e..0000000 --- a/docs/contributing.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. _contributing: - -Contributing -============ - -We welcome feedback and contributions of all kinds. Contributions of code, -documentation, or general feedback are all appreciated. - -.. include:: ../CONTRIBUTING.rst diff --git a/docs/index.rst b/docs/index.rst index 6114cea..7ad86b7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -4,44 +4,7 @@ ASDF Unit Schemas ********************** -The ASDF Unit Schemas define a set of schemas for serializing the units defined by -:ref:`astropy.units ` for the ASDF file format. These schemas -are based upon the schemas in the :ref:`ASDF Standard ` and -are packaged for use by the :ref:`ASDF ` library. - -.. note:: - This is only a schema package, to use these schemas to serialize astropy units, - one must install the :ref:`asdf-astropy ` package. - -Included Resources -================== - -The following are listings of all the schemas provided by this package for ASDF. - -.. note:: - Typically, schemas are used in ASDF via their tag, which can be found in the manifest. - Using a transform in ASDF it is recommended that you use the tag instead of a direct - reference to the schema. When doing so make sure you are using the correct manifest version. - -.. toctree:: - :maxdepth: 1 - - units.rst - legacy.rst - manifests.rst - -Developer Resources -=================== - -.. toctree:: - :maxdepth: 1 - - contributing.rst - changes.rst - -Index -===== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` +This package is deprecated. It's repository will be archived +and no more versions will be published. The resources provided +by this package were duplicates of those provided by ASDF standard +see: https://github.com/asdf-format/asdf-standard diff --git a/docs/legacy.rst b/docs/legacy.rst deleted file mode 100644 index ac71d76..0000000 --- a/docs/legacy.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _legacy-unit-schemas: - -Legacy Unit Schemas -======================== - -The legacy ``unit`` schemas: - -.. asdf-autoschemas:: diff --git a/docs/manifests.rst b/docs/manifests.rst deleted file mode 100644 index 92dde99..0000000 --- a/docs/manifests.rst +++ /dev/null @@ -1,14 +0,0 @@ -.. _manifests: - -Manifests -========= - -The ASDF tags (described by schemas) available under each ASDF unit schemas version are all described -by a single manifest document for that version. - -.. asdf-autoschemas:: - :schema_root: ../resources/asdf-format.org - :standard_prefix: manifests - - unit-1.0.0 - unit-1.1.0 diff --git a/docs/units.rst b/docs/units.rst deleted file mode 100644 index 40ef6c2..0000000 --- a/docs/units.rst +++ /dev/null @@ -1,12 +0,0 @@ -.. _unit-schemas: - -Unit Schemas -================= - -The current ``unit`` schemas: - -.. asdf-autoschemas:: - - defunit-1.0.0 - quantity-1.1.0 - unit-1.0.0 diff --git a/pyproject.toml b/pyproject.toml index a4d0d1f..2cbc845 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = 'asdf_unit_schemas' -description = 'ASDF schemas for units' +description = 'DEPRECATED: ASDF schemas for units' readme = 'README.md' requires-python = '>=3.8' license = { file = 'LICENSE' } @@ -14,8 +14,6 @@ classifiers = [ 'Development Status :: 5 - Production/Stable', ] dependencies = [ - 'asdf-standard >= 1.0.1', - 'importlib_resources >= 3; python_version<"3.9"', ] dynamic = ['version'] @@ -23,18 +21,9 @@ dynamic = ['version'] docs = [ 'tomli', 'sphinx', - 'sphinx-asdf >= 0.1.3', - 'sphinx-astropy', - 'astropy >= 5.0.4', - 'graphviz', - 'matplotlib', - 'docutils', 'sphinx-rtd-theme', ] test = [ - 'asdf >= 2.8.0', - 'asdf-astropy', - 'scipy', 'pytest', ] @@ -43,9 +32,6 @@ test = [ 'documentation' = 'https://asdf-unit-schemas.readthedocs.io/en/stable' 'repository' = 'https://github.com/asdf-format/asdf-unit-schemas' -[project.entry-points] -'asdf.resource_mappings' = { asdf_unit_schemas = 'asdf_unit_schemas.integration:get_resource_mappings' } - [build-system] requires = [ "setuptools >=60", @@ -58,22 +44,14 @@ build-backend = "setuptools.build_meta" write_to = "src/asdf_unit_schemas/_version.py" [tool.setuptools] -packages = ["asdf_unit_schemas", "asdf_unit_schemas.resources"] - -[tool.setuptools.package-data] -"asdf_unit_schemas.resources" = ["resources/**/*.yaml"] +packages = ["asdf_unit_schemas"] [tool.setuptools.package-dir] '' = "src" -"asdf_unit_schemas.resources" = "resources" [tool.pytest.ini_options] -asdf_schema_root = 'resources/stsci.edu/schemas' -asdf_schema_tests_enabled = 'true' -asdf_schema_ignore_unrecognized_tag = 'true' testpaths = """ tests - resources """ addopts = '--color=yes' diff --git a/resources/asdf-format.org/manifests/unit-1.0.0.yaml b/resources/asdf-format.org/manifests/unit-1.0.0.yaml deleted file mode 100644 index a496dfd..0000000 --- a/resources/asdf-format.org/manifests/unit-1.0.0.yaml +++ /dev/null @@ -1,23 +0,0 @@ -id: asdf://asdf-format.org/unit/manifests/unit-1.0.0 -extension_uri: asdf://asdf-format.org/unit/extensions/unit-1.0.0 -title: Unit extension 1.0.0 -description: |- - A set of tags for serializing units. -tags: -- 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/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. diff --git a/resources/asdf-format.org/manifests/unit-1.1.0.yaml b/resources/asdf-format.org/manifests/unit-1.1.0.yaml deleted file mode 100644 index cd95668..0000000 --- a/resources/asdf-format.org/manifests/unit-1.1.0.yaml +++ /dev/null @@ -1,29 +0,0 @@ -id: asdf://asdf-format.org/unit/manifests/unit-1.1.0 -extension_uri: asdf://asdf-format.org/unit/extensions/unit-1.1.0 -title: Unit extension 1.1.0 -description: |- - A set of tags for serializing units. -tags: -- 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.1.0 - schema_uri: http://stsci.edu/schemas/asdf/unit/quantity-1.1.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. diff --git a/resources/stsci.edu/schemas/defunit-1.0.0.yaml b/resources/stsci.edu/schemas/defunit-1.0.0.yaml deleted file mode 100644 index c85dc22..0000000 --- a/resources/stsci.edu/schemas/defunit-1.0.0.yaml +++ /dev/null @@ -1,33 +0,0 @@ -%YAML 1.1 ---- -$schema: "http://stsci.edu/schemas/yaml-schema/draft-01" -id: "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. - -type: object -properties: - name: - description: The name of the new unit. - type: string - pattern: "[A-Za-z_][A-Za-z0-9_]+" - - unit: - description: | - The unit that the new name is equivalent to. It is optional, - and if not provided, or ``null``, this ``defunit`` defines a new - base unit. - - anyOf: - - $ref: "unit-1.0.0" - - type: "null" - -required: [name] -... diff --git a/resources/stsci.edu/schemas/quantity-1.1.0.yaml b/resources/stsci.edu/schemas/quantity-1.1.0.yaml deleted file mode 100644 index 3ae93aa..0000000 --- a/resources/stsci.edu/schemas/quantity-1.1.0.yaml +++ /dev/null @@ -1,58 +0,0 @@ -%YAML 1.1 ---- -$schema: "http://stsci.edu/schemas/yaml-schema/draft-01" -id: "http://stsci.edu/schemas/asdf/unit/quantity-1.1.0" - -title: > - Represents a Quantity object from astropy -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 - - | - !unit/quantity-1.1.0 - value: 3.14159 - unit: km - - - - - A quantity consisting of a single value in an array - - | - !unit/quantity-1.1.0 - value: !core/ndarray-1.0.0 [2.71828] - unit: A - - - - - A quantity with an array of values - - | - !unit/quantity-1.1.0 - value: !core/ndarray-1.0.0 [1, 2, 3, 4] - unit: s - - - - - A quantity with an n-dimensional array of values - - | - !unit/quantity-1.1.0 - value: !core/ndarray-1.0.0 - datatype: float64 - data: [[1, 2, 3], - [4, 5, 6]] - unit: pc - - -type: object -properties: - value: - description: | - A vector of one or more values - anyOf: - - type: number - - $ref: "../core/ndarray-1.0.0" - unit: - description: | - The unit corresponding to the values - $ref: unit-1.0.0 -required: [value, unit] -... diff --git a/resources/stsci.edu/schemas/unit-1.0.0.yaml b/resources/stsci.edu/schemas/unit-1.0.0.yaml deleted file mode 100644 index 58e17b9..0000000 --- a/resources/stsci.edu/schemas/unit-1.0.0.yaml +++ /dev/null @@ -1,20 +0,0 @@ -%YAML 1.1 ---- -$schema: "http://stsci.edu/schemas/yaml-schema/draft-01" -id: "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. -examples: - - - - Example unit - - | - !unit/unit-1.0.0 "2.1798721 10-18kg m2 s-2" - -type: string -pattern: "[\x00-\x7f]*" -... diff --git a/src/asdf_unit_schemas/integration.py b/src/asdf_unit_schemas/integration.py deleted file mode 100644 index 3a7e332..0000000 --- a/src/asdf_unit_schemas/integration.py +++ /dev/null @@ -1,33 +0,0 @@ -import sys -from pathlib import Path - -if sys.version_info < (3, 9): - import importlib_resources -else: - import importlib.resources as importlib_resources - -from asdf_standard import DirectoryResourceMapping - -import asdf_unit_schemas - - -def get_resource_mappings(): - resources_root = importlib_resources.files(asdf_unit_schemas) / "resources" - if not resources_root.is_dir(): - # In an editable install, the resources directory will exist off the - # repository root: - resources_root = Path(__file__).parent.parent.parent / "resources" - if not resources_root.is_dir(): - raise RuntimeError("Missing resources directory") - - return [ - DirectoryResourceMapping( - resources_root / "stsci.edu" / "schemas", - "http://stsci.edu/schemas/asdf/unit/", - recursive=True, - ), - DirectoryResourceMapping( - resources_root / "asdf-format.org" / "manifests", - "asdf://asdf-format.org/unit/manifests/", - ), - ] diff --git a/tests/test_integration.py b/tests/test_integration.py deleted file mode 100644 index 053dd7f..0000000 --- a/tests/test_integration.py +++ /dev/null @@ -1,54 +0,0 @@ -from pathlib import Path - -import asdf -import pytest -import yaml - - -def get_resources(): - resources_root = Path(__file__).parent.parent / "resources" - - return {str(path.relative_to(resources_root)): path for path in resources_root.glob("**/*.yaml")} - - -RESOURCES = get_resources() - - -@pytest.mark.parametrize("resource", RESOURCES) -def test_resource(resource): - resource_path = RESOURCES[resource] - resource_manager = asdf.get_config().resource_manager - - with resource_path.open("rb") as f: - resource_content = f.read() - resource = yaml.safe_load(resource_content) - resource_uri = resource["id"] - assert resource_manager[resource_uri] == resource_content - - -def get_manifests(): - manifests_root = Path(__file__).parent.parent / "resources" / "asdf-format.org" / "manifests" - - return {str(path.relative_to(manifests_root)): path for path in manifests_root.glob("*.yaml")} - - -MANIFESTS = get_manifests() - - -@pytest.mark.parametrize("manifest", MANIFESTS) -def test_manifest(manifest): - manifest_path = MANIFESTS[manifest] - resource_manager = asdf.get_config().resource_manager - - with manifest_path.open("rb") as f: - manifest_content = f.read() - manifest = yaml.safe_load(manifest_content) - - manifest_schema = asdf.schema.load_schema("asdf://asdf-format.org/core/schemas/extension_manifest-1.0.0") - - # The manifest must be valid against its own schema: - asdf.schema.validate(manifest, schema=manifest_schema) - - for tag_definition in manifest["tags"]: - # The tag's schema must be available: - assert tag_definition["schema_uri"] in resource_manager