Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Cody Baker <[email protected]>
  • Loading branch information
garrettmflynn and CodyCBakerPhD authored Mar 14, 2024
1 parent 3806458 commit c258d18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/tqdm_publisher/_demo/_multiple/_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def run(self):
Defaults are chosen for a deterministic and regular update period of one second for a total time of one minute.
"""
all_task_durations_in_seconds = [0.1 for _ in range(100)] # Ten seconds of one hundred tasks
all_task_durations_in_seconds = [1.0 for _ in range(10)] # Ten seconds at one task per second
progress_bar = self.progress_bar = tqdm_publisher.TQDMPublisher(iterable=all_task_durations_in_seconds)
progress_bar.subscribe(callback=self.update)

Expand All @@ -59,7 +59,7 @@ async def spawn_server() -> None:
await asyncio.Future()


def run_demo() -> None:
def run_multiple_bar_demo() -> None:
"""Trigger the execution of the asynchronous spawn."""
asyncio.run(spawn_server())

Expand Down
6 changes: 2 additions & 4 deletions src/tqdm_publisher/_demo/_single_bar/_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def start_progress_bar(*, progress_callback: callable) -> None:
Defaults are chosen for a deterministic and regular update period of one second for a total time of one minute.
"""
all_task_durations_in_seconds = [0.1 for _ in range(100)] # Ten seconds of one hundred tasks
all_task_durations_in_seconds = [1.0 for _ in range(10)] # Ten seconds at one second per task
progress_bar = tqdm_publisher.TQDMPublisher(iterable=all_task_durations_in_seconds)

def run_function_on_progress_update(format_dict: dict) -> None:
Expand Down Expand Up @@ -75,10 +75,8 @@ async def spawn_server() -> None:
await asyncio.Future()


def run_demo() -> None:
def run_single_bar_demo() -> None:
"""Trigger the execution of the asynchronous spawn."""
asyncio.run(spawn_server())


if __name__ == "__main__":
run_demo()

0 comments on commit c258d18

Please sign in to comment.