dkist-header-validator 5.2.0__tar.gz → 5.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/.pre-commit-config.yaml +6 -5
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/PKG-INFO +1 -1
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/__init__.py +1 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/base_validator.py +3 -2
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/exceptions.py +0 -1
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/spec_validators.py +7 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/tests/test_base_validator.py +1 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/tests/test_spec214_validation+.py +2 -1
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/translator.py +2 -2
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/version.py +1 -1
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator.egg-info/PKG-INFO +1 -1
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/docs/conf.py +1 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/setup.cfg +6 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/.gitignore +0 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/.readthedocs.yml +0 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/.snyk +0 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/README.rst +0 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/bitbucket-pipelines.yml +0 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/api/__init__.py +0 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/api/validate.py +2 -2
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/tests/__init__.py +0 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/tests/conftest.py +0 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/tests/test_spec122_translation.py +1 -1
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/tests/test_spec122_validation+.py +0 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/tests/test_spec122_validation-.py +1 -1
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/tests/test_spec214_validation-.py +1 -1
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/tests/test_translator.py +0 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/utils/__init__.py +0 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/utils/expansions.py +1 -1
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator.egg-info/SOURCES.txt +0 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator.egg-info/dependency_links.txt +0 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator.egg-info/entry_points.txt +0 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator.egg-info/requires.txt +0 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator.egg-info/top_level.txt +0 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/docs/Makefile +0 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/docs/index.rst +0 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/docs/make.bat +0 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/docs/requirements.txt +0 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/setup.py +0 -0
- {dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/tox.ini +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# See https://pre-commit.com/hooks.html for more hooks
|
|
3
3
|
repos:
|
|
4
4
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
5
|
-
rev:
|
|
5
|
+
rev: v5.0.0
|
|
6
6
|
hooks:
|
|
7
7
|
- id: trailing-whitespace
|
|
8
8
|
- id: end-of-file-fixer
|
|
@@ -10,11 +10,12 @@ repos:
|
|
|
10
10
|
- id: check-added-large-files
|
|
11
11
|
- id: debug-statements
|
|
12
12
|
- repo: https://github.com/psf/black
|
|
13
|
-
rev:
|
|
13
|
+
rev: 25.1.0
|
|
14
14
|
hooks:
|
|
15
15
|
- id: black
|
|
16
16
|
args: [ "-l 100" ]
|
|
17
|
-
- repo: https://github.com/
|
|
18
|
-
rev:
|
|
17
|
+
- repo: https://github.com/pycqa/isort
|
|
18
|
+
rev: 5.12.0
|
|
19
19
|
hooks:
|
|
20
|
-
- id:
|
|
20
|
+
- id: isort
|
|
21
|
+
name: isort (python)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Definition of the base objects for the creation of a spec validator
|
|
3
3
|
"""
|
|
4
|
+
|
|
4
5
|
import logging
|
|
5
6
|
import os
|
|
6
7
|
from collections.abc import Mapping
|
|
@@ -8,9 +9,9 @@ from io import BytesIO
|
|
|
8
9
|
from numbers import Integral
|
|
9
10
|
from numbers import Real
|
|
10
11
|
from pathlib import Path
|
|
12
|
+
from typing import IO
|
|
11
13
|
from typing import Any
|
|
12
14
|
from typing import Callable
|
|
13
|
-
from typing import IO
|
|
14
15
|
from typing import Optional
|
|
15
16
|
from typing import Type
|
|
16
17
|
|
|
@@ -480,7 +481,7 @@ class SpecValidator:
|
|
|
480
481
|
:return: HDU
|
|
481
482
|
"""
|
|
482
483
|
new_hdu = fits.PrimaryHDU(data, header=fits.Header())
|
|
483
|
-
for
|
|
484
|
+
for key, value in validated_headers.items():
|
|
484
485
|
new_hdu.header[key] = value
|
|
485
486
|
for key in fits_cards:
|
|
486
487
|
try:
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Validators configured for specific Fits Specs
|
|
3
3
|
"""
|
|
4
|
+
|
|
5
|
+
from dkist_fits_specifications.dataset_extras import load_processed_dataset_extra
|
|
4
6
|
from dkist_fits_specifications.spec122 import load_processed_spec122
|
|
5
7
|
from dkist_fits_specifications.spec214 import load_processed_spec214
|
|
6
8
|
from dkist_fits_specifications.spec214.level0 import load_level0_spec214
|
|
@@ -52,3 +54,8 @@ spec214_validator = ProcessedSpecValidator(
|
|
|
52
54
|
spec_processor_function=load_processed_spec214,
|
|
53
55
|
SchemaValidationException=Spec214ValidationException,
|
|
54
56
|
)
|
|
57
|
+
|
|
58
|
+
spec_extras_validator = ProcessedSpecValidator(
|
|
59
|
+
spec_processor_function=load_processed_dataset_extra,
|
|
60
|
+
SchemaValidationException=SpecValidationException,
|
|
61
|
+
)
|
|
@@ -379,7 +379,8 @@ def test_validate_formatted_compressed_header(tmp_path):
|
|
|
379
379
|
When: Validating Headers
|
|
380
380
|
Then: Do not raise an exception.
|
|
381
381
|
"""
|
|
382
|
-
from .conftest import BaseSpec214DatasetCaseSensitive
|
|
382
|
+
from .conftest import BaseSpec214DatasetCaseSensitive
|
|
383
|
+
from .conftest import get_fits_object
|
|
383
384
|
|
|
384
385
|
fits_file = get_fits_object(
|
|
385
386
|
object_type="fits", tmpdir=tmp_path, ds=BaseSpec214DatasetCaseSensitive()
|
{dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/translator.py
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
from datetime import datetime
|
|
3
3
|
from functools import reduce
|
|
4
|
-
from typing import Any
|
|
5
4
|
from typing import IO
|
|
5
|
+
from typing import Any
|
|
6
6
|
|
|
7
7
|
from astropy.io import fits
|
|
8
8
|
from astropy.io.fits.hdu.hdulist import HDUList
|
|
@@ -105,7 +105,7 @@ def remove_spec_122_keys_and_spec_214_l0_keys(
|
|
|
105
105
|
expanded_214 = load_processed_spec214(**dict(input_headers))
|
|
106
106
|
all_214_keys = reduce(list.__add__, map(list, expanded_214.values()))
|
|
107
107
|
|
|
108
|
-
for keyword in header.keys():
|
|
108
|
+
for keyword in tuple(header.keys()):
|
|
109
109
|
# Only remove the keys that are in spec 122 AND not in spec 214
|
|
110
110
|
if (keyword in all_122_keys) and (keyword not in all_214_keys):
|
|
111
111
|
header.remove(keyword)
|
|
@@ -56,6 +56,12 @@ omit = dkist_header_validator/tests/*
|
|
|
56
56
|
console_scripts =
|
|
57
57
|
dkist-header-validator = dkist_header_validator.api.validate:main
|
|
58
58
|
|
|
59
|
+
[tool:isort]
|
|
60
|
+
profile = black
|
|
61
|
+
force_single_line = true
|
|
62
|
+
combine_as_imports = false
|
|
63
|
+
line_length = 100
|
|
64
|
+
|
|
59
65
|
[egg_info]
|
|
60
66
|
tag_build =
|
|
61
67
|
tag_date = 0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/api/__init__.py
RENAMED
|
File without changes
|
{dkist_header_validator-5.2.0 → dkist_header_validator-5.3.0}/dkist_header_validator/api/validate.py
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import typer
|
|
2
2
|
|
|
3
|
-
from dkist_header_validator.spec_validators import spec122_validator
|
|
4
3
|
from dkist_header_validator.spec_validators import Spec122ValidationException
|
|
5
|
-
from dkist_header_validator.spec_validators import spec214_validator
|
|
6
4
|
from dkist_header_validator.spec_validators import Spec214ValidationException
|
|
5
|
+
from dkist_header_validator.spec_validators import spec122_validator
|
|
6
|
+
from dkist_header_validator.spec_validators import spec214_validator
|
|
7
7
|
|
|
8
8
|
app = typer.Typer(help="CLI for the dkist-header-validator package")
|
|
9
9
|
"""
|
|
File without changes
|
|
File without changes
|
|
@@ -6,8 +6,8 @@ from astropy.io import fits
|
|
|
6
6
|
from astropy.io.fits.hdu.hdulist import HDUList
|
|
7
7
|
|
|
8
8
|
from dkist_header_validator import ReturnTypeException
|
|
9
|
-
from dkist_header_validator import spec122_validator
|
|
10
9
|
from dkist_header_validator import Spec122ValidationException
|
|
10
|
+
from dkist_header_validator import spec122_validator
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
def test_translate_spec122_to_214_l0_base(valid_spec_122_object):
|
|
File without changes
|
|
@@ -4,8 +4,8 @@ from pathlib import Path
|
|
|
4
4
|
import numpy as np
|
|
5
5
|
import pytest
|
|
6
6
|
|
|
7
|
-
from dkist_header_validator import spec122_validator
|
|
8
7
|
from dkist_header_validator import Spec122ValidationException
|
|
8
|
+
from dkist_header_validator import spec122_validator
|
|
9
9
|
from dkist_header_validator.exceptions import ReturnTypeException
|
|
10
10
|
from dkist_header_validator.exceptions import ValidationException
|
|
11
11
|
|
|
@@ -4,9 +4,9 @@ from pathlib import Path
|
|
|
4
4
|
import numpy as np
|
|
5
5
|
import pytest
|
|
6
6
|
|
|
7
|
+
from dkist_header_validator import Spec214ValidationException
|
|
7
8
|
from dkist_header_validator import spec214_l0_validator
|
|
8
9
|
from dkist_header_validator import spec214_validator
|
|
9
|
-
from dkist_header_validator import Spec214ValidationException
|
|
10
10
|
from dkist_header_validator.exceptions import ReturnTypeException
|
|
11
11
|
from dkist_header_validator.exceptions import ValidationException
|
|
12
12
|
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from dkist_fits_specifications.utils import schema_type_hint
|
|
2
|
-
from dkist_fits_specifications.utils.spec_processors.expansion import expand_schema
|
|
3
2
|
from dkist_fits_specifications.utils.spec_processors.expansion import ExpansionIndex
|
|
3
|
+
from dkist_fits_specifications.utils.spec_processors.expansion import expand_schema
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def expand_naxis(naxis: int, schema: schema_type_hint) -> schema_type_hint:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|