From 5edd8ba6cb034921d44602d5cea58efa0fbee317 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 4 Oct 2023 09:14:39 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- zndraw/app.py | 5 ++++- zndraw/zndraw.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/zndraw/app.py b/zndraw/app.py index 46d4ccae4..1ed0bf0cd 100644 --- a/zndraw/app.py +++ b/zndraw/app.py @@ -35,7 +35,7 @@ def index(): stop=app.config.get("stop"), step=app.config.get("step"), ), - "wait": True + "wait": True, } proc = mp.Process( @@ -60,6 +60,7 @@ def on_join(data): session["uuid"] = data["uuid"] join_room(session["uuid"]) + @app.route("/exit") def exit_route(): """Exit the session.""" @@ -115,10 +116,12 @@ def analysis_schema(data): def selection_schema(): io.emit("selection:schema", get_selection_class().model_json_schema()) + @io.on("draw:schema") def draw_schema(): io.emit("draw:schema", Geometry.updated_schema()) + @io.on("scene:schema") def scene_schema(): import enum diff --git a/zndraw/zndraw.py b/zndraw/zndraw.py index e18bad872..114a0b935 100644 --- a/zndraw/zndraw.py +++ b/zndraw/zndraw.py @@ -121,7 +121,7 @@ def __post_init__(self): self.socket.connect(self.url) if not self.jupyter: self.socket.sleep(2) # wait for the server to start - + if self.wait: self.socket.wait() @@ -262,7 +262,7 @@ def read(self, filename: str, start: int = 0, stop: int = None, step: int = 1): atoms_list = list(ase.io.iread(filename))[start:stop:step] for idx, atoms in tqdm.tqdm( enumerate(atoms_list), ncols=100, total=len(atoms_list) - ): + ): self[idx] = atoms def get_selection(self) -> list[int]: