Update universe_map_file.py to write 'mosaic_count' section into stats file

This commit is contained in:
Rick Ross 2024-01-20 10:01:00 -08:00
parent 348906e08e
commit e134c0d58c
1 changed files with 5 additions and 1 deletions

View File

@ -57,6 +57,7 @@ class AFCMUniverseMapFile:
"incoming_count": { "total": 0 }, "incoming_count": { "total": 0 },
"removed_count": { "total": 0 }, "removed_count": { "total": 0 },
"cleaned_count": { "total": 0 }, "cleaned_count": { "total": 0 },
"mosaic_count": { "total": 0 },
"removed_details": {}, "removed_details": {},
"timings": {} "timings": {}
} }
@ -465,8 +466,8 @@ class AFCMUniverseMapFile:
self.metadata["total_rows"] = len(self.final_rows) self.metadata["total_rows"] = len(self.final_rows)
# Need to write the FINAL file # Need to write the FINAL file
if len(self.final_rows) > 0:
final_filename = self.metadata.get('mosaic_filename', 'MOSAIC.csv') final_filename = self.metadata.get('mosaic_filename', 'MOSAIC.csv')
if len(self.final_rows) > 0:
final_full_pathname = f"/tmp/{final_filename}" final_full_pathname = f"/tmp/{final_filename}"
write_csv_file(final_full_pathname, self.final_rows[0].keys(), self.final_rows) write_csv_file(final_full_pathname, self.final_rows[0].keys(), self.final_rows)
@ -479,6 +480,9 @@ class AFCMUniverseMapFile:
# remove the temp file now # remove the temp file now
os.remove(final_full_pathname) os.remove(final_full_pathname)
self.stats['mosaic_count'][final_filename] = len(self.final_rows)
self.stats['mosaic_count']["total"] = self.stats["mosaic_count"][final_filename]
def write_stats_file(self): def write_stats_file(self):
""" """