From f07b84e33b7a8c2329c2835de424cd1141ba4b24 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 00:16:47 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../src/vizro/actions/_action_loop/_action_loop_utils.py | 1 - .../actions/_callback_mapping/_callback_mapping_utils.py | 2 +- .../_callback_mapping/_get_action_callback_mapping.py | 2 -- vizro-core/src/vizro/managers/_model_manager.py | 8 ++++---- vizro-core/src/vizro/models/_action/_action.py | 1 - vizro-core/src/vizro/models/_controls/filter.py | 2 +- vizro-core/src/vizro/models/_page.py | 4 ++-- 7 files changed, 8 insertions(+), 12 deletions(-) diff --git a/vizro-core/src/vizro/actions/_action_loop/_action_loop_utils.py b/vizro-core/src/vizro/actions/_action_loop/_action_loop_utils.py index e5d0d9e4a..eefc22f6f 100644 --- a/vizro-core/src/vizro/actions/_action_loop/_action_loop_utils.py +++ b/vizro-core/src/vizro/actions/_action_loop/_action_loop_utils.py @@ -7,7 +7,6 @@ import dash from vizro.managers import model_manager -from vizro.managers._model_manager import ModelID if TYPE_CHECKING: from vizro.models import Action, Page diff --git a/vizro-core/src/vizro/actions/_callback_mapping/_callback_mapping_utils.py b/vizro-core/src/vizro/actions/_callback_mapping/_callback_mapping_utils.py index 79b241821..d38819825 100644 --- a/vizro-core/src/vizro/actions/_callback_mapping/_callback_mapping_utils.py +++ b/vizro-core/src/vizro/actions/_callback_mapping/_callback_mapping_utils.py @@ -7,7 +7,7 @@ from vizro.actions import _parameter, filter_interaction from vizro.managers import model_manager from vizro.managers._model_manager import ModelID -from vizro.models import Action, Page, Graph, AgGrid, Table, Figure, VizroBaseModel +from vizro.models import Action, AgGrid, Figure, Graph, Page, Table, VizroBaseModel from vizro.models._action._actions_chain import ActionsChain from vizro.models._controls import Filter, Parameter from vizro.models.types import ControlType diff --git a/vizro-core/src/vizro/actions/_callback_mapping/_get_action_callback_mapping.py b/vizro-core/src/vizro/actions/_callback_mapping/_get_action_callback_mapping.py index fb498c143..5b797835c 100644 --- a/vizro-core/src/vizro/actions/_callback_mapping/_get_action_callback_mapping.py +++ b/vizro-core/src/vizro/actions/_callback_mapping/_get_action_callback_mapping.py @@ -15,8 +15,6 @@ from vizro.actions._filter_action import _filter from vizro.actions._on_page_load_action import _on_page_load from vizro.actions._parameter_action import _parameter -from vizro.managers import model_manager -from vizro.managers._model_manager import ModelID from vizro.models import Action diff --git a/vizro-core/src/vizro/managers/_model_manager.py b/vizro-core/src/vizro/managers/_model_manager.py index ae8f37312..14e81df73 100644 --- a/vizro-core/src/vizro/managers/_model_manager.py +++ b/vizro-core/src/vizro/managers/_model_manager.py @@ -5,13 +5,12 @@ import random import uuid from collections.abc import Generator -from typing import TYPE_CHECKING, NewType, Optional, TypeVar, cast, Union +from typing import TYPE_CHECKING, NewType, Optional, TypeVar from vizro.managers._managers_utils import _state_modifier if TYPE_CHECKING: - from vizro.models import VizroBaseModel, Page - from vizro.models._action._actions_chain import ActionsChain + from vizro.models import Page, VizroBaseModel # As done for Dash components in dash.development.base_component, fixing the random seed is required to make sure that @@ -57,7 +56,8 @@ def __iter__(self) -> Generator[ModelID, None, None]: def _get_models(self, model_type: type[Model] = None, page: Optional[Model] = None) -> Generator[Model, None, None]: """Iterates through all models of type `model_type` (including subclasses). If `page_id` specified then only - give models from that page.""" + give models from that page. + """ models = self._get_model_children(page) if page is not None else self.__models.values() for model in models: diff --git a/vizro-core/src/vizro/models/_action/_action.py b/vizro-core/src/vizro/models/_action/_action.py index a872b88b3..0aef7303b 100644 --- a/vizro-core/src/vizro/models/_action/_action.py +++ b/vizro-core/src/vizro/models/_action/_action.py @@ -11,7 +11,6 @@ except ImportError: # pragma: no cov from pydantic import Field, validator -from vizro.managers._model_manager import ModelID from vizro.models import VizroBaseModel from vizro.models._models_utils import _log_call from vizro.models.types import CapturedCallable diff --git a/vizro-core/src/vizro/models/_controls/filter.py b/vizro-core/src/vizro/models/_controls/filter.py index 6fee21f53..949eb01e0 100644 --- a/vizro-core/src/vizro/models/_controls/filter.py +++ b/vizro-core/src/vizro/models/_controls/filter.py @@ -17,7 +17,7 @@ from vizro.actions import _filter from vizro.managers import data_manager, model_manager from vizro.managers._model_manager import ModelID -from vizro.models import Action, VizroBaseModel, Graph, AgGrid, Table, Figure +from vizro.models import Action, AgGrid, Figure, Graph, Table, VizroBaseModel from vizro.models._components.form import ( Checklist, DatePicker, diff --git a/vizro-core/src/vizro/models/_page.py b/vizro-core/src/vizro/models/_page.py index 23ca508c8..7d0dacdce 100644 --- a/vizro-core/src/vizro/models/_page.py +++ b/vizro-core/src/vizro/models/_page.py @@ -13,8 +13,8 @@ from vizro._constants import ON_PAGE_LOAD_ACTION_PREFIX from vizro.actions import _on_page_load from vizro.managers import model_manager -from vizro.managers._model_manager import DuplicateIDError, ModelID -from vizro.models import Action, Layout, VizroBaseModel, Graph, AgGrid, Table, Figure +from vizro.managers._model_manager import DuplicateIDError +from vizro.models import Action, AgGrid, Figure, Graph, Layout, Table, VizroBaseModel from vizro.models._action._actions_chain import ActionsChain, Trigger from vizro.models._layout import set_layout from vizro.models._models_utils import _log_call, check_captured_callable, validate_min_length