From 4cbd28ff92ce075327532fc5853653297edb36a8 Mon Sep 17 00:00:00 2001 From: TheByronHimes Date: Wed, 29 May 2024 11:52:52 +0000 Subject: [PATCH] Remove pylint pragma statements --- src/metldata/artifacts_rest/load_resources.py | 2 +- .../builtin_transformations/add_accessions/__init__.py | 1 - src/metldata/builtin_transformations/add_accessions/main.py | 2 +- src/metldata/builtin_transformations/aggregate/__init__.py | 1 - src/metldata/builtin_transformations/aggregate/main.py | 2 +- .../builtin_transformations/aggregate/metadata_transform.py | 1 - .../builtin_transformations/custom_embeddings/__init__.py | 1 - .../builtin_transformations/custom_embeddings/config.py | 1 - .../builtin_transformations/custom_embeddings/main.py | 2 +- src/metldata/builtin_transformations/delete_slots/__init__.py | 1 - .../builtin_transformations/infer_references/__init__.py | 1 - src/metldata/builtin_transformations/infer_references/main.py | 2 +- src/metldata/builtin_transformations/merge_slots/__init__.py | 1 - src/metldata/builtin_transformations/normalize_model/main.py | 2 -- src/metldata/config.py | 4 ---- src/metldata/load/config.py | 2 +- src/metldata/load/load.py | 2 +- src/metldata/model_utils/essentials.py | 1 - src/metldata/submission_registry/config.py | 1 - src/metldata/transform/base.py | 2 -- src/metldata/transform/config.py | 1 - 21 files changed, 7 insertions(+), 26 deletions(-) diff --git a/src/metldata/artifacts_rest/load_resources.py b/src/metldata/artifacts_rest/load_resources.py index 3d0f6585..7476d04c 100644 --- a/src/metldata/artifacts_rest/load_resources.py +++ b/src/metldata/artifacts_rest/load_resources.py @@ -185,7 +185,7 @@ async def process_new_or_changed_resources( ) -async def process_resource_upsert( # pylint: disable=too-many-locals +async def process_resource_upsert( *, artifact_info_dict: dict[str, ArtifactInfo], artifact_name: str, diff --git a/src/metldata/builtin_transformations/add_accessions/__init__.py b/src/metldata/builtin_transformations/add_accessions/__init__.py index e8a80b5b..b53ba67d 100644 --- a/src/metldata/builtin_transformations/add_accessions/__init__.py +++ b/src/metldata/builtin_transformations/add_accessions/__init__.py @@ -17,7 +17,6 @@ """A transformation to add accessions to metadata.""" # shortcuts: -# pylint: disable=unused-import from metldata.builtin_transformations.add_accessions.main import ( # noqa: F401 ACCESSION_ADDITION_TRANSFORMATION, AccessionAdditionConfig, diff --git a/src/metldata/builtin_transformations/add_accessions/main.py b/src/metldata/builtin_transformations/add_accessions/main.py index f42606f5..8622613f 100644 --- a/src/metldata/builtin_transformations/add_accessions/main.py +++ b/src/metldata/builtin_transformations/add_accessions/main.py @@ -81,7 +81,7 @@ def transform(self, *, metadata: Json, annotation: SubmissionAnnotation) -> Json def check_model_assumptions( model: MetadataModel, - config: AccessionAdditionConfig, # pylint: disable=unused-argument + config: AccessionAdditionConfig, ) -> None: """Check the assumptions of the model. diff --git a/src/metldata/builtin_transformations/aggregate/__init__.py b/src/metldata/builtin_transformations/aggregate/__init__.py index 7c4d37c7..4da2eee0 100644 --- a/src/metldata/builtin_transformations/aggregate/__init__.py +++ b/src/metldata/builtin_transformations/aggregate/__init__.py @@ -17,7 +17,6 @@ """Aggregate transformation for metadata.""" # shortcuts: -# pylint: disable=unused-import from metldata.builtin_transformations.aggregate.config import ( # noqa: F401 AggregateConfig, ) diff --git a/src/metldata/builtin_transformations/aggregate/main.py b/src/metldata/builtin_transformations/aggregate/main.py index cbc2c253..1f1b144b 100644 --- a/src/metldata/builtin_transformations/aggregate/main.py +++ b/src/metldata/builtin_transformations/aggregate/main.py @@ -73,7 +73,7 @@ def transform(self, *, metadata: Json, annotation: SubmissionAnnotation) -> Json def check_model_assumptions( model: MetadataModel, - config: AggregateConfig, # pylint: disable=unused-argument + config: AggregateConfig, ) -> None: """Check the assumptions of the model. diff --git a/src/metldata/builtin_transformations/aggregate/metadata_transform.py b/src/metldata/builtin_transformations/aggregate/metadata_transform.py index dfbfe175..7b17b786 100644 --- a/src/metldata/builtin_transformations/aggregate/metadata_transform.py +++ b/src/metldata/builtin_transformations/aggregate/metadata_transform.py @@ -25,7 +25,6 @@ from metldata.model_utils.anchors import AnchorPoint -# pylint: disable=unused-argument def execute_aggregation( *, original_model: CachedMetadataModel, diff --git a/src/metldata/builtin_transformations/custom_embeddings/__init__.py b/src/metldata/builtin_transformations/custom_embeddings/__init__.py index ce6f9c73..a80145f7 100644 --- a/src/metldata/builtin_transformations/custom_embeddings/__init__.py +++ b/src/metldata/builtin_transformations/custom_embeddings/__init__.py @@ -17,7 +17,6 @@ """A transformation to generate custom embeddings for classes of a metadata model.""" # shortcuts: -# pylint: disable=unused-import from metldata.builtin_transformations.custom_embeddings.main import ( # noqa: F401 CUSTOM_EMBEDDING_TRANSFORMATION, CustomEmbeddingConfig, diff --git a/src/metldata/builtin_transformations/custom_embeddings/config.py b/src/metldata/builtin_transformations/custom_embeddings/config.py index 4bf18c5e..018b75c8 100644 --- a/src/metldata/builtin_transformations/custom_embeddings/config.py +++ b/src/metldata/builtin_transformations/custom_embeddings/config.py @@ -52,7 +52,6 @@ class CustomEmbeddingConfig(BaseSettings): ), ) - # pylint: disable=no-self-argument @field_validator("embedding_profiles") def check_embedding_profiles_unique( cls, # noqa: N805 diff --git a/src/metldata/builtin_transformations/custom_embeddings/main.py b/src/metldata/builtin_transformations/custom_embeddings/main.py index d53eecdc..9dc1e404 100644 --- a/src/metldata/builtin_transformations/custom_embeddings/main.py +++ b/src/metldata/builtin_transformations/custom_embeddings/main.py @@ -73,7 +73,7 @@ def transform(self, *, metadata: Json, annotation: SubmissionAnnotation) -> Json def check_model_assumptions( model: MetadataModel, - config: CustomEmbeddingConfig, # pylint: disable=unused-argument + config: CustomEmbeddingConfig, ) -> None: """Check the assumptions of the model. diff --git a/src/metldata/builtin_transformations/delete_slots/__init__.py b/src/metldata/builtin_transformations/delete_slots/__init__.py index 0ba7dddd..8ee398df 100644 --- a/src/metldata/builtin_transformations/delete_slots/__init__.py +++ b/src/metldata/builtin_transformations/delete_slots/__init__.py @@ -17,7 +17,6 @@ """A transformation that deletes slots from models and associated metadata.""" # shortcuts: -# pylint: disable=unused-import from metldata.builtin_transformations.delete_slots.main import ( # noqa: F401 SLOT_DELETION_TRANSFORMATION, SlotDeletionConfig, diff --git a/src/metldata/builtin_transformations/infer_references/__init__.py b/src/metldata/builtin_transformations/infer_references/__init__.py index 9752d6a6..ee769f94 100644 --- a/src/metldata/builtin_transformations/infer_references/__init__.py +++ b/src/metldata/builtin_transformations/infer_references/__init__.py @@ -17,7 +17,6 @@ """A transformation to infer references based on existing ones in the metadata model.""" # shortcuts: -# pylint: disable=unused-import from metldata.builtin_transformations.infer_references.main import ( # noqa: F401 REFERENCE_INFERENCE_TRANSFORMATION, ReferenceInferenceConfig, diff --git a/src/metldata/builtin_transformations/infer_references/main.py b/src/metldata/builtin_transformations/infer_references/main.py index e5233322..1ff340d2 100644 --- a/src/metldata/builtin_transformations/infer_references/main.py +++ b/src/metldata/builtin_transformations/infer_references/main.py @@ -74,7 +74,7 @@ def transform(self, *, metadata: Json, annotation: SubmissionAnnotation) -> Json def check_model_assumptions( model: MetadataModel, - config: ReferenceInferenceConfig, # pylint: disable=unused-argument + config: ReferenceInferenceConfig, ) -> None: """Check the assumptions of the model. diff --git a/src/metldata/builtin_transformations/merge_slots/__init__.py b/src/metldata/builtin_transformations/merge_slots/__init__.py index c644c723..d43f553d 100644 --- a/src/metldata/builtin_transformations/merge_slots/__init__.py +++ b/src/metldata/builtin_transformations/merge_slots/__init__.py @@ -17,7 +17,6 @@ """A transformation that merges multiple slots of a class into a single one.""" # shortcuts: -# pylint: disable=unused-import from metldata.builtin_transformations.merge_slots.main import ( # noqa: F401 SLOT_MERGING_TRANSFORMATION, SlotMergingConfig, diff --git a/src/metldata/builtin_transformations/normalize_model/main.py b/src/metldata/builtin_transformations/normalize_model/main.py index f11960af..a8b1e5e1 100644 --- a/src/metldata/builtin_transformations/normalize_model/main.py +++ b/src/metldata/builtin_transformations/normalize_model/main.py @@ -26,12 +26,10 @@ from metldata.transform.base import MetadataTransformer, TransformationDefinition -# pylint: disable=unused-argument def check_model_assumptions(model: MetadataModel, config: NormalizationConfig): """Check that the classes and slots specified in the config exist in the model.""" -# pylint: disable=unused-argument def transform_model(model: MetadataModel, config: NormalizationConfig) -> MetadataModel: """Normalize the model.""" return normalize_model(model) diff --git a/src/metldata/config.py b/src/metldata/config.py index 2f0c426b..70ac4451 100644 --- a/src/metldata/config.py +++ b/src/metldata/config.py @@ -17,16 +17,12 @@ from hexkit.config import config_from_yaml -# pylint: disable=unused-import from metldata.accession_registry.config import Config as AccessionRegistryConfig from metldata.artifacts_rest.config import ArtifactsRestConfig - -# pylint: disable=unused-import from metldata.load.config import ArtifactLoaderAPIConfig from metldata.submission_registry.config import Config as SubmissionRegistryConfig -# pylint: disable=too-many-ancestors @config_from_yaml(prefix="metl_sub") class SubmissionConfig(AccessionRegistryConfig, SubmissionRegistryConfig): """Config parameters and their defaults.""" diff --git a/src/metldata/load/config.py b/src/metldata/load/config.py index 1b812cb2..6fa1e539 100644 --- a/src/metldata/load/config.py +++ b/src/metldata/load/config.py @@ -27,7 +27,7 @@ from metldata.load.event_publisher import EventPubTranslatorConfig -class ArtifactLoaderAPIConfig( # pylint: disable=too-many-ancestors +class ArtifactLoaderAPIConfig( ArtifactsRestConfig, ApiConfigBase, EventPubTranslatorConfig, diff --git a/src/metldata/load/load.py b/src/metldata/load/load.py index 5a952465..34f4eec7 100644 --- a/src/metldata/load/load.py +++ b/src/metldata/load/load.py @@ -82,7 +82,7 @@ async def load_artifacts_using_dao( ) -async def _get_changed_resources( # pylint: disable=too-many-locals +async def _get_changed_resources( artifact_resources: ArtifactResourceDict, artifact_info_dict: dict[str, ArtifactInfo], dao_collection: ArtifactDaoCollection, diff --git a/src/metldata/model_utils/essentials.py b/src/metldata/model_utils/essentials.py index cfe9d489..16347b3d 100644 --- a/src/metldata/model_utils/essentials.py +++ b/src/metldata/model_utils/essentials.py @@ -73,7 +73,6 @@ def __eq__(self, other: object): return self.as_dict() == other.as_dict() - # pylint: disable=too-many-nested-blocks,too-many-branches def as_dict(self, essential: bool = True): # noqa: PLR0912, C901 """Get a dictionary representation of the model. If essential set to True, the dictionary will be cleaned of all fields that are not essential. diff --git a/src/metldata/submission_registry/config.py b/src/metldata/submission_registry/config.py index 0d887295..0ab9add3 100644 --- a/src/metldata/submission_registry/config.py +++ b/src/metldata/submission_registry/config.py @@ -20,7 +20,6 @@ from metldata.submission_registry.submission_store import SubmissionStoreConfig -# pylint: disable=too-many-ancestors class Config( SubmissionStoreConfig, SubmissionRegistryConfig, diff --git a/src/metldata/transform/base.py b/src/metldata/transform/base.py index b0a3be4c..b884311d 100644 --- a/src/metldata/transform/base.py +++ b/src/metldata/transform/base.py @@ -36,7 +36,6 @@ from metldata.event_handling.models import SubmissionAnnotation # shortcuts: -# pylint: disable=unused-import from metldata.model_utils.assumptions import MetadataModelAssumptionError # noqa: F401 from metldata.model_utils.essentials import MetadataModel @@ -162,7 +161,6 @@ class WorkflowDefinition(BaseModel): ), ) - # pylint: disable=no-self-argument @field_validator("steps", mode="after") def validate_step_references( cls, # noqa: N805 diff --git a/src/metldata/transform/config.py b/src/metldata/transform/config.py index 66002541..237b1e77 100644 --- a/src/metldata/transform/config.py +++ b/src/metldata/transform/config.py @@ -21,7 +21,6 @@ from metldata.transform.source_event_subscriber import SourceEventSubscriberConfig -# pylint: disable=too-many-ancestors class TransformationEventHandlingConfig( FileSystemEventConfig, ArtifactEventPublisherConfig, SourceEventSubscriberConfig ):