Created
February 12, 2026 14:58
-
-
Save mypy-play/801b8fc54f5d644053c6b4fb5834da5a to your computer and use it in GitHub Desktop.
Shared via mypy Playground
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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