From 2f03467c34ccada3a657489fdee2a869351eb72c Mon Sep 17 00:00:00 2001 From: Simon Liu Date: Fri, 16 Feb 2024 15:01:53 -0800 Subject: [PATCH] /deploy uat --- .github/workflows/build.yml | 1 + podaac/tig/tig.py | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf6f4fa..a483047 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -249,6 +249,7 @@ jobs: run: | poetry run pylint podaac poetry run flake8 podaac + poetry run pytest --junitxml=build/reports/pytest.xml --cov=podaac/ --cov-report=html -m "not aws and not integration" tests/ # poetry run pytest --junitxml=build/reports/pytest.xml --cov=podaac/ --cov-report=xml:build/reports/coverage.xml -m "not aws and not integration" tests/ ## TODO: Find out where the test report goes diff --git a/podaac/tig/tig.py b/podaac/tig/tig.py index 2652fa3..eab2f6e 100644 --- a/podaac/tig/tig.py +++ b/podaac/tig/tig.py @@ -209,10 +209,10 @@ def _crosses(self, lons): prev = x_val continue if prev > 0 > x_val and prev - x_val > 200: - self.logger.debug("prev, x: %s, %s", prev, x_val) + self.logger.debug(f"prev, x: {prev}, {x_val}") result = True elif x_val > 0 > prev and x_val - prev > 200: - self.logger.debug("prev, x: %s, %s", prev, x_val) + self.logger.debug(f"prev, x: {prev}, {x_val}") result = True return result @@ -399,7 +399,7 @@ def generate_images(self, image_format='png', nearest=False, world_file=False, g List of output image file locations """ - self.logger.info("\nProcessing %s", self.input_file) + self.logger.info(f"\nProcessing {self.input_file}") output_images = [] if self.config.get('multi_lon_lat'): for group in self.config.get('multi_groups'): @@ -453,8 +453,10 @@ def generate_images_group(self, image_format='png', nearest=False, world_file=Fa self.logger.debug("Region crosses 180/-180") region = (southern, northern, -180, 180) - region = (-90, 90, -180, 180) - self.logger.info("region: %s", str(region)) + if self.config.get('global_grid', False): + region = (-90, 90, -180, 180) + + self.logger.info(f"region: {region}") height_deg = region[1] - region[0] width_deg = region[3] - region[2] self.region = Region(region) @@ -618,7 +620,7 @@ def process_variable(self, # Get variable name config_variable = var['id'] - self.logger.info('variable: %s', config_variable) + self.logger.info(f'variable: {config_variable}') group, _, variable = config_variable.rpartition('/') if param_group: @@ -638,7 +640,7 @@ def process_variable(self, local_dataset.close() # Get palette info - self.logger.info('palette: %s', var['palette']) + self.logger.info(f"palette: {var['palette']}") colormap = load_json_palette(self.palette_dir, var['palette'], alpha) # Set the output location @@ -678,7 +680,7 @@ def process_variable(self, cmap=colormap, format=image_format) - self.logger.info("Wrote %s", output_location) + self.logger.info(f"Wrote {output_location}") # Create world file if specified if world_file: @@ -689,7 +691,7 @@ def process_variable(self, self.region.min_lon) with open(output_wld, 'w') as wld: wld.write(wld_string) - self.logger.info("Wrote %s", output_wld) + self.logger.info(f"Wrote {output_wld}") except grids.GridDefinitionError: self.logger.warning("Could not grid variable %s", variable.split('/')[-1], exc_info=True)