Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
johnml1135 committed Oct 12, 2023
1 parent b44ac5a commit 4a655d8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion machine/jobs/nmt_engine_build_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ def __init__(self, config: Any, nmt_model_factory: NmtModelFactory, shared_file_
self._shared_file_service = shared_file_service
self.clearml_task: Optional[Task] = None

def run(self, task: Optional[Task]) -> None:
def run(self, task: Optional[Task] = None) -> None:
self.clearml_task = task
self._send_clearml_config()
self._check_canceled()

self._nmt_model_factory.init()

Expand Down
3 changes: 2 additions & 1 deletion tests/jobs/test_nmt_engine_build_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ def test_run() -> None:
def test_cancel() -> None:
env = _TestEnvironment()
checker = _CancellationChecker(3)
setattr(env.job, "_check_canceled", checker.check_canceled)
with pytest.raises(CanceledError):
env.job.run(checker.check_canceled)
env.job.run()

assert env.target_pretranslations == ""

Expand Down
4 changes: 2 additions & 2 deletions typings/networkx/classes/digraph.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ class DiGraph(Graph[T]):
edge_attr_dict_factory: Any = ...
graph: Any = ...
@overload
def __init__(self, incoming_graph_data: DiGraph[T] = ..., **attr: Any) -> None: ...
def __init__(self, incoming_graph_data: DiGraph[T] = ..., **attr: Any) -> None: ... # type: ignore
# @overload
# def __init__(self, incoming_graph_data: Optional[Any] = ..., **attr: Any) -> None: ...
@overload
def __init__(self, incoming_graph_data: List[Tuple[T, T]] = ..., **attr: Any) -> None: ...
def __init__(self, incoming_graph_data: List[Tuple[T, T]] = ..., **attr: Any) -> None: ... # type: ignore
@property
def adj(self): ...
@property
Expand Down

0 comments on commit 4a655d8

Please sign in to comment.