From 84275692651c6bcfcd5b24e8ec663a13b0d8632b Mon Sep 17 00:00:00 2001 From: superstar54 Date: Thu, 28 Nov 2024 16:30:05 +0100 Subject: [PATCH] fix type hints --- src/aiida_pythonjob/data/serializer.py | 2 +- src/aiida_pythonjob/launch.py | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/aiida_pythonjob/data/serializer.py b/src/aiida_pythonjob/data/serializer.py index 8064d05..cb56cf3 100644 --- a/src/aiida_pythonjob/data/serializer.py +++ b/src/aiida_pythonjob/data/serializer.py @@ -51,7 +51,7 @@ def get_serializer_from_entry_points() -> dict: eps = get_serializer_from_entry_points() -def serialize_to_aiida_nodes(inputs: dict | None = None) -> dict: +def serialize_to_aiida_nodes(inputs: dict) -> dict: """Serialize the inputs to a dictionary of AiiDA data nodes. Args: diff --git a/src/aiida_pythonjob/launch.py b/src/aiida_pythonjob/launch.py index 651fe4e..c8e9f5c 100644 --- a/src/aiida_pythonjob/launch.py +++ b/src/aiida_pythonjob/launch.py @@ -1,6 +1,6 @@ import inspect import os -from typing import Any, Callable +from typing import Any, Callable, Dict, Optional, Union from aiida.orm import AbstractCode, Computer, FolderData, List, SinglefileData, Str @@ -10,18 +10,19 @@ def prepare_pythonjob_inputs( - function: Callable[..., Any] | None = None, - function_inputs: dict[str, Any] | None = None, - function_outputs: dict[str, Any] | None = None, - code: AbstractCode | None = None, - command_info: dict[str, str] | None = None, - computer: str | Computer = "localhost", - metadata: dict[str, Any] | None = None, - upload_files: dict[str, str] = {}, - process_label: str | None = None, - pickled_function: PickledFunction | None = None, + function: Optional[Callable[..., Any]] = None, + function_inputs: Optional[Dict[str, Any]] = None, + function_outputs: Optional[Dict[str, Any]] = None, + code: Optional[AbstractCode] = None, + command_info: Optional[Dict[str, str]] = None, + computer: Union[str, Computer] = "localhost", + metadata: Optional[Dict[str, Any]] = None, + upload_files: Dict[str, str] = {}, + process_label: Optional[str] = None, + pickled_function: Optional[PickledFunction] = None, **kwargs: Any, -) -> dict[str, Any]: +) -> Dict[str, Any]: + pass """Prepare the inputs for PythonJob""" if function is None and pickled_function is None: