chap_core.external package

Submodules

chap_core.external.external_model module

class chap_core.external.external_model.SimpleFileContextManager(filename, mode='r')[source]

Bases: object

read()[source]
write(data)[source]

chap_core.external.github module

class chap_core.external.github.GithubUrl(owner: str, repo_name: str, commit: str)[source]

Bases: object

commit: str
owner: str
repo_name: str
chap_core.external.github.fetch_mlproject_content(github_url: str) str[source]
chap_core.external.github.parse_github_url(github_url) GithubUrl[source]

chap_core.external.mlflow_wrappers module

chap_core.external.model_configuration module

class chap_core.external.model_configuration.CommandConfig(*, command: str, parameters: dict[str, str] | None = None)[source]

Bases: BaseModel

command: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

parameters: dict[str, str] | None
class chap_core.external.model_configuration.DockerEnvConfig(*, image: str)[source]

Bases: BaseModel

image: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class chap_core.external.model_configuration.EntryPointConfig(*, train: CommandConfig, predict: CommandConfig)[source]

Bases: BaseModel

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

predict: CommandConfig
train: CommandConfig
class chap_core.external.model_configuration.ModelTemplateConfigCommon(*, supported_period_type: ~chap_core.model_spec.PeriodType = PeriodType.any, user_options: dict | None = <factory>, hpo_search_space: dict | None = None, required_covariates: ~typing.List[str] = <factory>, target: str = 'disease_cases', allow_free_additional_continuous_covariates: bool = False, meta_data: ~chap_core.database.model_templates_and_config_tables.ModelTemplateMetaData = ModelTemplateMetaData(display_name='No Display Name yet', description='No Description yet', author_note='No Author note yet', author_assessed_status=<AuthorAssessedStatus.red: 'red'>, author='Unknown Author', organization=None, organization_logo_url=None, contact_email=None, citation_info=None))[source]

Bases: ModelTemplateInformation

meta_data: ModelTemplateMetaData
model_config: ClassVar[ConfigDict] = {'from_attributes': True, 'registry': PydanticUndefined}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class chap_core.external.model_configuration.ModelTemplateConfigV2(*, entry_points: ~chap_core.external.model_configuration.EntryPointConfig | None = None, docker_env: ~chap_core.external.model_configuration.DockerEnvConfig | None = None, python_env: str | None = None, supported_period_type: ~chap_core.model_spec.PeriodType = PeriodType.any, user_options: dict | None = <factory>, hpo_search_space: dict | None = None, required_covariates: ~typing.List[str] = <factory>, target: str = 'disease_cases', allow_free_additional_continuous_covariates: bool = False, meta_data: ~chap_core.database.model_templates_and_config_tables.ModelTemplateMetaData = ModelTemplateMetaData(display_name='No Display Name yet', description='No Description yet', author_note='No Author note yet', author_assessed_status=<AuthorAssessedStatus.red: 'red'>, author='Unknown Author', organization=None, organization_logo_url=None, contact_email=None, citation_info=None), name: str, source_url: str | None = None, adapters: dict[str, str] | None = None, rest_api_url: str | None = None, version: str | None = None)[source]

Bases: ModelTemplateConfigCommon, RunnerConfig

This is used to parse MLProject files

adapters: dict[str, str] | None
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'from_attributes': True, 'registry': PydanticUndefined}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str
rest_api_url: str | None
source_url: str | None
version: str | None
class chap_core.external.model_configuration.RunnerConfig(*, entry_points: EntryPointConfig | None = None, docker_env: DockerEnvConfig | None = None, python_env: str | None = None)[source]

Bases: BaseModel

This is all needed to actually run model

docker_env: DockerEnvConfig | None
entry_points: EntryPointConfig | None
model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

python_env: str | None

chap_core.external.python_model module

chap_core.external.r_description module

chap_core.external.r_description.get_imports(file_path)[source]
chap_core.external.r_description.parse_description_file(file_path)[source]

chap_core.external.r_model module

chap_core.external.r_models module

chap_core.external.uv_wrapper module

chap_core.external.uv_wrapper.create_virtual_environment_from_txt(txt_file_name)[source]

Module contents