From e759ead02b274d44369a61fb6c1b5c02ccca8fa8 Mon Sep 17 00:00:00 2001 From: John Bouyer <109704002+Turfader@users.noreply.github.com> Date: Tue, 11 Apr 2023 16:21:51 -0700 Subject: [PATCH] Add files via upload --- README.md | 4 +++- a_star.py | 12 +++++++----- artemis_adc_launcher.py | 4 ++-- display.py | 3 +-- utils.py | 1 + 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 18092f7..9f9da4e 100644 --- a/README.md +++ b/README.md @@ -15,16 +15,18 @@ ## About The Project Welcome to the GitHub Repository for Team Cartographer's Application to the 2022-23 NASA App Development Challenge! Our team for this project from Anaheim, CA, is:
-- John B. ('23), Abhi A. ('23), Kion M. ('24), Kabir A. ('24), Natalie K. ('24), Chrysa N. ('24), Efe C. ('24)
+- John B. ('23), Abhi A. ('23), Kion M. ('24), Kabir A. ('24), Natalie K. ('24), Efe C. ('24)
## Acknowledgements and Thanks to: - James Ristow, NASA Kennedy Space Center
- Alexandre Tolstenko, Champlain College Division of IT and Science
+- Nchima Kapoma, New School Parsons College of Design - Dr. Brian Welch, NASA Goddard Flight Center
- Petter Amland, Creator of Python's Ursina Library
- Diana Ramirez, our ADC Lead Teacher
- Mrs. Leslie, Mr. Fawcett, Mr. Drake +- Chrysa N., Khiet H. ## In-App Music Credits - Petter Amland diff --git a/a_star.py b/a_star.py index 4cb03d3..16399e0 100644 --- a/a_star.py +++ b/a_star.py @@ -73,7 +73,7 @@ class BreakIt(Exception): @timeit def generate_comm_path(comm_path: List[Tuple[int, int]]) -> Tuple[List[Tuple[int, int, int]], List[Tuple[int, int]]]: for index, point in enumerate(comm_path): - print(f"\rgenerating communication checkpoints: {round(index / len(comm_path) * 100, 2)}% complete", end="") + print(f"\rGenerating communication checkpoints: {round(index / len(comm_path) * 100, 2)}% complete", end="") x, y = point[0], point[1] # If a point is already valid, then just leave it. @@ -108,6 +108,8 @@ def generate_comm_path(comm_path: List[Tuple[int, int]]) -> Tuple[List[Tuple[int # Now we generate a new path. final_path: List[Tuple[int, int, int]] = [] + comm_path = sorted(comm_path, key=lambda ele: (ele[0], ele[1])) + for i in range(len(comm_path) - 1): (start_x, start_y), (goal_x, goal_y) = \ (comm_path[i][0], comm_path[i][1]), (comm_path[i+1][0], comm_path[i+1][1]) @@ -161,7 +163,7 @@ def update_image(image_path: str, mvmt_path: List[tuple], comm_path: List[tuple] path: str = image_path img: Image.Image = Image.open(path) - print("updating path image") + print("Updating path image") for i in range(len(mvmt_path)): color: tuple = (0, 0, 255) x: int = mvmt_path[i][0] @@ -182,7 +184,7 @@ def update_image(image_path: str, mvmt_path: List[tuple], comm_path: List[tuple] # noinspection SpellCheckingInspection # noinspection PyGlobalUndefined def run_astar(sv) -> None: - print("finding a suitable lunar path") + print("Finding a suitable lunar path") global save save = sv @@ -199,7 +201,7 @@ def run_astar(sv) -> None: goal_node = Node(goal_x, goal_y) final_path = astar() - print("initial path generated") + print("Initial path generated") sub_10_path = None if checkpoints: @@ -210,7 +212,7 @@ def run_astar(sv) -> None: if final_path is not None: update_image(save.moon_surface_texture_image, final_path, sub_10_path) else: - show_warning("A* Pathfinding Error", "No Valid Path found between points.") + show_warning("Congrats on finding a bug!", "This shouldn't happen, contact a developer ASAP!") if checkpoints: print("Created Path with Communication Checkpoints") diff --git a/artemis_adc_launcher.py b/artemis_adc_launcher.py index e208b75..1f005a9 100644 --- a/artemis_adc_launcher.py +++ b/artemis_adc_launcher.py @@ -28,9 +28,9 @@ packages = ["Pillow", "numpy", "ursina", "PySimpleGUI", "orjson", "seaborn"] for package in packages: run([sys.executable, "-m", "pip", "install", package], check=True) - print(f"installed package: {package}") + print(f"Installed package: {package}") - print(f"venv creation completed in {round(time()-start, 2)}s") + print(f"Venv creation completed in {round(time()-start, 2)}s") print("\nRunning application") diff --git a/display.py b/display.py index 67808f0..99a9365 100644 --- a/display.py +++ b/display.py @@ -168,8 +168,7 @@ def cleanup(): # Music Functionality -------------- track_list: list = ["assets/Night_Sky-Petter_Amland.mp3", "assets/Buffalo-Petter_Amland.mp3.mp3", - "assets/Seraph-Petter_Amland.mp3", "assets/Lonely_Wasteland-John_Bouyer_ft._Natalie_Kwok.mp3", - "assets/Sonata_in-C-Sharp_Minor-John_Bouyer.mp3"] + "assets/Seraph-Petter_Amland.mp3"] menu_track_list: list = ["assets/Lonely_Wasteland-John_Bouyer_ft._Natalie_Kwok.mp3", "OSU!_Pause_Menu_Track.mp3"] run_music = Audio( diff --git a/utils.py b/utils.py index 92c5778..c839dac 100644 --- a/utils.py +++ b/utils.py @@ -19,6 +19,7 @@ def timed(*args, **kw): return timed +@timeit def load_json(json_path: str): with open(json_path, 'rb') as f: data = oj.loads(f.read())