Skip to content

Commit

Permalink
clean up configuration.py
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebachmeier committed Jan 7, 2025
1 parent 1b03395 commit 83cc005
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/easylink/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@
class Config(LayeredConfigTree):
"""A container for configuration information.
A ``Config`` (which inherits from :class:`~layered_config_tree.LayeredConfigTree`)
is a container that includes the combination of the user-provided pipeline,
input data, and computing environment specifications. It is a nested
A ``Config`` is a container that includes the combination of the user-provided
pipeline, input data, and computing environment specifications. It is a nested
dictionary-like object that supports prioritized layers of configuration settings
as well as dot-notation access to its attributes.
Expand Down Expand Up @@ -88,9 +87,9 @@ class Config(LayeredConfigTree):
Notes
-----
The requested pipeline is checked against a set of supported
:class:`pipeline schemas <easylink.pipeline_schema.PipelineSchema>`. The first
schema that successfully validates is assumed to be the correct one and is attached
to the ``Config`` object and its :meth:`~easylink.pipeline_schema.PipelineSchema.configure_pipeline`
``PipelineSchemas``. The first schema that successfully validates is assumed
to be the correct one and is attached to the ``Config`` object and its
:meth:`~easylink.pipeline_schema.PipelineSchema.configure_pipeline`
method is called.
"""

Expand Down Expand Up @@ -174,12 +173,12 @@ def spark_resources(self) -> dict[str, Any]:
#################

def _get_schema(self, potential_schemas: list[PipelineSchema]) -> PipelineSchema:
"""Returns the first pipeline schema that successfully validates the requested pipeline.
"""Returns the first ``PipelineSchema`` that successfully validates the requested pipeline.
Parameters
----------
potential_schemas
Pipeline schemas to validate the pipeline configuration against.
``PipelineSchemas`` to validate the pipeline configuration against.
Returns
-------
Expand All @@ -190,10 +189,10 @@ def _get_schema(self, potential_schemas: list[PipelineSchema]) -> PipelineSchema
Notes
-----
This acts as the pipeline configuration file's validation method since
we can only find a matching schema if that file is valid.
we can only find a matching ``PipelineSchema`` if that file is valid.
This method returns the first schema that successfully validates and does
not attempt to validate additional ones.
This method returns the first ``PipelineSchema`` that successfully validates
and does not attempt to validate additional ones.
"""
errors = defaultdict(dict)
# Try each schema until one is validated
Expand Down Expand Up @@ -278,7 +277,7 @@ def load_params_from_specification(
This gathers the pipeline, input data, and computing environment specifications
as well as the results directory into a single dictionary for insertion into
the ``Config`` object.
the :class:`Config` object.
Parameters
----------
Expand Down

0 comments on commit 83cc005

Please sign in to comment.