add_mapping_range #1

Merged
eross merged 3 commits from add_mapping_range into master 2024-01-19 21:59:36 +00:00
1 changed files with 13 additions and 17 deletions
Showing only changes of commit 08b4f63116 - Show all commits

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