def generate_name(self, astrom_header, fits_header): epoch_field = self.get_epoch_field(astrom_header, fits_header) count = storage.increment_object_counter(storage.MEASURE3, epoch_field, dry_run=True) base = "DRY" return base + count.zfill(7 - len(base))
def generate_name(self, astrom_header, fits_header): epoch_field = get_epoch_field(astrom_header, fits_header) count = storage.increment_object_counter(storage.MEASURE3, epoch_field, dry_run=True) base = "DRY" return base + count.zfill(7 - len(base))
def generate_name(self, astrom_header, fits_header): """ Generates a name for an object given the information in its astrom observation header and FITS header. """ epoch_field = self.get_epoch_field(astrom_header, fits_header) count = storage.increment_object_counter(storage.MEASURE3, epoch_field) return epoch_field + count
def generate_name(self, astrom_header, fits_header): """ Generates a name for an object given the information in its astrom observation header and FITS header. """ ef = self.get_epoch_field(astrom_header, fits_header) epoch_field = ef[0]+ef[1] count = storage.increment_object_counter(storage.MEASURE3, epoch_field) return ef[1] + count
def test_increment_counter_doesnt_exist(self, get_property, set_property): get_property.return_value = None node_uri = "vos:drusk/OSSOS/astromdir/test" epoch_field = "13AE" counter = storage.increment_object_counter(node_uri, epoch_field) expected_tag = storage.build_counter_tag(epoch_field) expected_count = "01" get_property.assert_called_once_with(node_uri, expected_tag, ossos_base=True) assert_that(counter, equal_to(expected_count)) set_property.assert_called_once_with(node_uri, expected_tag, expected_count, ossos_base=True)
def _generate_provisional_name(q, astrom_header, fits_header): """ Generates a name for an object given the information in its astrom observation header and FITS header. :param q: a queue of provisional names to return. :type q: Queue :param astrom_header: :param fits_header: """ while True: ef = get_epoch_field(astrom_header, fits_header) epoch_field = ef[0] + ef[1] count = storage.increment_object_counter(storage.MEASURE3, epoch_field) try: q.put(ef[1] + count) except: break
def test_increment_object_counter_dryrun(self, get_property, set_property): get_property.return_value = "02" node_uri = "vos:drusk/OSSOS/astromdir/test" epoch_field = "13AE" counter = storage.increment_object_counter(node_uri, epoch_field, dry_run=True) expected_tag = storage.build_counter_tag(epoch_field, dry_run=True) expected_count = "03" assert_that(counter, equal_to(expected_count)) get_property.assert_called_once_with( node_uri, storage.build_counter_tag(epoch_field, dry_run=True), ossos_base=True) set_property.assert_called_once_with(node_uri, expected_tag, expected_count, ossos_base=True)