From 1f0049289c5662b82790edf2b4e6268451bf7f38 Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Fri, 29 Nov 2024 15:24:35 -0500 Subject: [PATCH] add optional dep seekpath under new dep group 'brillouin' --- pymatviz/brillouin.py | 5 +++-- pyproject.toml | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pymatviz/brillouin.py b/pymatviz/brillouin.py index dac371a9..efdc2cc7 100644 --- a/pymatviz/brillouin.py +++ b/pymatviz/brillouin.py @@ -183,9 +183,10 @@ def brillouin_zone_3d( x_coords += [coords[0]] y_coords += [coords[1]] z_coords += [coords[2]] - pretty_label = label.replace("\\Gamma", "Γ").replace("GAMMA", "Γ") + for text, repl in [("\\Gamma", "Γ"), ("GAMMA", "Γ"), ("DELTA", "Δ")]: + label = label.replace(text, repl) # noqa: PLW2901 # use for subscripts - pretty_label = re.sub(r"_(\d+)", r"\1", pretty_label) + pretty_label = re.sub(r"_(\d+)", r"\1", label) point_labels += [pretty_label] fig.add_scatter3d( diff --git a/pyproject.toml b/pyproject.toml index a7aa9510..a5853a16 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,6 +51,7 @@ test = [ "pytest-split>=0.9", "pytest>=8", ] +brillouin = ["seekpath>=2.1"] [tool.setuptools.packages.find] include = ["pymatviz*"]