Skip to content

Commit 26ce701

Browse files
committed
dynamic fermi import
1 parent 18aec62 commit 26ce701

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crystal_toolkit/components/fermi_surface.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import matplotlib.pyplot as plt
66
from dash import Input, Output
7-
from ifermi.plot import FermiSurfacePlotter
7+
from importlib import import_module
88

99
from crystal_toolkit.core.mpcomponent import MPComponent
1010
from crystal_toolkit.helpers.layouts import Box, Column, Columns, Loading, dcc
@@ -44,7 +44,8 @@ def get_figure(fermi_surface: FermiSurface, **kwargs) -> Figure:
4444
Returns:
4545
A plotly Figure object.
4646
"""
47-
plotter = FermiSurfacePlotter(fermi_surface)
47+
fermi_module = import_module("ifermi.plot")
48+
plotter = fermi_module.FermiSurfacePlotter(fermi_surface)
4849
fig = plotter.get_plot(plot_type="plotly", **kwargs)
4950

5051
# ensure the plot has a transparent background

0 commit comments

Comments
 (0)