Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python 3.19 in the CI workflow #1

Merged
merged 2 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
timeout-minutes: 30
strategy:
matrix:
python-version: ['3.12']
python-version: ['3.9', '3.12']
aiida-version: ['stable']

services:
Expand Down
2 changes: 1 addition & 1 deletion src/aiida_pythonjob/data/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
25 changes: 13 additions & 12 deletions src/aiida_pythonjob/launch.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions src/aiida_pythonjob/utils.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from typing import Optional
from typing import Optional, Union

from aiida.common.exceptions import NotExistent
from aiida.orm import Computer, InstalledCode, load_code, load_computer


def get_or_create_code(
label: str = "python3",
computer: Optional[str | Computer] = "localhost",
computer: Optional[Union[str, "Computer"]] = "localhost",
filepath_executable: Optional[str] = None,
prepend_text: str = "",
):
) -> InstalledCode:
"""Try to load code, create if not exit."""

try:
Expand Down
Loading