Compare commits
No commits in common. "348906e08eea44dbb08f7316e3e48124a92de315" and "18b6bee0a08902221c2146f51d7dc7a6cc6c6437" have entirely different histories.
348906e08e
...
18b6bee0a0
|
|
@ -124,7 +124,6 @@ class AFCMUniverseMapFile:
|
|||
self.mosaic_head = map_dict.get('mosaic', {})
|
||||
self.metadata = map_dict.get('metadata', {})
|
||||
self.mosaic_file_list = map_dict.get('files', {})
|
||||
self.mosaic_postprocess = map_dict.get('postprocess', {})
|
||||
|
||||
return None
|
||||
|
||||
|
|
@ -139,8 +138,7 @@ class AFCMUniverseMapFile:
|
|||
|
||||
output_object = json.dumps({"mosaic": self.mosaic_head,
|
||||
"metadata": self.metadata,
|
||||
"files": self.mosaic_file_list,
|
||||
"postprocess": self.mosaic_postprocess}, indent=4)
|
||||
"files": self.mosaic_file_list}, indent=4)
|
||||
|
||||
with open(filename, 'w', encoding="UTF-8") as outfile:
|
||||
outfile.write(output_object)
|
||||
|
|
@ -208,7 +206,11 @@ class AFCMUniverseMapFile:
|
|||
self.process_file(ufilename)
|
||||
|
||||
# Perform post-processing
|
||||
self.postprocessing()
|
||||
if len(self.mosaic_postprocess) is not 0:
|
||||
self.postprocessing()
|
||||
else:
|
||||
# copy self.cleaned_import_rows list to self.final_rows list
|
||||
self.final_rows = self.cleaned_import_rows[:]
|
||||
|
||||
# Run final steps
|
||||
self.write_final_file()
|
||||
|
|
@ -218,21 +220,21 @@ class AFCMUniverseMapFile:
|
|||
def postprocessing(self):
|
||||
"""
|
||||
postprocessing Performs actions for any postprocessing rules defined in the voterset map file
|
||||
|
||||
structure in the map file:
|
||||
"postprocess": {
|
||||
"range": {
|
||||
"start": 0,
|
||||
"end": 10000
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
# need to figure out how to handle rules in defined order
|
||||
# structure in the map file
|
||||
# "postprocess": {
|
||||
# "range": {
|
||||
# "start": 0,
|
||||
# "end": 10000
|
||||
# }
|
||||
# }
|
||||
|
||||
# if no range is defined, this copies the entire list from self.cleaned_import_rows
|
||||
range = self.mosaic_postprocess.get('range', {})
|
||||
self.final_rows = self.cleaned_import_rows[range.get('start', None):range.get('end', None)]
|
||||
|
||||
# get list of keys from "postprocess"
|
||||
# if "range" exists,
|
||||
# get "start" and "end" keys
|
||||
# copy the range from cleaned_import_rows into final_rows
|
||||
|
||||
return
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue