Esempio n. 1
0
 def test_init_qa_brick(self):
     #- Simple Init calls
     qabrck = QA_Brick(name='tst_brick')
     assert qabrck.brick_name == 'tst_brick'
     #
     qabrck.init_zbest()
     assert qabrck.data['ZBEST']['PARAMS']['MAX_NFAIL'] > 0
Esempio n. 2
0
 def _write_qabrick(self):
     """Write a QA data brick file"""
     qabrck = QA_Brick()
     # ZBEST
     qabrck.init_zbest()
     qabrck.data['ZBEST']['METRICS'] = {}
     qabrck.data['ZBEST']['METRICS']['NFAIL'] = 10
     write_qa_brick(self.qafile_brick, qabrck)
     self.files_written.append(self.qafile_brick)
Esempio n. 3
0
def load_qa_brick(filename):
    """ Load an existing QA_Brick or generate one, as needed
    Args:
        filename: str

    Returns:
    qa_brick: QA_Brick object
    """
    from desispec.qa.qa_brick import QA_Brick
    log = get_logger()
    if os.path.isfile(filename):  # Read from file, if it exists
        qabrick = read_qa_brick(filename)
        log.info("Loaded QA file {:s}".format(filename))
    else:  # Init
        qabrick = QA_Brick()
    # Return
    return qabrick