Skip to content

Commit

Permalink
Forgot to deploy reorganize_config().
Browse files Browse the repository at this point in the history
  • Loading branch information
trey0 committed Jul 31, 2024
1 parent 9cc15c0 commit 765e765
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions pano/pano_view/scripts/generate_tour.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ def reorganize_config(config):
def generate_tour(config_path, out_folder, package_paths):
with open(config_path, "r") as config_stream:
config = yaml.safe_load(config_stream)
reorganize_config(config)

install_static_files(out_folder, package_paths)
generate_tour_json(config, out_folder)
Expand Down
14 changes: 14 additions & 0 deletions pano/pano_view/scripts/prep_source_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,23 @@ def join_lists(lists):
return functools.reduce(operator.iadd, lists, [])


def reorganize_config(config):
"""
Modify `config` in place. For the top-level inspection_results
field: add the value for each scene into the config field of the
same name for that scene. (And delete the top-level field.)
"""
scenes = config["scenes"]
for field in ["inspection_results"]:
value = config.pop(field, {})
for scene_id, scene_value in value.items():
scenes[scene_id][field] = scene_value


def prep_source_images(config_path, stitch_folder, out_folder, num_jobs):
with open(config_path, "r") as config_stream:
config = yaml.safe_load(config_stream)
reorganize_config(config)

prep_image_q = join_lists(
(
Expand Down

0 comments on commit 765e765

Please sign in to comment.