diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8acb3f66..01969a23 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,7 +34,7 @@ jobs: python${{ matrix.python-version }} -m pip install -r requirements/ubuntu-latest_py${{ matrix.python-version }}_extras.txt python${{ matrix.python-version }} -m pip install --upgrade pip python${{ matrix.python-version }} -m pip install --no-deps .[server] - + - name: Build package run: python${{ matrix.python-version }} -m build diff --git a/crystal_toolkit/apps/examples/tests/typing.py b/crystal_toolkit/apps/examples/tests/typing.py index db8c0611..3baab361 100644 --- a/crystal_toolkit/apps/examples/tests/typing.py +++ b/crystal_toolkit/apps/examples/tests/typing.py @@ -16,42 +16,33 @@ class DashDuo(Protocol): # driver = ... # selenium.webdriver.remote.WebDriver - def start_server(self, start_server) -> None: - ... + def start_server(self, start_server) -> None: ... - def find_element(self, selector: str) -> dash.development.base_component.Component: - ... + def find_element( + self, selector: str + ) -> dash.development.base_component.Component: ... def wait_for_text_to_equal( self, selector: str, text: str, timeout: int | None = None - ) -> None: - ... + ) -> None: ... - def get_logs(self) -> list[str]: - ... + def get_logs(self) -> list[str]: ... - def clear_storage(self) -> None: - ... + def clear_storage(self) -> None: ... - def percy_snapshot(self, name: str, wait_for_callbacks: bool = False) -> None: - ... + def percy_snapshot(self, name: str, wait_for_callbacks: bool = False) -> None: ... - def multiple_click(self, selector: str, clicks: int) -> None: - ... + def multiple_click(self, selector: str, clicks: int) -> None: ... - def wait_for_element(self, selector: str, timeout: int | None = None) -> None: - ... + def wait_for_element(self, selector: str, timeout: int | None = None) -> None: ... - def take_snapshot(self, name: str) -> None: - ... + def take_snapshot(self, name: str) -> None: ... - def wait_for_page(self, url: str | None = None, timeout: int = 10) -> None: - ... + def wait_for_page(self, url: str | None = None, timeout: int = 10) -> None: ... def find_elements( self, selector: str - ) -> list[dash.development.base_component.Component]: - ... + ) -> list[dash.development.base_component.Component]: ... def select_dcc_dropdown( self, diff --git a/crystal_toolkit/components/bandstructure.py b/crystal_toolkit/components/bandstructure.py index 7580f6e3..7aedf662 100644 --- a/crystal_toolkit/components/bandstructure.py +++ b/crystal_toolkit/components/bandstructure.py @@ -523,7 +523,6 @@ def get_dos_traces( raise PreventUpdate # Projected DOS - count = 0 colors = [ "#d62728", # brick red "#2ca02c", # cooked asparagus green @@ -534,7 +533,7 @@ def get_dos_traces( "#e377c2", # raspberry yogurt pink ] - for label in proj_data: + for count, label in enumerate(proj_data): if spin_polarized: trace = { dos_axis: -1.0 @@ -565,8 +564,6 @@ def get_dos_traces( dos_traces.append(trace) - count += 1 - return dos_traces @staticmethod diff --git a/crystal_toolkit/components/phonon.py b/crystal_toolkit/components/phonon.py index 38e75878..d3de53a3 100644 --- a/crystal_toolkit/components/phonon.py +++ b/crystal_toolkit/components/phonon.py @@ -174,7 +174,7 @@ def layout(self) -> html.Div: @staticmethod def _get_ph_bs_dos( - data: dict[str, Any] | None + data: dict[str, Any] | None, ) -> tuple[PhononBandStructureSymmLine, CompletePhononDos]: data = data or {} @@ -399,7 +399,6 @@ def get_ph_dos_traces(dos: CompletePhononDos, freq_range: tuple[float, float]): dos_traces.append(trace_tdos) # Projected DOS - count = 0 colors = [ "#d62728", # brick red "#2ca02c", # cooked asparagus green @@ -411,7 +410,7 @@ def get_ph_dos_traces(dos: CompletePhononDos, freq_range: tuple[float, float]): ] ele_dos = dos.get_element_dos() # project DOS onto elements - for label in ele_dos: + for count, label in enumerate(ele_dos): spin_up_label = str(label) trace = { @@ -426,8 +425,6 @@ def get_ph_dos_traces(dos: CompletePhononDos, freq_range: tuple[float, float]): dos_traces.append(trace) - count += 1 - return dos_traces @staticmethod diff --git a/crystal_toolkit/core/jupyter.py b/crystal_toolkit/core/jupyter.py index 88a6bd17..f799a7a9 100644 --- a/crystal_toolkit/core/jupyter.py +++ b/crystal_toolkit/core/jupyter.py @@ -31,12 +31,10 @@ class _JupyterRenderer: @staticmethod def _find_available_port(): - """ - Find an available port. + """Find an available port. Thank you Mihai Capotă, https://stackoverflow.com/a/61685162 """ - import socketserver with socketserver.TCPServer(("localhost", 0), None) as s: @@ -46,10 +44,7 @@ def _find_available_port(): # check docs about proxy settings def run(self, layout): - """ - Run Dash app. - """ - + """Run Dash app.""" app = Dash(plugins=[CrystalToolkitPlugin(layout=layout)]) port = SETTINGS.JUPYTER_EMBED_PORT or self._find_available_port() @@ -63,10 +58,7 @@ def run(self, layout): app.run(port=free_port, jupyter_mode=SETTINGS.JUPYTER_EMBED_MODE) def display(self, obj): - """ - Display a provided object. - """ - + """Display a provided object.""" for kls, component in self.registry.items(): if isinstance(obj, kls): layout = ctl.Block( @@ -79,25 +71,19 @@ def display(self, obj): def _to_plotly_json(self): - """ - Patch to ensure MSONable objects can be serialized into JSON by plotly tools. - """ + """Patch to ensure MSONable objects can be serialized into JSON by plotly tools.""" return self.as_dict() def _display_json(self, **kwargs): - """ - Display JSON representation of an MSONable object inside Jupyter. - """ + """Display JSON representation of an MSONable object inside Jupyter.""" from IPython.display import JSON JSON(self.as_dict(), **kwargs) def _repr_mimebundle_(self, include=None, exclude=None): - """ - Method used by Jupyter. A default for MSONable objects to return JSON representation. - """ + """Method used by Jupyter. A default for MSONable objects to return JSON representation.""" return { "application/json": self.as_dict(), "text/plain": repr(self), @@ -105,9 +91,7 @@ def _repr_mimebundle_(self, include=None, exclude=None): def _ipython_display_(self): - """ - Display MSONable objects using a Crystal Toolkit component, if available. - """ + """Display MSONable objects using a Crystal Toolkit component, if available.""" from IPython.display import publish_display_data if any(isinstance(self, x) for x in _JupyterRenderer.registry): @@ -140,11 +124,9 @@ def _ipython_display_(self): def patch_msonable(): - """ - Patch MSONable to allow MSONable objects to render in Jupyter + """Patch MSONable to allow MSONable objects to render in Jupyter environments using Crystal Toolkit components. """ - from monty.json import MSONable MSONable.to_plotly_json = _to_plotly_json diff --git a/crystal_toolkit/core/mpcomponent.py b/crystal_toolkit/core/mpcomponent.py index 34351cf3..80878543 100644 --- a/crystal_toolkit/core/mpcomponent.py +++ b/crystal_toolkit/core/mpcomponent.py @@ -32,7 +32,7 @@ CT_NAMESPACE = "CT" -class MPComponent(ABC): +class MPComponent(ABC): # noqa: B024 """The abstract base class for an MPComponent. MPComponent is designed to help render an MSONable object. diff --git a/crystal_toolkit/core/plugin.py b/crystal_toolkit/core/plugin.py index fb4722ef..6b8fdae9 100644 --- a/crystal_toolkit/core/plugin.py +++ b/crystal_toolkit/core/plugin.py @@ -11,8 +11,7 @@ class CrystalToolkitPlugin: - """ - Enables Crystal Toolkit components to work with your Dash app. + """Enables Crystal Toolkit components to work with your Dash app. This is a replacement for the previous `register_crystal_toolkit` function, to instead use Dash's native plugin system. @@ -27,8 +26,7 @@ class CrystalToolkitPlugin: def __init__( self, layout, cache: Cache | None = None, use_default_css=True ) -> None: - """ - Provide your initial app layout. + """Provide your initial app layout. Provide a cache to improve performance. If running in debug mode, the cache will be automatically disabled. If @@ -51,9 +49,7 @@ def __init__( self.use_default_css = use_default_css def plug(self, app: Dash): - """ - Initialize Crystal Toolkit plugin for the specified Dash app. - """ + """Initialize Crystal Toolkit plugin for the specified Dash app.""" self.app = app self.cache.init_app(app.server) @@ -83,15 +79,13 @@ def plug(self, app: Dash): app.config.external_stylesheets.append(font_awesome_css) def crystal_toolkit_layout(self, layout) -> html.Div: - """ - Crystal Toolkit currently requires a set of dcc.Store components + """Crystal Toolkit currently requires a set of dcc.Store components to be added to the layout in order to function. Eventually, it is hoped to remove the need for this method through use of All-in-One components. All-in-One components were not yet available when Crystal Toolkit was first developed. """ - from crystal_toolkit.core.mpcomponent import MPComponent # Crystal Toolkit has not been tested with dynamic layouts diff --git a/crystal_toolkit/defaults.py b/crystal_toolkit/defaults.py index 94c09f88..1c9fa01d 100644 --- a/crystal_toolkit/defaults.py +++ b/crystal_toolkit/defaults.py @@ -1,4 +1,5 @@ """Populate the default values from the JSON file.""" + from __future__ import annotations import json diff --git a/crystal_toolkit/helpers/asymptote_renderer.py b/crystal_toolkit/helpers/asymptote_renderer.py index a52a89e8..19908b80 100644 --- a/crystal_toolkit/helpers/asymptote_renderer.py +++ b/crystal_toolkit/helpers/asymptote_renderer.py @@ -5,6 +5,7 @@ TODO The code should also append a set of special points at the end in case the user wants to add more "hand drawn" features to the plot. """ + from __future__ import annotations import logging diff --git a/crystal_toolkit/helpers/layouts.py b/crystal_toolkit/helpers/layouts.py index ffea4e7d..c9d7058b 100644 --- a/crystal_toolkit/helpers/layouts.py +++ b/crystal_toolkit/helpers/layouts.py @@ -1,5 +1,4 @@ -""" -Helper methods to make working with Bulma classes easier. This file incorporates +"""Helper methods to make working with Bulma classes easier. This file incorporates language from the Bulma documentation. See https://github.com/jgthms/bulma/blob/master/LICENSE """ @@ -64,8 +63,7 @@ def __init__( grouped_multiline: bool = False, **kwargs, ) -> None: - """ - When combining several controls in a form, use the field class as a container, to keep the spacing consistent. + """When combining several controls in a form, use the field class as a container, to keep the spacing consistent. See https://bulma.io/documentation/form/general/ """ @@ -84,8 +82,7 @@ def __init__( class Control(html.Div): def __init__(self, *args, **kwargs) -> None: - """ - To maintain an evenly balanced design, Bulma provides a very useful control container with which you can wrap the form controls. + """To maintain an evenly balanced design, Bulma provides a very useful control container with which you can wrap the form controls. See https://bulma.io/documentation/form/general/ """ @@ -103,12 +100,10 @@ def __init__( rounded: bool = False, **kwargs, ) -> None: - """ - A dcc.Input with Bulma styles attached. + """A dcc.Input with Bulma styles attached. See https://bulma.io/documentation/form/input/ """ - _update_css_class(kwargs, "input") _update_css_class(kwargs, f"is-{color}", color) _update_css_class(kwargs, f"is-{size}", size) @@ -126,8 +121,7 @@ def __init__( fixed_size: bool = False, **kwargs, ) -> None: - """ - A dcc.Textarea with Bulma styles attached. + """A dcc.Textarea with Bulma styles attached. See https://bulma.io/documentation/form/textarea/ """ @@ -170,8 +164,7 @@ def __init__( placeholder: str | None = None, **kwargs, ) -> None: - """ - Returns a dcc.Upload with Bulma styling. + """Returns a dcc.Upload with Bulma styling. See https://bulma.io/documentation/form/file/ """ @@ -218,8 +211,7 @@ def __init__(self, *args, **kwargs) -> None: class Block(html.Div): - """ - The block element is a simple spacer tool. It allows sibling HTML elements to have a consistent margin between them. + """The block element is a simple spacer tool. It allows sibling HTML elements to have a consistent margin between them. See https://bulma.io/documentation/elements/block/ """ @@ -231,8 +223,7 @@ def __init__(self, *args, **kwargs) -> None: class Box(html.Div): def __init__(self, *args, **kwargs) -> None: - """ - The box element is a simple container with a white background, some padding, and a box shadow. + """The box element is a simple container with a white background, some padding, and a box shadow. See https://bulma.io/documentation/elements/box/ """ @@ -256,8 +247,7 @@ def __init__( disabled: bool = False, **kwargs, ) -> None: - """ - The button is an essential element of any design. It's meant to look and behave as an interactive element of your page. + """The button is an essential element of any design. It's meant to look and behave as an interactive element of your page. See https://bulma.io/documentation/elements/button/ """ @@ -277,8 +267,7 @@ def __init__( class Content(html.Div): def __init__(self, *args, **kwargs) -> None: - """ - A single class to handle WYSIWYG generated content, where only HTML tags are available. + """A single class to handle WYSIWYG generated content, where only HTML tags are available. It is useful to use Content around a Markdown component. @@ -295,8 +284,7 @@ def __init__( size: Literal["small", "normal", "medium", "large"] | None, **kwargs, ) -> None: - """ - A versatile delete cross. + """A versatile delete cross. See https://bulma.io/documentation/elements/delete/ """ @@ -413,8 +401,7 @@ def __init__( light: bool = False, **kwargs, ) -> None: - """ - The notification is a simple colored block meant to draw the attention to the user about something. + """The notification is a simple colored block meant to draw the attention to the user about something. See https://bulma.io/documentation/elements/notification/ """ @@ -426,9 +413,7 @@ def __init__( class Error(Notification): def __init__(self, *args, **kwargs) -> None: - """ - A Notification for errors. - """ + """A Notification for errors.""" super().__init__(*args, color="danger", **kwargs) @@ -443,8 +428,7 @@ def __init__( max: int | None = None, **kwargs, ) -> None: - """ - Native HTML progress bars. + """Native HTML progress bars. See https://bulma.io/documentation/elements/progress/ """ @@ -471,8 +455,7 @@ def __init__( fullwidth: bool = False, **kwargs, ) -> None: - """ - A simple Table element. + """A simple Table element. See https://bulma.io/documentation/elements/table/ @@ -497,9 +480,7 @@ def __init__( super().__init__(*args, **kwargs) def with_container(self, **kwargs) -> html.Div: - """ - Add a container to make the Table scrollable. - """ + """Add a container to make the Table scrollable.""" _update_css_class(kwargs, "table-container") return html.Div(children=[self], **kwargs) @@ -517,8 +498,7 @@ def __init__( span_kwargs: dict | None = None, **kwargs, ) -> None: - """ - A tag element. + """A tag element. See https://bulma.io/documentation/elements/tag/ @@ -561,8 +541,7 @@ class TagContainer(Field): def __init__( self, tags: list[Tag], grouped=True, grouped_multiline=True, **kwargs ) -> None: - """ - Contain a list of tags and keep them evenly spaced. + """Contain a list of tags and keep them evenly spaced. See https://bulma.io/documentation/elements/tag/ """ @@ -582,8 +561,7 @@ class H1(html.H1): def __init__( self, *args, subtitle: bool = False, spaced: bool = False, **kwargs ) -> None: - """ - H1 heading. + """H1 heading. See https://bulma.io/documentation/elements/title/ """ @@ -599,8 +577,7 @@ class H2(html.H2): def __init__( self, *args, subtitle: bool = False, spaced: bool = False, **kwargs ) -> None: - """ - H2 heading. + """H2 heading. See https://bulma.io/documentation/elements/title/ """ @@ -616,8 +593,7 @@ class H3(html.H3): def __init__( self, *args, subtitle: bool = False, spaced: bool = False, **kwargs ) -> None: - """ - H3 heading. + """H3 heading. See https://bulma.io/documentation/elements/title/ """ @@ -633,8 +609,7 @@ class H4(html.H4): def __init__( self, *args, subtitle: bool = False, spaced: bool = False, **kwargs ) -> None: - """ - H4 heading. + """H4 heading. See https://bulma.io/documentation/elements/title/ """ @@ -650,8 +625,7 @@ class H5(html.H5): def __init__( self, *args, subtitle: bool = False, spaced: bool = False, **kwargs ) -> None: - """ - H5 heading. + """H5 heading. See https://bulma.io/documentation/elements/title/ """ @@ -667,8 +641,7 @@ class H6(html.H6): def __init__( self, *args, subtitle: bool = False, spaced: bool = False, **kwargs ) -> None: - """ - H6 heading. + """H6 heading. See https://bulma.io/documentation/elements/title/ """ @@ -693,8 +666,7 @@ def __init__( size: Literal["small", "medium", "large"] | None = None, **kwargs, ) -> None: - """ - Breadcrumb navigation. Supply a list of tuples of display + """Breadcrumb navigation. Supply a list of tuples of display name (string or any Component) and link (string) to construct the breadcrumb navigation. See https://bulma.io/documentation/components/breadcrumb/ @@ -722,8 +694,7 @@ def __init__( class Card(html.Div): def __init__(self, *args, **kwargs) -> None: - """ - Card container. + """Card container. See https://bulma.io/documentation/components/card/ """ @@ -733,8 +704,7 @@ def __init__(self, *args, **kwargs) -> None: class CardHeader(html.Header): def __init__(self, *args, **kwargs) -> None: - """ - Card header. + """Card header. See https://bulma.io/documentation/components/card/ """ @@ -744,8 +714,7 @@ def __init__(self, *args, **kwargs) -> None: class CardImage(html.Div): def __init__(self, *args, **kwargs) -> None: - """ - Card image. Provide a ctl.Image() as child. + """Card image. Provide a ctl.Image() as child. See https://bulma.io/documentation/components/card/ """ @@ -755,8 +724,7 @@ def __init__(self, *args, **kwargs) -> None: class CardContent(html.Div): def __init__(self, *args, **kwargs) -> None: - """ - Card content. + """Card content. See https://bulma.io/documentation/components/card/ """ @@ -766,8 +734,7 @@ def __init__(self, *args, **kwargs) -> None: class CardFooter(html.Footer): def __init__(self, *args, **kwargs) -> None: - """ - Card footer. Provide a list of ctl.CardFooterItem() as children. + """Card footer. Provide a list of ctl.CardFooterItem() as children. See https://bulma.io/documentation/components/card/ """ @@ -777,8 +744,7 @@ def __init__(self, *args, **kwargs) -> None: class CardFooterItem(html.A): def __init__(self, *args, **kwargs) -> None: - """ - Card footer item. + """Card footer item. See https://bulma.io/documentation/components/card/ """ @@ -857,8 +823,7 @@ def __init__(self, *args, **kwargs) -> None: class Pagination(html.Nav): def __init__(self, *args, **kwargs) -> None: - """ - Pagination container. + """Pagination container. See https://bulma.io/documentation/components/pagination/ """ @@ -868,8 +833,7 @@ def __init__(self, *args, **kwargs) -> None: class PaginationPrevious(html.A): def __init__(self, *args, **kwargs) -> None: - """ - Pagination previous button. + """Pagination previous button. See https://bulma.io/documentation/components/pagination/ """ @@ -879,8 +843,7 @@ def __init__(self, *args, **kwargs) -> None: class PaginationNext(html.A): def __init__(self, *args, **kwargs) -> None: - """ - Pagination next button. + """Pagination next button. See https://bulma.io/documentation/components/pagination/ """ @@ -890,8 +853,7 @@ def __init__(self, *args, **kwargs) -> None: class PaginationList(html.Ul): def __init__(self, *args, **kwargs) -> None: - """ - Pagination list container. Provide list of ctl.PaginationLink as children. + """Pagination list container. Provide list of ctl.PaginationLink as children. See https://bulma.io/documentation/components/pagination/ """ @@ -901,8 +863,7 @@ def __init__(self, *args, **kwargs) -> None: class PaginationLink(html.Li): def __init__(self, *args, current: bool, **kwargs) -> None: - """ - Pagination link. Keyword arguments passed to html.A element. + """Pagination link. Keyword arguments passed to html.A element. See https://bulma.io/documentation/components/pagination/ """ @@ -913,8 +874,7 @@ def __init__(self, *args, current: bool, **kwargs) -> None: class PaginationEllipsis(html.Li): def __init__(self, **kwargs) -> None: - """ - Pagination link. Keyword arguments passed to html.Span element. + """Pagination link. Keyword arguments passed to html.Span element. See https://bulma.io/documentation/components/pagination/ """ @@ -969,8 +929,7 @@ def __init__( mobile: bool = False, **kwargs, ) -> None: - """ - A multi-purpose horizontal level, which can contain almost any other element. + """A multi-purpose horizontal level, which can contain almost any other element. Use either ctl.LevelLeft, ctl.LevelRight or ctl.LevelItem as children. @@ -987,8 +946,7 @@ def __init__( *args, **kwargs, ) -> None: - """ - Use with ctl.Level. + """Use with ctl.Level. See https://bulma.io/documentation/layout/level/ """ @@ -1002,8 +960,7 @@ def __init__( *args, **kwargs, ) -> None: - """ - Use with ctl.Level. + """Use with ctl.Level. See https://bulma.io/documentation/layout/level/ """ @@ -1018,8 +975,7 @@ def __init__( centered: bool = False, **kwargs, ) -> None: - """ - Use with ctl.Level. + """Use with ctl.Level. See https://bulma.io/documentation/layout/level/ """ @@ -1043,8 +999,7 @@ def __init__( | None = None, **kwargs, ) -> None: - """ - Hero element. Provide a ctl.HeroBody() as child and, if using "fullheight", a + """Hero element. Provide a ctl.HeroBody() as child and, if using "fullheight", a ctl.HeroHead() and ctl.HeroFoot(). See https://bulma.io/documentation/layout/hero/ @@ -1057,8 +1012,7 @@ def __init__( class HeroBody(html.Div): def __init__(self, *args, **kwargs) -> None: - """ - Use with ctl.Hero. + """Use with ctl.Hero. See https://bulma.io/documentation/layout/hero/ """ @@ -1068,8 +1022,7 @@ def __init__(self, *args, **kwargs) -> None: class HeroHead(html.Div): def __init__(self, *args, **kwargs) -> None: - """ - Use with "fullheight" ctl.Hero. + """Use with "fullheight" ctl.Hero. See https://bulma.io/documentation/layout/hero/ """ @@ -1079,8 +1032,7 @@ def __init__(self, *args, **kwargs) -> None: class HeroFoot(html.Div): def __init__(self, *args, **kwargs) -> None: - """ - Use with "fullheight" ctl.Hero. + """Use with "fullheight" ctl.Hero. See https://bulma.io/documentation/layout/hero/ """ @@ -1092,8 +1044,7 @@ class Section(html.Section): def __init__( self, *args, size: Literal["medium", "large"] | None = None, **kwargs ) -> None: - """ - Section. + """Section. See https://bulma.io/documentation/layout/section/ """ @@ -1104,8 +1055,7 @@ def __init__( class Footer(html.Footer): def __init__(self, *args, **kwargs) -> None: - """ - Footer. + """Footer. See https://bulma.io/documentation/layout/footer/ """ @@ -1122,8 +1072,7 @@ def __init__( size: Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] | None, **kwargs, ) -> None: - """ - A single tile element to build 2-dimensional grids. + """A single tile element to build 2-dimensional grids. See https://bulma.io/documentation/layout/tiles/ """ @@ -1256,8 +1205,7 @@ def cite_me( class Loading(dcc.Loading): def __init__(self, *args, **kwargs) -> None: - """ - A wrapper around dcc.Loading that uses PRIMARY_COLOR and DEBUG_MODE from + """A wrapper around dcc.Loading that uses PRIMARY_COLOR and DEBUG_MODE from Crystal Toolkit settings. """ if "type" not in kwargs: @@ -1281,8 +1229,7 @@ def __init__(self, *args, **kwargs) -> None: def get_table(rows: list[list[Any]], header: list[str] | None = None) -> html.Table: - """ - Deprecated. Prefer ctl.Table class instead. + """Deprecated. Prefer ctl.Table class instead. Create a HTML table from a list of elements. @@ -1304,8 +1251,7 @@ def get_tooltip( wrapper_class: str | None = None, **kwargs, ): - """ - Deprecated. Prefer alternative dcc.Tooltip component instead. + """Deprecated. Prefer alternative dcc.Tooltip component instead. Uses the tooltip component from dash-mp-components to add a tooltip, typically for help text. This component uses react-tooltip under the hood. @@ -1336,8 +1282,7 @@ def get_tooltip( def get_breadcrumb(parts): - """ - Deprecated, prefer the ctl.Breadcrumb class instead, which is a drop-in replacement. + """Deprecated, prefer the ctl.Breadcrumb class instead, which is a drop-in replacement. Create a breadcrumb navigation bar. @@ -1362,9 +1307,7 @@ def get_breadcrumb(parts): class Spinner(html.Button): def __init__(self, *args, **kwargs) -> None: - """ - Deprecated, prefer ctl.Button class instead with loading=True keyword argument. - """ + """Deprecated, prefer ctl.Button class instead with loading=True keyword argument.""" _update_css_class(kwargs, "button is-primary is-loading") kwargs["style"] = {"width": "35px", "height": "35px", "borderRadius": "35px"} kwargs["aria-label"] = "Loading" diff --git a/crystal_toolkit/helpers/povray_renderer.py b/crystal_toolkit/helpers/povray_renderer.py index 74bce80c..8eb86dc2 100644 --- a/crystal_toolkit/helpers/povray_renderer.py +++ b/crystal_toolkit/helpers/povray_renderer.py @@ -2,6 +2,7 @@ For creating publication quality plots. """ + from __future__ import annotations from jinja2 import Environment