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

Updated ProductType dictionary #181

Merged
merged 4 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion .github/workflows/cibuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.8","3.9","3.10","3.11","3.12"]
package: [caom2, caom2utils, caom2repo]
exclude:
# temporary since hdf5 is not working yet
Expand Down
74 changes: 50 additions & 24 deletions caom2/caom2/chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# ****************** CANADIAN ASTRONOMY DATA CENTRE *******************
# ************* CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
#
# (c) 2022. (c) 2022.
# (c) 2024. (c) 2024.
# Government of Canada Gouvernement du Canada
# National Research Council Conseil national de recherches
# Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
Expand Down Expand Up @@ -82,31 +82,57 @@

class ProductType(OrderedEnum):
"""
SCIENCE: "science"
CALIBRATION: "calibration"
PREVIEW: "preview"
INFO: "info"
NOISE: "noise"
WEIGHT: "weight"
AUXILIARY: "auxiliary"
THUMBNAIL: "thumbnail"
BIAS: "bias"
DARK: "dark"
FLAT: "flat"
WAVECAL: "wavecal"
Subset of IVOA DataLink terms
andamian marked this conversation as resolved.
Show resolved Hide resolved
THIS = "this"
AUXILIARY = "auxiliary"
BIAS = 'bias'
CALIBRATION = 'calibration'
CODERIVED = 'coderived'
DARK = 'dark'
DOCUMENTATION = 'documentation'
ERROR = 'error'
FLAT = 'flat'
NOISE = 'noise'
PREVIEW = 'preview'
PREVIEW_IMAGE = 'preview-image'
PREVIEW_PLOT = 'preview-plot'
THUMBNAIL = 'thumbnail'
WEIGHT = 'weight'

"""
SCIENCE = "science"
CALIBRATION = "calibration"
PREVIEW = "preview"
INFO = "info"
NOISE = "noise"
WEIGHT = "weight"

THIS = "this"

AUXILIARY = "auxiliary"
THUMBNAIL = "thumbnail"
BIAS = "bias"
DARK = "dark"
FLAT = "flat"
WAVECAL = "wavecal"
BIAS = 'bias'
CALIBRATION = 'calibration'
CODERIVED = 'coderived'
DARK = 'dark'
DOCUMENTATION = 'documentation'
ERROR = 'error'
FLAT = 'flat'
NOISE = 'noise'
PREVIEW = 'preview'
PREVIEW_IMAGE = 'preview-image'
PREVIEW_PLOT = 'preview-plot'
THUMBNAIL = 'thumbnail'
WEIGHT = 'weight'

# DataLink terms explicitly not included
# counterpart
# cutout
# derivation
# detached - header
# package
# proc
# progenitor

# CAOM specific terms public
SCIENCE = 'science' # this

# deprecated
# INFO = 'info'
# CATALOG = 'catalog'


