Skip to content

Commit

Permalink
fix pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
superstar54 committed Dec 8, 2023
1 parent 3eac109 commit b7c935e
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 20 deletions.
3 changes: 3 additions & 0 deletions aiida_worktree/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
from .node import Node
from .decorator import node, build_node


__version__ = "0.0.4"

__all__ = ["WorkTree", "Node", "node", "build_node"]
3 changes: 3 additions & 0 deletions aiida_worktree/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
The commands need to be imported here for them to be registered with the top-level command group.
"""
from aiida_worktree.cli import cmd_tree


__all__ = ["cmd_tree"]
16 changes: 5 additions & 11 deletions aiida_worktree/engine/worktree.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


from aiida.engine.processes.exit_code import ExitCode
from aiida.engine.processes.process import Process, ProcessState
from aiida.engine.processes.process import Process

from aiida.engine.processes.workchains.awaitable import (
Awaitable,
Expand All @@ -30,9 +30,6 @@
from aiida.engine.processes.workchains.workchain import Protect, WorkChainSpec
from aiida.engine import run_get_node

from os.path import splitext
import yaml


if t.TYPE_CHECKING:
from aiida.engine.runners import Runner # pylint: disable=unused-import
Expand Down Expand Up @@ -275,8 +272,10 @@ def _do_step(self) -> t.Any:

# If the worktree is finished or the result is an ExitCode, we exit by returning
if finished:
result = self.finalize()
return result
if isinstance(result, ExitCode):
return result
else:
return self.finalize()

if self._awaitables:
return Wait(self._do_step, "Waiting before next step")
Expand Down Expand Up @@ -684,8 +683,6 @@ def run_nodes(self, names):
self.to_context(**{name: process})
elif node["metadata"]["node_type"] in ["worktree"]:
# process = run_get_node(executor, *args, **kwargs)
from aiida_worktree.utils import merge_properties
from aiida.orm.utils.serialize import serialize

print("node type: worktree.")
wt = self.run_executor(executor, args, kwargs, var_args, var_kwargs)
Expand Down Expand Up @@ -859,9 +856,6 @@ def check_parent_state(self, name):
"SKIPPED",
"FAILED",
]:
# print(
# f" {name}: Input node {link['from_node']}, {self.ctx.nodes[link['from_node']]['state']} ."
# )
ready = False
return (
ready,
Expand Down
4 changes: 1 addition & 3 deletions aiida_worktree/executors/qe.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import time
from aiida import engine, orm, load_profile
from aiida.orm import load_code
from aiida import load_profile

load_profile()

Expand Down
1 change: 0 additions & 1 deletion aiida_worktree/nodes/builtin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from aiida_worktree.node import Node
from aiida_worktree.executors.builtin import GatherWorkChain


class AiiDAGather(Node):
Expand Down
1 change: 0 additions & 1 deletion aiida_worktree/nodes/qe.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from aiida_worktree.node import Node
from aiida import orm


class AiiDAKpoint(Node):
Expand Down
2 changes: 0 additions & 2 deletions aiida_worktree/worktree.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def run(self):
"""
from aiida_worktree.engine.worktree import WorkTree as WorkTreeEngine
from aiida_worktree.utils import merge_properties
from aiida.orm.utils.serialize import serialize
from aiida.manage import manager

# One can not run again if the process is alreay created. otherwise, a new process node will
Expand Down Expand Up @@ -253,7 +252,6 @@ def play_nodes(self, nodes):

def reset(self):
"""Reset the worktree."""
from aiida.engine.processes import control

self.process = None
for node in self.nodes:
Expand Down
2 changes: 0 additions & 2 deletions tests/test_calcjob.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import time
import numpy as np
import aiida

aiida.load_profile()
Expand Down

0 comments on commit b7c935e

Please sign in to comment.