Handles range rule in postprocess

This commit is contained in:
Rick Ross 2024-01-19 13:42:58 -08:00
parent 693858b383
commit 08b4f63116
1 changed files with 13 additions and 17 deletions

View File

@ -208,11 +208,7 @@ class AFCMUniverseMapFile:
self.process_file(ufilename) self.process_file(ufilename)
# Perform post-processing # Perform post-processing
if len(self.mosaic_postprocess) is not 0: self.postprocessing()
self.postprocessing()
else:
# copy self.cleaned_import_rows list to self.final_rows list
self.final_rows = self.cleaned_import_rows[:]
# Run final steps # Run final steps
self.write_final_file() self.write_final_file()
@ -222,21 +218,21 @@ class AFCMUniverseMapFile:
def postprocessing(self): def postprocessing(self):
""" """
postprocessing Performs actions for any postprocessing rules defined in the voterset map file postprocessing Performs actions for any postprocessing rules defined in the voterset map file
structure in the map file:
"postprocess": {
"range": {
"start": 0,
"end": 10000
}
}
""" """
# structure in the map file # need to figure out how to handle rules in defined order
# "postprocess": {
# "range": {
# "start": 0,
# "end": 10000
# }
# }
# if no range is defined, this copies the entire list from self.cleaned_import_rows
# get list of keys from "postprocess" range = self.mosaic_postprocess.get('range', {})
# if "range" exists, self.final_rows = self.cleaned_import_rows[range.get('start', None):range.get('end', None)]
# get "start" and "end" keys
# copy the range from cleaned_import_rows into final_rows
return return