Skip to content

Commit

Permalink
reduce issues in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zigaLuksic committed Oct 10, 2023
1 parent cf17089 commit 61899f3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
15 changes: 10 additions & 5 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion docs/source/common-configuration-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -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] >>",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ----------------------------------------------

Expand Down
4 changes: 4 additions & 0 deletions eogrow/pipelines/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
4 changes: 2 additions & 2 deletions eogrow/utils/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 61899f3

Please sign in to comment.