Пример #1
0
def main():
	rigor.domain.money.init(parameters)
	logger = rigor.logger.getLogger(__file__)
	database_mapper = DatabaseMapper(Database.instance(kDatabase))
	logger.debug('Fetching image IDs from database')
	images = database_mapper.get_images_for_analysis(kDomain, kLimit, False)
	for parameter_set in get_parameters():
		timestamp = datetime.utcnow().strftime("{0}-%Y%m%d_%H%M%S%f".format(kDomain))
		with open("{0}.params".format(timestamp), "w") as parameter_file:
			json.dump(parameter_set, parameter_file)
			parameter_file.write("\n")

		with open("{0}.results".format(timestamp), "w") as result_file:
			image_config = partial(rigor.domain.money.run, parameters=parameter_set)
			logger.debug('Processing {0} images'.format(len(images)))
			for result in map(image_config, images):
				result_file.write("\t".join([str(x) for x in result]))
				result_file.write("\n")
Пример #2
0
def test_logger_twice():
	logger = rigor.logger.get_logger(__file__)
	logger.debug('Logger call B')
	logger = rigor.logger.get_logger(__file__)
	logger.debug('Logger call C')
Пример #3
0
def test_logger_once():
	logger = rigor.logger.get_logger(__file__)
	logger.debug('Logger call A')