From a8b3452d3dcb7ddfacb9c01c2aa50cd6702c0205 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Mon, 25 Nov 2024 10:04:13 -0500 Subject: [PATCH 01/13] Use the list_dependencies_command instead of pip freeze (#515) --- .github/workflows/ci_cron.yml | 1 + pyproject.toml | 8 ++++---- tox.ini | 16 ++++++++++++---- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci_cron.yml b/.github/workflows/ci_cron.yml index 21a74402..f289c12b 100644 --- a/.github/workflows/ci_cron.yml +++ b/.github/workflows/ci_cron.yml @@ -22,3 +22,4 @@ jobs: envs: | - macos: py310-xdist - linux: py312-devdeps-xdist + - linux: py310-oldestdeps-xdist diff --git a/pyproject.toml b/pyproject.toml index 61268a34..950d19c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ classifiers = [ "Programming Language :: Python :: 3", ] dependencies = [ - "asdf >=2.14.2", + "asdf >=2.15.2", "asdf-astropy >=0.5.0", ] dynamic = [ @@ -28,8 +28,8 @@ file = "LICENSE" [project.optional-dependencies] test = [ - "pytest>=4.6.0", - "pytest-doctestplus>=0.11.1", + "pytest>=7.0.0", + "pytest-doctestplus>=1.2.1", "crds>=11.16.16", ] docs = [ @@ -77,7 +77,7 @@ where = [ ] [tool.pytest.ini_options] -minversion = 4.6 +minversion = 7.0 doctest_plus = true doctest_rst = true text_file_format = "rst" diff --git a/tox.ini b/tox.ini index 75e1f1c7..76bab7fe 100644 --- a/tox.ini +++ b/tox.ini @@ -3,6 +3,8 @@ envlist = check-{style,build} test-xdist{,-cov,-devdeps} build-{docs,dist} +requires = + tox-uv [testenv:check-style] description = Run all style and file checks with pre-commit @@ -18,18 +20,24 @@ description = run tests cov: with coverage xdist: using parallel processing + devdeps: Run with select dev dependencies + oldestdeps: Run with oldest direct dependencies set_env = - devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/liberfa/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple + devdeps: UV_INDEX = https://pypi.anaconda.org/liberfa/simple https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple + devdeps: UV_INDEX_STRATEGY = unsafe-any-match extras = test +uv_resolution = + oldestdeps: lowest-direct deps = - xdist: pytest-xdist + xdist: pytest-xdist>=3 cov: pytest-cov + devdeps: pyerfa>=0.0.dev0 devdeps: numpy>=0.0.dev0 devdeps: astropy>=0.0.dev0 - devdeps: pyerfa>=0.0.dev0 +commands_pre = + {list_dependencies_command} commands = - pip freeze pytest \ xdist: -n auto \ cov: --cov --cov-report=term-missing --cov-report=xml \ From 5500e73da99a4855e0a084e7ff38cecd4dfdf6b4 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Mon, 25 Nov 2024 14:25:20 -0500 Subject: [PATCH 02/13] Add roman_datamodels testing job (#518) --- .github/workflows/ci.yml | 6 ++++++ tox.ini | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ba22073..20b97599 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,3 +22,9 @@ jobs: coverage: codecov - linux: py312-xdist - linux: py313-xdist + + roman_datamodels: + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0 + with: + envs: | + - linux: roman_datamodels-xdist diff --git a/tox.ini b/tox.ini index 76bab7fe..0d4e8b51 100644 --- a/tox.ini +++ b/tox.ini @@ -6,6 +6,9 @@ envlist = requires = tox-uv +[main] +roman_datamodels_repo = https://github.com/spacetelescope/roman_datamodels.git + [testenv:check-style] description = Run all style and file checks with pre-commit skip_install = true @@ -22,6 +25,8 @@ description = xdist: using parallel processing devdeps: Run with select dev dependencies oldestdeps: Run with oldest direct dependencies +allowlist_externals = + roman_datamodels: git set_env = devdeps: UV_INDEX = https://pypi.anaconda.org/liberfa/simple https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple devdeps: UV_INDEX_STRATEGY = unsafe-any-match @@ -35,10 +40,19 @@ deps = devdeps: pyerfa>=0.0.dev0 devdeps: numpy>=0.0.dev0 devdeps: astropy>=0.0.dev0 + roman_datamodels: roman_datamodels[test] @ git+{[main]roman_datamodels_repo} +change_dir = + roman_datamodels: {env_tmp_dir} commands_pre = + oldestdeps: minimum_dependencies + oldestdeps: uv pip install -r {env_tmp_dir}/requirements-min.txt {list_dependencies_command} + roman_datamodels: git clone -n --depth=1 --filter=blob:none {[main]roman_datamodels_repo} + roman_datamodels: git --git-dir={env_tmp_dir}/roman_datamodels/.git checkout HEAD pyproject.toml + roman_datamodels: git --git-dir={env_tmp_dir}/roman_datamodels/.git checkout HEAD tests/* commands = pytest \ + roman_datamodels: --config-file={env_tmp_dir}/pyproject.toml tests \ xdist: -n auto \ cov: --cov --cov-report=term-missing --cov-report=xml \ {posargs} From d612e3d22b2a6f9b905d00e6a9cd9776aeb45da7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 10:39:39 -0500 Subject: [PATCH 03/13] [pre-commit.ci] pre-commit autoupdate (#519) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b98b72bd..8953ba1a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,7 +40,7 @@ repos: args: ["--py38-plus"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.7.4' + rev: 'v0.8.0' hooks: - id: ruff args: ["--fix"] From 8dfcfbfa5f641bb6ddd9feca9617499dde347ca7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 08:59:50 -0500 Subject: [PATCH 04/13] Bump OpenAstronomy/github-actions-workflows from 1.13.0 to 1.14.0 in /.github/workflows in the actions group (#522) Bump OpenAstronomy/github-actions-workflows Bumps the actions group in /.github/workflows with 1 update: [OpenAstronomy/github-actions-workflows](https://github.com/openastronomy/github-actions-workflows). Updates `OpenAstronomy/github-actions-workflows` from 1.13.0 to 1.14.0 - [Release notes](https://github.com/openastronomy/github-actions-workflows/releases) - [Commits](https://github.com/openastronomy/github-actions-workflows/compare/924441154cf3053034c6513d5e06c69d262fb9a6...d68193b68216da64eafaa618f53c59f5d271c56e) --- updated-dependencies: - dependency-name: OpenAstronomy/github-actions-workflows dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- .github/workflows/ci.yml | 4 ++-- .github/workflows/ci_cron.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 947bfb8d..550eb3b0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ on: jobs: build: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@d68193b68216da64eafaa618f53c59f5d271c56e # v1.14.0 with: upload_to_pypi: ${{ (github.event_name == 'release') && (github.event.action == 'released') }} secrets: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20b97599..1a899727 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ on: jobs: test: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@d68193b68216da64eafaa618f53c59f5d271c56e # v1.14.0 with: envs: | - linux: py310-xdist @@ -24,7 +24,7 @@ jobs: - linux: py313-xdist roman_datamodels: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@d68193b68216da64eafaa618f53c59f5d271c56e # v1.14.0 with: envs: | - linux: roman_datamodels-xdist diff --git a/.github/workflows/ci_cron.yml b/.github/workflows/ci_cron.yml index f289c12b..20b9ed19 100644 --- a/.github/workflows/ci_cron.yml +++ b/.github/workflows/ci_cron.yml @@ -16,7 +16,7 @@ on: jobs: test: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0 + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@d68193b68216da64eafaa618f53c59f5d271c56e # v1.14.0 if: (github.repository == 'spacetelescope/rad' && (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'Weekly CI'))) with: envs: | From cc34fd2f244ac13f93aeb9d38e624b63f3102a55 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Wed, 27 Nov 2024 11:31:25 -0500 Subject: [PATCH 05/13] Switch to using ruff over a collection of tools for linting --- .pre-commit-config.yaml | 20 +------------------- docs/conf.py | 12 ++++++------ pyproject.toml | 19 ++++++++++++++----- src/rad/integration.py | 7 +------ tests/test_integration.py | 7 +------ tests/test_schemas.py | 7 ++++--- 6 files changed, 27 insertions(+), 45 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8953ba1a..e16aba9f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,6 +9,7 @@ repos: - id: check-yaml args: ["--unsafe"] - id: check-toml + - id: check-json - id: check-merge-conflict - id: check-symlinks - id: debug-statements @@ -19,8 +20,6 @@ repos: - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.10.0 hooks: - - id: python-check-blanket-noqa - - id: python-check-mock-methods - id: rst-directive-colons - id: rst-inline-touching-normal - id: text-unicode-replacement-char @@ -33,30 +32,13 @@ repos: additional_dependencies: - tomli -- repo: https://github.com/asottile/pyupgrade - rev: 'v3.19.0' - hooks: - - id: pyupgrade - args: ["--py38-plus"] - - repo: https://github.com/astral-sh/ruff-pre-commit rev: 'v0.8.0' hooks: - id: ruff args: ["--fix"] -- repo: https://github.com/pycqa/isort - rev: 5.13.2 - hooks: - - id: isort - - repo: https://github.com/psf/black rev: 24.10.0 hooks: - id: black - -- repo: https://github.com/PyCQA/bandit - rev: 1.7.10 - hooks: - - id: bandit - args: ["-r", "-ll"] diff --git a/docs/conf.py b/docs/conf.py index 5d9752fa..9f810d01 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -59,12 +59,12 @@ # 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: E501, F405 -intersphinx_mapping["asdf"] = ("https://asdf.readthedocs.io/en/latest/", None) # noqa: E501, F405 -intersphinx_mapping["asdf-standard"] = ("https://asdf-standard.readthedocs.io/en/latest/", None) # noqa: E501, F405 -intersphinx_mapping["asdf-astropy"] = ("https://asdf-astropy.readthedocs.io/en/latest/", None) # noqa: E501, F405 -intersphinx_mapping["pytest"] = ("https://docs.pytest.org/en/latest/", None) # noqa: E501, F405 -intersphinx_mapping["roman_datamodels"] = ("https://roman-datamodels.readthedocs.io/en/latest/", None) # noqa: E501, F405 +intersphinx_mapping["pypa-packaging"] = ("https://packaging.python.org/en/latest/", None) # noqa: F405 +intersphinx_mapping["asdf"] = ("https://asdf.readthedocs.io/en/latest/", None) # noqa: F405 +intersphinx_mapping["asdf-standard"] = ("https://asdf-standard.readthedocs.io/en/latest/", None) # noqa: F405 +intersphinx_mapping["asdf-astropy"] = ("https://asdf-astropy.readthedocs.io/en/latest/", None) # noqa: F405 +intersphinx_mapping["pytest"] = ("https://docs.pytest.org/en/latest/", None) # noqa: F405 +intersphinx_mapping["roman_datamodels"] = ("https://roman-datamodels.readthedocs.io/en/latest/", None) # noqa: F405 # To perform a Sphinx version check that needs to be more specific than # major.minor, call `check_sphinx_version("x.y.z")` here. diff --git a/pyproject.toml b/pyproject.toml index 950d19c6..f9508910 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -93,11 +93,6 @@ asdf_schema_tests_enabled = "true" asdf_schema_skip_tests = "src/rad/resources/schemas/rad_schema-1.0.0.yaml" asdf_schema_root = "src/rad/resources/schemas" -[tool.isort] -profile = "black" -filter_files = true -line_length = 130 - [tool.black] line-length = 130 force-exclude = "^/(\n (\n \\.eggs\n | \\.git\n | \\.pytest_cache\n | \\.tox\n )/\n)\n" @@ -105,6 +100,20 @@ force-exclude = "^/(\n (\n \\.eggs\n | \\.git\n | \\.pytest_cache\n [tool.ruff] line-length = 130 +[tool.ruff.lint] +extend-select = [ + "UP", # PyUpgrade + "I", # isort + "B", # BugBear + "S", # Bandit + "RUF", # ruff specific +] + +[tool.ruff.lint.per-file-ignores] +"tests/**.py" = [ + "S101" # Bandit: Use of assert detected (fine in test files) +] + [tool.codespell] skip = "*.pdf,*.fits,*.asdf,.tox,build,./tags,.git,docs/_build" diff --git a/src/rad/integration.py b/src/rad/integration.py index 1eca43d3..e4439281 100644 --- a/src/rad/integration.py +++ b/src/rad/integration.py @@ -1,12 +1,7 @@ -import sys +import importlib.resources as importlib_resources from asdf.resource import DirectoryResourceMapping -if sys.version_info < (3, 9): - import importlib_resources -else: - import importlib.resources as importlib_resources - def get_resource_mappings(): """ diff --git a/tests/test_integration.py b/tests/test_integration.py index bb9fa60f..9a6d2fe6 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -2,12 +2,7 @@ Test that the asdf library integration is working properly. """ -import sys - -if sys.version_info < (3, 9): - import importlib_resources -else: - import importlib.resources as importlib_resources +import importlib.resources as importlib_resources import asdf import pytest diff --git a/tests/test_schemas.py b/tests/test_schemas.py index dce7814a..173ff010 100644 --- a/tests/test_schemas.py +++ b/tests/test_schemas.py @@ -90,7 +90,7 @@ def callback(node): "missing properties: " + missing_list + "\n" "extra properties: " + extra_list ) - assert False, message + raise ValueError(message) asdf.treeutil.walk(schema, callback) else: @@ -111,7 +111,7 @@ def callback(node): if not required_names.issubset(property_names): missing_list = ", ".join(required_names - property_names) message = "required references names that do not exist: " + missing_list - assert False, message + raise ValueError(message) asdf.treeutil.walk(schema, callback) @@ -279,7 +279,8 @@ def test_varchar_length(uri): """ schema = asdf.schema.load_schema(uri) - def callback(node, nvarchars={}): + def callback(node, nvarchars=None): + nvarchars = nvarchars or {} if not isinstance(node, dict): return if node.get("type", "") != "string": From bdddcd881bb82f614e7eacc55f4d63b66ef03a73 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Wed, 27 Nov 2024 11:32:55 -0500 Subject: [PATCH 06/13] Use built in ruff code formatter over black to lower number of tools in use --- .pre-commit-config.yaml | 8 ++------ pyproject.toml | 4 ---- scripts/insert_next_release.py | 1 + scripts/set_release_date.py | 1 + 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e16aba9f..98f52fa6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,9 +36,5 @@ repos: rev: 'v0.8.0' hooks: - id: ruff - args: ["--fix"] - -- repo: https://github.com/psf/black - rev: 24.10.0 - hooks: - - id: black + args: ["--fix", "--show-fixes"] + - id: ruff-format diff --git a/pyproject.toml b/pyproject.toml index f9508910..fb0dcaa5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -93,10 +93,6 @@ asdf_schema_tests_enabled = "true" asdf_schema_skip_tests = "src/rad/resources/schemas/rad_schema-1.0.0.yaml" asdf_schema_root = "src/rad/resources/schemas" -[tool.black] -line-length = 130 -force-exclude = "^/(\n (\n \\.eggs\n | \\.git\n | \\.pytest_cache\n | \\.tox\n )/\n)\n" - [tool.ruff] line-length = 130 diff --git a/scripts/insert_next_release.py b/scripts/insert_next_release.py index 5c3d9db4..c352b106 100755 --- a/scripts/insert_next_release.py +++ b/scripts/insert_next_release.py @@ -3,6 +3,7 @@ Insert the next release's changelog header. Prints the version, which our GitHub Actions workflow uses to generate a commit message. """ + import re from pathlib import Path diff --git a/scripts/set_release_date.py b/scripts/set_release_date.py index 5c5c4897..3ce7dbb9 100755 --- a/scripts/set_release_date.py +++ b/scripts/set_release_date.py @@ -4,6 +4,7 @@ Prints the version, which our GitHub Actions workflow uses to generate a commit message and release tag. """ + import re from datetime import date from pathlib import Path From 06cd7a8e36e1b464024d5ba758aa6eb8a9ca9755 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Wed, 27 Nov 2024 11:35:39 -0500 Subject: [PATCH 07/13] Update pytest config --- pyproject.toml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fb0dcaa5..35c8c6a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,6 @@ rad = "rad.integration:get_resource_mappings" requires = [ "setuptools >=61", "setuptools_scm[toml] >=3.4", - "wheel", ] build-backend = "setuptools.build_meta" @@ -81,13 +80,21 @@ minversion = 7.0 doctest_plus = true doctest_rst = true text_file_format = "rst" -addopts = "--show-capture=no" +log_cli_level = "INFO" +xfail_strict = true +addopts = [ + "--color=yes", # color test output + "--doctest-rst", # enable doctests + "--strict-config", # fail on unknown config options + "--strict-markers", # fail on unknown markers + "-ra", # Show summary of all failures/errors +] testpaths = [ "tests", "src/rad/resources/schemas", ] filterwarnings = [ - "error::ResourceWarning", + "error", ] asdf_schema_tests_enabled = "true" asdf_schema_skip_tests = "src/rad/resources/schemas/rad_schema-1.0.0.yaml" From b5428c346682db2214e19843cbc2ce03a1e20909 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Wed, 27 Nov 2024 13:45:11 -0500 Subject: [PATCH 08/13] Add NPY check to sync with romancal --- docs/conf.py | 2 +- pyproject.toml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 9f810d01..57387507 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -38,7 +38,7 @@ from importlib_metadata import distribution try: - numpy.random.seed(int(os.environ["SOURCE_DATE_EPOCH"])) + numpy.random.seed(int(os.environ["SOURCE_DATE_EPOCH"])) # noqa: NPY002 except KeyError: pass diff --git a/pyproject.toml b/pyproject.toml index 35c8c6a0..0b622e40 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -110,6 +110,7 @@ extend-select = [ "B", # BugBear "S", # Bandit "RUF", # ruff specific + "NPY", # numpy specific ] [tool.ruff.lint.per-file-ignores] From 42ae578ef2fa4580f69c033656645fb9599466b0 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Tue, 26 Nov 2024 11:39:35 -0500 Subject: [PATCH 09/13] Per SPEC 0, bump min python to 3.11 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0b622e40..a0ee3168 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "rad" description = "Roman Attribute Dictionary" -requires-python = ">=3.10" +requires-python = ">=3.11" authors = [ { name = "STScI", email = "help@stsci.edu" }, ] From aee0b3e5edb0bcd9246034de59966ada79ddab66 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Tue, 26 Nov 2024 11:42:10 -0500 Subject: [PATCH 10/13] Update CI --- .github/workflows/ci.yml | 5 ++--- .github/workflows/ci_cron.yml | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a899727..7a983e25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,10 +17,9 @@ jobs: uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@d68193b68216da64eafaa618f53c59f5d271c56e # v1.14.0 with: envs: | - - linux: py310-xdist - - linux: py311-xdist-cov + - linux: py311-xdist + - linux: py312-xdist-cov coverage: codecov - - linux: py312-xdist - linux: py313-xdist roman_datamodels: diff --git a/.github/workflows/ci_cron.yml b/.github/workflows/ci_cron.yml index 20b9ed19..e9eb0315 100644 --- a/.github/workflows/ci_cron.yml +++ b/.github/workflows/ci_cron.yml @@ -20,6 +20,6 @@ jobs: if: (github.repository == 'spacetelescope/rad' && (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'Weekly CI'))) with: envs: | - - macos: py310-xdist - - linux: py312-devdeps-xdist - - linux: py310-oldestdeps-xdist + - macos: py311-xdist + - linux: py313-devdeps-xdist + - linux: py311-oldestdeps-xdist From 38e284a572cf1dd1328fe4e99155643e269679c6 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Tue, 26 Nov 2024 11:43:11 -0500 Subject: [PATCH 11/13] Update changes --- changes/520.misc.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/520.misc.rst diff --git a/changes/520.misc.rst b/changes/520.misc.rst new file mode 100644 index 00000000..373b9be1 --- /dev/null +++ b/changes/520.misc.rst @@ -0,0 +1 @@ +Bump min Python to 3.11 per SPEC 0. From 712888b5759ac987abf1aaf45a77d40d7c320886 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Mon, 2 Dec 2024 11:26:20 -0500 Subject: [PATCH 12/13] Apply change from pyupgrade --- docs/conf.py | 7 +------ pyproject.toml | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 57387507..2041c826 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -25,16 +25,11 @@ import datetime import os import sys +import tomllib from pathlib import Path # Ensure documentation examples are deterministically random. import numpy - -if sys.version_info < (3, 11): - import tomli as tomllib -else: - import tomllib - from importlib_metadata import distribution try: diff --git a/pyproject.toml b/pyproject.toml index a0ee3168..f7e107a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,6 @@ docs = [ "graphviz", "matplotlib", "docutils", - "tomli; python_version <\"3.11\"", "importlib-metadata", "towncrier", ] From 48203a1de1c432200f87df841e857eb45f531bb6 Mon Sep 17 00:00:00 2001 From: Paul Huwe <42071634+PaulHuwe@users.noreply.github.com> Date: Mon, 2 Dec 2024 13:36:37 -0500 Subject: [PATCH 13/13] RAD-189: APCORR and ABVEGAOFFSET optional nulls (#516) * Initial commit. * Added change log. --- changes/516.misc.rst | 1 + .../reference_files/abvegaoffset-1.0.0.yaml | 4 +- .../schemas/reference_files/apcorr-1.0.0.yaml | 38 ++++++++++++------- 3 files changed, 28 insertions(+), 15 deletions(-) create mode 100644 changes/516.misc.rst diff --git a/changes/516.misc.rst b/changes/516.misc.rst new file mode 100644 index 00000000..91741626 --- /dev/null +++ b/changes/516.misc.rst @@ -0,0 +1 @@ +Added null values to allowed APCORR and ABVEGAOFFSET keyword values. diff --git a/src/rad/resources/schemas/reference_files/abvegaoffset-1.0.0.yaml b/src/rad/resources/schemas/reference_files/abvegaoffset-1.0.0.yaml index 2e5357dd..e9a7c282 100644 --- a/src/rad/resources/schemas/reference_files/abvegaoffset-1.0.0.yaml +++ b/src/rad/resources/schemas/reference_files/abvegaoffset-1.0.0.yaml @@ -28,7 +28,9 @@ properties: description: Magnitude difference between the AB and Vega magnitude systems. Found by calculating the AB magnitude of Vega within the optical element bandpass. - type: number + anyOf: + - type: number + - type: "null" required: [abvega_offset] required: [meta, data] flowStyle: block diff --git a/src/rad/resources/schemas/reference_files/apcorr-1.0.0.yaml b/src/rad/resources/schemas/reference_files/apcorr-1.0.0.yaml index bc6ed9fd..a0a01819 100644 --- a/src/rad/resources/schemas/reference_files/apcorr-1.0.0.yaml +++ b/src/rad/resources/schemas/reference_files/apcorr-1.0.0.yaml @@ -27,39 +27,49 @@ properties: title: Aperture Corrections description: The aperture correction for each enclosed energy fraction, corresponding to 1 / ee_fractions. - tag: tag:stsci.edu:asdf/core/ndarray-1.* - datatype: float64 - exact_datatype: true - ndim: 1 + anyOf: + - tag: tag:stsci.edu:asdf/core/ndarray-1.* + datatype: float64 + exact_datatype: true + ndim: 1 + - type: "null" ee_fractions: title: Enclosed Energy Fractions description: Fractions of the enclosed energy of the PSF at which to estimate the aperture correction and enclosed energy radii. - tag: tag:stsci.edu:asdf/core/ndarray-1.* - datatype: float64 - exact_datatype: true - ndim: 1 + anyOf: + - tag: tag:stsci.edu:asdf/core/ndarray-1.* + datatype: float64 + exact_datatype: true + ndim: 1 + - type: "null" ee_radii: title: Enclosed Energy Radii description: Radius, in pixels, within which the enclosed energy fractions are met. The indexing matches that of "ee_fractions". - tag: tag:stsci.edu:asdf/core/ndarray-1.* - datatype: float64 - exact_datatype: true - ndim: 1 + anyOf: + - tag: tag:stsci.edu:asdf/core/ndarray-1.* + datatype: float64 + exact_datatype: true + ndim: 1 + - type: "null" sky_background_rin: title: Inner Radius for the Sky Background description: Inner radius, in pixels, to use when estimating the local sky background within an annulus between this radius and "sky_background_rout". - type: number + anyOf: + - type: number + - type: "null" sky_background_rout: title: Outer Radius for the Sky Background description: Outer radius, in pixels, to use when estimating the local sky background within an annulus between this radius and "sky_background_rin". - type: number + anyOf: + - type: number + - type: "null" required: [ap_corrections, ee_fractions, ee_radii, sky_background_rin, sky_background_rout] required: [meta, data] flowStyle: block