Skip to content

Commit

Permalink
CADC-9764 - code review comments from CADC-9555 (#148)
Browse files Browse the repository at this point in the history
* CADC-9764 - Add support for 'cadc' scheme as provided by StorageInventoryClient.
  • Loading branch information
SharonGoliath authored Sep 9, 2021
1 parent 2b0cc70 commit 3182408
Show file tree
Hide file tree
Showing 31 changed files with 1,620 additions and 676 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/cibuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ jobs:
strategy:
fail-fast: true
matrix:
#TODO 2.7 fails on GH Actions but cannot be reproduced locally. Disabled for now.
# python-version: [2.7,3.5,3.6,3.7,3.8,3.9]
python-version: [3.5,3.6,3.7,3.8,3.9]
python-version: [3.6,3.7,3.8,3.9]
package: [caom2, caom2utils, caom2repo]
steps:
- name: Checkout code
Expand Down
10 changes: 4 additions & 6 deletions caom2repo/dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
-e ../caom2
-e .
pytest>=4.6
pytest-cov>=2.5.1
flake8>=3.4.1
funcsigs==1.0.2
mock==2.0.0
xml-compare==1.0.5
pytest>=6.2
pytest-cov>=2.12
flake8>=3.9
mock>=4.0
4 changes: 2 additions & 2 deletions caom2repo/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ testpaths = caom2repo

[metadata]
package_name = caom2repo
description = CAOM-2.3 repo access and tools
long_description = Tools for accessing a repo for the CAOM-2.3 data model
description = CAOM-2.4 repo access and tools
long_description = Tools for accessing a repo for the CAOM-2.4 data model
author = Canadian Astronomy Data Centre
author_email = [email protected]
license = AGPLv3
Expand Down
3 changes: 1 addition & 2 deletions caom2repo/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,13 @@ def run(self):
use_2to3=False,
setup_requires=['pytest-runner'],
entry_points=entry_points,
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4',
python_requires='!=2.*, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4',
packages=find_packages(),
package_data={PACKAGENAME: ['data/*', 'tests/data/*', '*/data/*', '*/tests/data/*']},
classifiers=[
'Natural Language :: English',
'License :: OSI Approved :: GNU Affero General Public License v3',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
],
cmdclass = {
Expand Down
2 changes: 1 addition & 1 deletion caom2repo/tests/test-integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def test_create_and_visit(self):
client = CAOM2RepoClient(subject)

# create one observation for today
algorithm = observation.SimpleObservation._ALGORITHM
algorithm = observation.SimpleObservation._DEFAULT_ALGORITHM_NAME

logger.debug("test obs name {}".format(name))
obs = observation.SimpleObservation("TEST", obs_name)
Expand Down
2 changes: 1 addition & 1 deletion caom2repo/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name = caom2repo

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

Expand Down
1 change: 1 addition & 0 deletions caom2utils/caom2utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
TODO
"""

from .data_util import * # noqa
from .fits2caom2 import * # noqa
from .legacy import * # noqa
from .wcs_util import * # noqa
Expand Down
7 changes: 2 additions & 5 deletions caom2utils/caom2utils/caomvalidator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# ***********************************************************************
# ****************** CANADIAN ASTRONOMY DATA CENTRE *******************
# ************* CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
Expand Down Expand Up @@ -73,8 +72,6 @@
"""


from __future__ import (absolute_import, print_function, unicode_literals)

import logging

from caom2 import Observation, Plane, Artifact, Part, Chunk
Expand Down Expand Up @@ -217,10 +214,10 @@ def _validate_keyword(name, keywords):
for keyword in keywords:
if keyword is not None and keyword.find('|') != -1:
raise AssertionError(
'invalid {}: may not contain pipe (|)'.format(name))
f'invalid {name}: may not contain pipe (|)')


def _check_param(param, param_type):
if param is None or not isinstance(param, param_type):
raise ValueError(
'{} must be a valid {}.'.format(param, param_type.__name__))
f'{param} must be a valid {param_type.__name__}.')
Loading

0 comments on commit 3182408

Please sign in to comment.