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
Changes from 1 commit
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
Next Next commit
Updated ProductType dictionary
Adrian Damian authored and Adrian Damian committed May 8, 2024
commit aaccdc8b22d87219aa9f974f3fc1cfad5ced887c
2 changes: 1 addition & 1 deletion .github/workflows/cibuild.yml
Original file line number Diff line number Diff line change
@@ -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
74 changes: 50 additions & 24 deletions caom2/caom2/chunk.py
Original file line number Diff line number Diff line change
@@ -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
@@ -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
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',
7 changes: 5 additions & 2 deletions caom2/caom2/tests/test_chunk.py
Original file line number Diff line number Diff line change
@@ -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
@@ -103,7 +103,10 @@ def test_all(self):
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")


class TestChunk(unittest.TestCase):
2 changes: 1 addition & 1 deletion caom2/setup.cfg
Original file line number Diff line number Diff line change
@@ -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 =
2 changes: 1 addition & 1 deletion caom2/setup.py
Original file line number Diff line number Diff line change
@@ -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=[
2 changes: 1 addition & 1 deletion caom2/tox.ini
Original file line number Diff line number Diff line change
@@ -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

2 changes: 1 addition & 1 deletion caom2repo/setup.py
Original file line number Diff line number Diff line change
@@ -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=[
2 changes: 1 addition & 1 deletion caom2utils/setup.py
Original file line number Diff line number Diff line change
@@ -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=[