-
Notifications
You must be signed in to change notification settings - Fork 20
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
add new tests (load catalog and quantities) #310
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks fine.
I got two failed tests. If this is expected and the tests are revealing a problem, then adding the tests in the PR remains good.
If there is instead some reason that the test itself is wrong in its expectations, then please fix.
=================================== FAILURES ===================================
______ test_load_catalog_and_quantities[dc2_eimages_run1.2p_visit-181898] ______
catalog = 'dc2_eimages_run1.2p_visit-181898'
@pytest.mark.parametrize('catalog', all_catalogs)
def test_load_catalog_and_quantities(catalog):
> cat = GCRCatalogs.load_catalog(catalog)
tests/test_catalogs.py:11:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
GCRCatalogs/register.py:171: in load_catalog
return load_catalog_from_config_dict(config)
GCRCatalogs/register.py:120: in load_catalog_from_config_dict
BaseGenericCatalog)(**catalog_config)
/opt/lsst/software/stack/python/miniconda3-4.5.4/envs/lsst-scipipe-fcd27eb/lib/python3.6/site-packages/GCR/base.py:27: in __init__
self._subclass_init(**kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <GCRCatalogs.eimage.EImageReader object at 0x2aaac852b240>
root_dir = '/global/projecta/projectdirs/lsst/global/DC2/DC2-R1-2p-WFD-r/000008'
visits = 181898, default_rebinning = 16, dirpath_contain = None
filename_pattern = 'lsst_e_(\\d+)(?:_f\\d+)?_(R\\d\\d)_(S\\d\\d)(?:_E\\d+)?(?:_[a-z])?\\.fits\\.gz$'
kwargs = {'description': 'phoSim e-images for Run 1.2p (visit 181898)', 'subclass_name': 'eimage.EImageReader'}
def _subclass_init(self, root_dir, visits=None, default_rebinning=None,
dirpath_contain=None, filename_pattern=_FILENAME_PATTERN,
**kwargs):
# pylint: disable=W0221
if not os.path.isdir(root_dir):
> raise ValueError('`root_dir` must be a valid directory')
E ValueError: `root_dir` must be a valid directory
GCRCatalogs/eimage.py:101: ValueError
______ test_load_catalog_and_quantities[dc2_eimages_run1.2i_visit-181898] ______
catalog = 'dc2_eimages_run1.2i_visit-181898'
@pytest.mark.parametrize('catalog', all_catalogs)
def test_load_catalog_and_quantities(catalog):
> cat = GCRCatalogs.load_catalog(catalog)
tests/test_catalogs.py:11:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
GCRCatalogs/register.py:171: in load_catalog
return load_catalog_from_config_dict(config)
GCRCatalogs/register.py:120: in load_catalog_from_config_dict
BaseGenericCatalog)(**catalog_config)
/opt/lsst/software/stack/python/miniconda3-4.5.4/envs/lsst-scipipe-fcd27eb/lib/python3.6/site-packages/GCR/base.py:27: in __init__
self._subclass_init(**kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <GCRCatalogs.eimage.EImageReader object at 0x2aab1f8c46a0>
root_dir = '/global/projecta/projectdirs/lsst/production/DC2_ImSim/DC2-R1-2p-WFD-r'
visits = 181898, default_rebinning = 16, dirpath_contain = '000008_batch'
filename_pattern = 'lsst_e_(\\d+)(?:_f\\d+)?_(R\\d\\d)_(S\\d\\d)(?:_E\\d+)?(?:_[a-z])?\\.fits\\.gz$'
kwargs = {'description': 'ImSim e-images for Run 1.2i (visit 181898)', 'subclass_name': 'eimage.EImageReader'}
def _subclass_init(self, root_dir, visits=None, default_rebinning=None,
dirpath_contain=None, filename_pattern=_FILENAME_PATTERN,
**kwargs):
# pylint: disable=W0221
if not os.path.isdir(root_dir):
> raise ValueError('`root_dir` must be a valid directory')
E ValueError: `root_dir` must be a valid directory
GCRCatalogs/eimage.py:101: ValueError
@@ -1,31 +1,25 @@ | |||
from __future__ import unicode_literals, absolute_import, print_function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay! We're living in the future!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
and also switch to pytest