__all__ = ['ProductType', 'Chunk', 'ObservableAxis', 'SpatialWCS',
Expand Down
8 changes: 5 additions & 3 deletions caom2/caom2/tests/test_chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# ****************** CANADIAN ASTRONOMY DATA CENTRE *******************
# ************* CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
#
# (c) 2022. (c) 2022.
# (c) 2024. (c) 2024.
# Government of Canada Gouvernement du Canada
# National Research Council Conseil national de recherches
# Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
Expand Down Expand Up @@ -95,15 +95,17 @@ def test_all(self):
self.assertEqual(chunk.ProductType.SCIENCE.value, "science")
self.assertEqual(chunk.ProductType.CALIBRATION.value, "calibration")
self.assertEqual(chunk.ProductType.PREVIEW.value, "preview")
self.assertEqual(chunk.ProductType.INFO.value, "info")
self.assertEqual(chunk.ProductType.NOISE.value, "noise")
self.assertEqual(chunk.ProductType.WEIGHT.value, "weight")
self.assertEqual(chunk.ProductType.AUXILIARY.value, "auxiliary")
self.assertEqual(chunk.ProductType.THUMBNAIL.value, "thumbnail")
self.assertEqual(chunk.ProductType.BIAS.value, "bias")
self.assertEqual(chunk.ProductType.DARK.value, "dark")
self.assertEqual(chunk.ProductType.FLAT.value, "flat")
self.assertEqual(chunk.ProductType.WAVECAL.value, "wavecal")
self.assertEqual(chunk.ProductType.CODERIVED.value, "coderived")
self.assertEqual(chunk.ProductType.DOCUMENTATION.value, "documentation")
self.assertEqual(chunk.ProductType.PREVIEW_IMAGE.value, "preview-image")
self.assertEqual(chunk.ProductType.PREVIEW_PLOT.value, "preview-plot")
andamian marked this conversation as resolved.
Show resolved Hide resolved


class TestChunk(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion caom2/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ url = http://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/caom2
edit_on_github = False
github_project = opencadc/caom2tools
# version should be PEP386 compatible (http://www.python.org/dev/peps/pep-0386)
version = 2.6
version = 2.6.1

[options]
install_requires =
Expand Down
2 changes: 1 addition & 1 deletion caom2/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def run_tests(self):
use_2to3=False,
setup_requires=['pytest-runner'],
entry_points=entry_points,
python_requires='>=3.7, <4',
python_requires='>=3.8, <4',
packages=find_packages(),
package_data={PACKAGENAME: ['data/*', 'tests/data/*', '*/data/*', '*/tests/data/*']},
classifiers=[
Expand Down
2 changes: 1 addition & 1 deletion caom2/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name = caom2

[tox]
envlist =
py{27,34,35,36,37,38,39,310}
py{38,39,310,311,312}
requires =
pip >= 19.3.1

Expand Down
2 changes: 1 addition & 1 deletion caom2repo/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def run(self):
use_2to3=False,
setup_requires=['pytest-runner'],
entry_points=entry_points,
python_requires='>=3.7, <4',
python_requires='>=3.8, <4',
packages=find_packages(),
package_data={PACKAGENAME: ['data/*', 'tests/data/*', '*/data/*', '*/tests/data/*']},
classifiers=[
Expand Down
4 changes: 2 additions & 2 deletions caom2utils/caom2utils/tests/test_fits2caom2.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ def test_help():
<caom2:artifacts>
<caom2:artifact caom2:id="d2893703-b21e-425f-b7d0-ca1f58fdc011">
<caom2:uri>caom:CGPS/TEST/4axes_obs.fits</caom2:uri>
<caom2:productType>info</caom2:productType>
<caom2:productType>auxiliary</caom2:productType>
<caom2:parts>
<caom2:part caom2:id="d2893703-b21e-425f-b7d0-ca1f58fdc011">
<caom2:name>0</caom2:name>
Expand All @@ -692,7 +692,7 @@ def test_augment_observation():
test_obs_blueprint.set('Observation.telescope.geoLocationZ', '4741018.33097')

test_obs_blueprint.set('Plane.dataProductType', 'cube')
test_obs_blueprint.set('Artifact.productType', 'info')
test_obs_blueprint.set('Artifact.productType', 'auxiliary')
test_obs_blueprint.set('Artifact.releaseType', 'data')
test_obs_blueprint.set('Plane.calibrationLevel', '2')
test_fitsparser = FitsParser(sample_file_4axes_obs, test_obs_blueprint)
Expand Down
2 changes: 1 addition & 1 deletion caom2utils/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def run(self):
use_2to3=False,
setup_requires=['pytest-runner'],
entry_points=entry_points,
python_requires='>=3.7, <4',
python_requires='>=3.8, <4',
packages=find_packages(),
package_data={PACKAGENAME: ['data/*', 'tests/data/*', '*/data/*', '*/tests/data/*']},
classifiers=[
Expand Down