Skip to content

Instantly share code, notes, and snippets.

@mypy-play
Created February 12, 2026 14:58
Show Gist options
  • Select an option

  • Save mypy-play/801b8fc54f5d644053c6b4fb5834da5a to your computer and use it in GitHub Desktop.

Select an option

Save mypy-play/801b8fc54f5d644053c6b4fb5834da5a to your computer and use it in GitHub Desktop.
Shared via mypy Playground
from abc import ABC, abstractmethod
import typing as t
class nmBaseConfig:
...
class nmLSFConfig(nmBaseConfig):
...
nmConfigType = t.TypeVar('nmConfigType', bound=nmBaseConfig)
def make_lsf_bsub_opts(compute_config: nmLSFConfig, task_name: str):
...
class SubmitterBase(ABC, t.Generic[nmConfigType]):
@abstractmethod
def submit(
self,
scenario_file: str,
pynova_app_command: list[str],
compute_config: nmConfigType,
task_name: str,
) -> int:
raise NotImplementedError()
class LFSSubmitter(SubmitterBase[nmLSFConfig]):
def submit(
self,
scenario_file: str,
pynova_app_command: list[str],
compute_config: nmLSFConfig,
task_name: str,
) -> int:
make_lsf_bsub_opts(compute_config, task_name)
return 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment