Skip to content

Commit

Permalink
type checking fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
glrs committed Oct 7, 2024
1 parent 22c67e3 commit 1b5cedf
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
10 changes: 6 additions & 4 deletions lib/module_utils/slurm_utils.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
from pathlib import Path
from typing import Dict
from typing import Dict, Union

from lib.core_utils.logging_utils import custom_logger

logging = custom_logger(__name__.split(".")[-1])


def generate_slurm_script(
args_dict: Dict[str, str], template_fpath: str, output_fpath: str
args_dict: Dict[str, str],
template_fpath: Union[str, Path],
output_fpath: Union[str, Path],
) -> bool:
"""Generate a Slurm batch script by filling in placeholders in a template.
Expand All @@ -17,8 +19,8 @@ def generate_slurm_script(
Args:
args_dict (Dict[str, str]): A dictionary of arguments and their values to be
inserted into the template.
template_fpath (str): The filepath to the Slurm script template.
output_fpath (str): The filepath where the generated Slurm script will be saved.
template_fpath (Union[str, Path]): The filepath to the Slurm script template.
output_fpath (Union[str, Path]): The filepath where the generated Slurm script will be saved.
Returns:
bool: True if the script is successfully written, False otherwise.
Expand Down
4 changes: 2 additions & 2 deletions lib/realms/tenx/lab_sample.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import glob
from pathlib import Path
from typing import Any, Dict, List, Optional
from typing import Any, Dict, List, Mapping, Optional

from lib.core_utils.config_loader import ConfigLoader
from lib.core_utils.logging_utils import custom_logger
Expand All @@ -11,7 +11,7 @@
class TenXLabSample:
"""Class representing a TenX lab sample."""

config: Dict[str, Any] = ConfigLoader().load_config("10x_config.json")
config: Mapping[str, Any] = ConfigLoader().load_config("10x_config.json")

def __init__(
self,
Expand Down
8 changes: 4 additions & 4 deletions lib/realms/tenx/run_sample.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import csv
from typing import Any, Dict, List, Optional
from typing import Any, Dict, List, Mapping, Optional

from lib.base.abstract_sample import AbstractSample
from lib.core_utils.logging_utils import custom_logger
Expand All @@ -21,7 +21,7 @@ def __init__(
sample_id: str,
lab_samples: List[Any],
project_info: Dict[str, Any],
config: Dict[str, Any],
config: Mapping[str, Any],
yggdrasil_db_manager: Any,
**kwargs: Any,
) -> None:
Expand All @@ -31,14 +31,14 @@ def __init__(
sample_id (str): The run sample ID.
lab_samples (List[Any]): A list of lab sample instances.
project_info (Dict[str, Any]): Project-specific information.
config (Dict[str, Any]): Configuration data.
config (Mapping[str, Any]): Configuration data.
yggdrasil_db_manager (Any): Yggdrasil database manager instance.
**kwargs (Any): Additional keyword arguments.
"""
self.run_sample_id: str = sample_id
self.lab_samples: List[Any] = lab_samples
self.project_info: Dict[str, Any] = project_info
self.config: Dict[str, Any] = config
self.config: Mapping[str, Any] = config
self.ydm: Any = yggdrasil_db_manager

# self.decision_table = TenXUtils.load_decision_table("10x_decision_table.json")
Expand Down
8 changes: 4 additions & 4 deletions lib/realms/tenx/tenx_project.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import asyncio
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
from typing import Any, Dict, List, Mapping, Optional, Tuple

from lib.base.abstract_project import AbstractProject
from lib.core_utils.config_loader import ConfigLoader
Expand All @@ -16,7 +16,7 @@ class TenXProject(AbstractProject):
Class representing a TenX project.
"""

config: Dict[str, Any] = ConfigLoader().load_config("10x_config.json")
config: Mapping[str, Any] = ConfigLoader().load_config("10x_config.json")

def __init__(self, doc: Dict[str, Any], yggdrasil_db_manager: Any) -> None:
"""
Expand Down Expand Up @@ -425,8 +425,8 @@ async def process(self):
)
self.finalize_project()

def create_slurm_job(self, data: Any) -> None:
pass
def create_slurm_job(self, data: Any) -> str:
return ""

def post_process(self, result: Any) -> None:
pass
Expand Down

0 comments on commit 1b5cedf

Please sign in to comment.