Skip to content

Commit

Permalink
Add a simple logging area/task runner
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgleith committed Jan 2, 2024
1 parent 1b22cec commit 2088486
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions dep_tools/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,20 @@ def run(self):
self.logger.debug([self.id, "complete", paths])

return paths


class SimpleLoggingAreaTask(AreaTask):
def run(self):
self.logger.info("Preparing to load data")
input_data = self.loader.load(self.area)
self.logger.info(f"Found {len(input_data.time)} timesteps to load")

self.logger.info("Preparing to process data")
output_data = self.processor.process(input_data)
self.logger.info(f"Processed data will have a result of shape: {[output_data.dims[d] for d in ['x', 'y']]}")

self.logger.info("Processing and writing data...")
paths = self.writer.write(output_data, self.id)
self.logger.info(f"Succesfully wrote data to {len(paths)} paths")

return paths

0 comments on commit 2088486

Please sign in to comment.