diff --git a/.readthedocs.yml b/.readthedocs.yml index 3a40d135..e4770bad 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,12 +1,17 @@ version: 2 +build: + os: ubuntu-22.04 + tools: + python: "3.11" + sphinx: configuration: docs/source/conf.py python: - version: 3.8 install: - - method: pip - path: . - extra_requirements: - - docs + - method: pip + path: . + extra_requirements: + - docs + - ml diff --git a/docs/source/common-configuration-patterns.md b/docs/source/common-configuration-patterns.md index daabde09..9abd4eec 100644 --- a/docs/source/common-configuration-patterns.md +++ b/docs/source/common-configuration-patterns.md @@ -5,7 +5,7 @@ When you need to write a config for a pipeline, you can avoid rummaging through documentation by using the template command `eogrow-template`. Invoking `eogrow-template "eogrow.pipelines.zipmap.ZipMapPipeline" "zipmap.json"` creates a file with the content: -```json +``` { "pipeline": "eogrow.pipelines.zipmap.ZipMapPipeline", "pipeline_name": "<< Optional[str] >>", diff --git a/docs/source/conf.py b/docs/source/conf.py index 1fd33075..6dba1618 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -90,7 +90,7 @@ pygments_style = "sphinx" # Mock imports that won't and don't have to be installed in ReadTheDocs environment -autodoc_mock_imports = ["ray"] +autodoc_mock_imports = ["ray", "deepdiff"] # -- Options for HTML output ---------------------------------------------- diff --git a/eogrow/pipelines/training.py b/eogrow/pipelines/training.py index 72b9ba50..e6171018 100644 --- a/eogrow/pipelines/training.py +++ b/eogrow/pipelines/training.py @@ -248,6 +248,10 @@ def score_results(self, prepared_data: dict, model: Any) -> None: class RegressionTrainingPipeline(BaseTrainingPipeline): """A base pipeline for training an ML regressor. Uses LGBMRegressor by default.""" + class Schema(BaseTrainingPipeline.Schema): ... # needed for auto-docs + + config: Schema + def train_model(self, prepared_data: dict) -> object: train_features = prepared_data["features_train"] train_reference = prepared_data["reference_train"] diff --git a/eogrow/utils/validators.py b/eogrow/utils/validators.py index 55232961..e37e1c13 100644 --- a/eogrow/utils/validators.py +++ b/eogrow/utils/validators.py @@ -59,7 +59,7 @@ def optional_validator(value, values, config, field): # type: ignore[no-untyped def ensure_exactly_one_defined(first_param: str, second_param: str, **kwargs: Any) -> classmethod: """A validator (applied to `second_param` field) that makes sure only one of the two parameters is defined. - Make sure that the definition of `second_param` comes after `first_param˙ (in line-order). + Make sure that the definition of `second_param` comes after `first_param` (in line-order). """ def ensure_exclusion(cls: type, value: Any | None, values: RawSchemaDict) -> Any | None: @@ -79,7 +79,7 @@ def ensure_exclusion(cls: type, value: Any | None, values: RawSchemaDict) -> Any def ensure_defined_together(first_param: str, second_param: str, **kwargs: Any) -> classmethod: """A validator (applied to `second_param` field) that makes sure that the two parameters are both (un)defined. - Make sure that the definition of `second_param` comes after `first_param˙ (in line-order). + Make sure that the definition of `second_param` comes after `first_param` (in line-order). """ def ensure_both(cls: type, value: Any | None, values: RawSchemaDict) -> Any | None: