6
6
import numba # type: ignore
7
7
import numpy as np
8
8
from numpydoc_decorator import doc # type: ignore
9
- import anjl .params # type: ignore
10
9
11
10
# Internal imports.
12
11
from .snp_data import AnophelesSnpData
@@ -410,10 +409,10 @@ def plot_njt(
410
409
metric : distance_params .distance_metric = distance_params .default_distance_metric ,
411
410
distance_sort : Optional [tree_params .distance_sort ] = None ,
412
411
count_sort : Optional [tree_params .count_sort ] = None ,
413
- center_x : anjl . params .center_x = 0 ,
414
- center_y : anjl . params .center_y = 0 ,
415
- arc_start : anjl . params .arc_start = 0 ,
416
- arc_stop : anjl . params .arc_stop = 2 * math .pi ,
412
+ center_x : distance_params .center_x = 0 ,
413
+ center_y : distance_params .center_y = 0 ,
414
+ arc_start : distance_params .arc_start = 0 ,
415
+ arc_stop : distance_params .arc_stop = 2 * math .pi ,
417
416
width : plotly_params .fig_width = 800 ,
418
417
height : plotly_params .fig_height = 600 ,
419
418
show : plotly_params .show = True ,
@@ -426,8 +425,8 @@ def plot_njt(
426
425
color_discrete_sequence : plotly_params .color_discrete_sequence = None ,
427
426
color_discrete_map : plotly_params .color_discrete_map = None ,
428
427
category_orders : plotly_params .category_order = None ,
429
- edge_legend : anjl . params .edge_legend = False ,
430
- leaf_legend : anjl . params .leaf_legend = True ,
428
+ edge_legend : distance_params .edge_legend = False ,
429
+ leaf_legend : distance_params .leaf_legend = True ,
431
430
legend_sizing : plotly_params .legend_sizing = "constant" ,
432
431
thin_offset : base_params .thin_offset = 0 ,
433
432
sample_sets : Optional [base_params .sample_sets ] = None ,
@@ -449,6 +448,10 @@ def plot_njt(
449
448
inline_array : base_params .inline_array = base_params .inline_array_default ,
450
449
chunks : base_params .chunks = base_params .native_chunks ,
451
450
) -> plotly_params .figure :
451
+ # Only import anjl if needed, as it requires a couple of seconds to compile
452
+ # functions.
453
+ import anjl # type: ignore
454
+
452
455
# Normalise params.
453
456
if count_sort is None and distance_sort is None :
454
457
count_sort = True
0 commit comments