Example #1
0
 def testLoadingOfConfigFileDataIds(self):
     pbStruct = util.loadDataIdsAndParameters(self.configFile)
     # Tests of the dict entries require constructing and comparing sets
     self.assertEqual(set(['r']),
                      set([d['filter'] for d in pbStruct.dataIds]))
     self.assertEqual(set([849375, 850587]),
                      set([d['visit'] for d in pbStruct.dataIds]))
Example #2
0
    # Should clean up the duplication here between this and validate.run
    if args.repo[-5:] == '.json':
        load_json = True
    else:
        load_json = False

    kwargs = {}
    kwargs['verbose'] = args.verbose
    kwargs['makePlot'] = args.makePlot

    kwargs['verbose'] = args.verbose
    kwargs['level'] = args.level

    if not load_json:
        if args.configFile:
            pbStruct = util.loadDataIdsAndParameters(args.configFile)
            kwargs = pbStruct.getDict()

        if not args.configFile or not pbStruct.dataIds:
            kwargs['dataIds'] = util.discoverDataIds(args.repo)
            if args.verbose:
                print("VISITDATAIDS: ", kwargs['dataIds'])

        if not os.path.exists(args.metricsFile):
            print('Could not find metric definitions: {0}'.format(
                args.metricsFile))
            sys.exit(1)
        metrics = load_metrics(args.metricsFile)
        kwargs['metrics'] = metrics

    validate.run(args.repo, **kwargs)
Example #3
0
 def testLoadingEmptyDataIds(self):
     pbStruct = util.loadDataIdsAndParameters(self.configFileNoDataIds)
     # Tests of the dict entries require constructing and comparing sets
     self.assertFalse(pbStruct.dataIds)
Example #4
0
 def testLoadingOfConfigFileDataIds(self):
     pbStruct = util.loadDataIdsAndParameters(self.configFile)
     # Tests of the dict entries require constructing and comparing sets
     self.assertEqual(set(['r']), set([d['filter'] for d in pbStruct.dataIds]))
     self.assertEqual(set([849375, 850587]),
                      set([d['visit'] for d in pbStruct.dataIds]))
Example #5
0
 def testLoadingOfConfigFileParameters(self):
     pbStruct = util.loadDataIdsAndParameters(self.configFile)
     self.assertAlmostEqual(pbStruct.brightSnr, 100)
     self.assertAlmostEqual(pbStruct.medianAstromscatterRef, 25)
     self.assertAlmostEqual(pbStruct.medianPhotoscatterRef, 25)
     self.assertAlmostEqual(pbStruct.matchRef, 5000)
Example #6
0
 def testLoadingEmptyDataIds(self):
     pbStruct = util.loadDataIdsAndParameters(self.configFileNoDataIds)
     # Tests of the dict entries require constructing and comparing sets
     self.assertFalse(pbStruct.dataIds)
Example #7
0
 def testLoadingOfConfigFileParameters(self):
     pbStruct = util.loadDataIdsAndParameters(self.configFile)
     self.assertAlmostEqual(pbStruct.brightSnrMin, 50)
                        help='path to a repository containing the output of processCcd')
    parser.add_argument('--configFile', '-c', type=str, default=None,
                        help='YAML configuration file validation parameters and dataIds.')
    parser.add_argument('--verbose', '-v', default=False, action='store_true',
                        help='Display additional information about the analysis.')
    
    args = parser.parse_args()

    if not os.path.isdir(args.repo):
        print("Could not find repo %r" % (args.repo,))
        sys.exit(1)

    kwargs = {}
    if args.configFile:
        dataIds, brightSnr, medianAstromscatterRef, medianPhotoscatterRef, matchRef = \
            util.loadDataIdsAndParameters(args.configFile)
        kwargs = {
            'brightSnr': brightSnr, 
            'medianAstromscatterRef': medianAstromscatterRef, 
            'medianPhotoscatterRef': medianPhotoscatterRef, 
            'matchRef': matchRef,
            }

    if not args.configFile or not dataIds:
        dataIds = util.discoverDataIds(args.repo)
        if args.verbose:
            print("VISITDATAIDS: ", dataIds)

    kwargs['verbose'] = args.verbose
    validate.run(args.repo, dataIds, **kwargs)
Example #9
0
 def testLoadingOfConfigFileParameters(self):
     pbStruct = util.loadDataIdsAndParameters(self.configFile)
     self.assertAlmostEqual(pbStruct.brightSnr, 100)
     self.assertAlmostEqual(pbStruct.medianAstromscatterRef, 25)
     self.assertAlmostEqual(pbStruct.medianPhotoscatterRef, 25)
     self.assertAlmostEqual(pbStruct.matchRef, 5000)