Skip to content

Commit 2819be9

Browse files
committed
add get_breadcrumb() doc str
1 parent 1d3a81f commit 2819be9

File tree

3 files changed

+32
-18
lines changed

3 files changed

+32
-18
lines changed

crystal_toolkit/helpers/layouts.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -439,20 +439,24 @@ def __init__(self, *args, **kwargs) -> None:
439439

440440

441441
def get_breadcrumb(parts):
442+
"""Create a breadcrumb navigation bar.
443+
444+
Args:
445+
parts (dict): Dictionary of name, link pairs.
446+
447+
Returns:
448+
html.Nav: Breadcrumb navigation bar.
449+
"""
442450
if not parts:
443-
return html.Div()
451+
return html.Nav()
444452

445-
breadcrumbs = html.Nav(
446-
html.Ul(
447-
[
448-
html.Li(
449-
dcc.Link(name, href=link),
450-
className=(None if idx != len(parts) - 1 else "is-active"),
451-
)
452-
for idx, (name, link) in enumerate(parts.items())
453-
]
454-
),
455-
className="breadcrumb",
456-
)
453+
links = [
454+
html.Li(
455+
dcc.Link(name, href=link),
456+
className="is-active" if idx == len(parts) - 1 else None,
457+
)
458+
for idx, (name, link) in enumerate(parts.items())
459+
]
460+
breadcrumbs = html.Nav(html.Ul(links), className="breadcrumb")
457461

458462
return breadcrumbs

crystal_toolkit/helpers/povray_renderer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@
135135

136136

137137
def pov_write_data(input_scene_comp, fstream):
138-
"""parse a primitive display object in crystaltoolkit and print it to POV-Ray input_scene_comp
139-
fstream.
138+
"""Parse a primitive display object in crystaltoolkit and print it to POV-Ray
139+
input_scene_comp fstream.
140140
"""
141141
vect = "{:.4f},{:.4f},{:.4f}"
142142

crystal_toolkit/renderables/volumetric.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
from __future__ import annotations
22

3+
from typing import Any
4+
35
import numpy as np
6+
from numpy.typing import ArrayLike
47
from pymatgen.io.vasp import VolumetricData
58

69
from crystal_toolkit.core.scene import Scene, Surface
@@ -9,15 +12,22 @@
912

1013

1114
def get_isosurface_scene(
12-
self, data_key="total", isolvl=0.05, step_size=4, origin=None, **kwargs
13-
):
15+
self,
16+
data_key: str = "total",
17+
isolvl: float = 0.05,
18+
step_size: int = 4,
19+
origin: ArrayLike = None,
20+
**kwargs: Any,
21+
) -> Scene:
1422
"""Get the isosurface from a VolumetricData object.
1523
1624
Args:
1725
data_key (str, optional): Use the volumetric data from self.data[data_key]. Defaults to 'total'.
1826
isolvl (float, optional): The cutoff for the isosurface to using the same units as VESTA so
19-
e/bohr and kept grid size independent
27+
e/bohr and kept grid size independent
2028
step_size (int, optional): step_size parameter for marching_cubes_lewiner. Defaults to 3.
29+
origin (ArrayLike, optional): The origin of the isosurface. Defaults to None.
30+
**kwargs: Passed to the Surface object.
2131
2232
Returns:
2333
Scene: object containing the isosurface component

0 commit comments

Comments
 (0)