diff --git a/q2_fmt/_peds.py b/q2_fmt/_peds.py index f334f89..8cb7f47 100644 --- a/q2_fmt/_peds.py +++ b/q2_fmt/_peds.py @@ -21,8 +21,8 @@ from qiime2 import Metadata from q2_fmt._engraftment import _get_to_baseline_ref -from q2_fmt._util import json_replace -from q2_stats._visualizer import _make_stats +from q2_stats.util import json_replace +from q2_stats.plots.raincloud import _make_stats def peds(ctx, table, metadata, peds_metric, time_column, reference_column, diff --git a/q2_fmt/_util.py b/q2_fmt/_util.py deleted file mode 100644 index 577a5d4..0000000 --- a/q2_fmt/_util.py +++ /dev/null @@ -1,26 +0,0 @@ -# ---------------------------------------------------------------------------- -# Copyright (c) 2023, QIIME 2 development team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file LICENSE, distributed with this software. -# ---------------------------------------------------------------------------- - -def json_replace(json_obj, **values): - """ - Search for elements of `{"{{REPLACE_PARAM}}": "some_key"}` and replace - with the result of `values["some_key"]`. - """ - if type(json_obj) is dict and list(json_obj) == ["{{REPLACE_PARAM}}"]: - param_name = json_obj["{{REPLACE_PARAM}}"] - return values[param_name] - - if type(json_obj) is list: - return [json_replace(x, **values) for x in json_obj] - - elif type(json_obj) is dict: - return {key: json_replace(value, **values) - for key, value in json_obj.items()} - - else: - return json_obj diff --git a/q2_fmt/plugin_setup.py b/q2_fmt/plugin_setup.py index 4892ea2..dfb50db 100644 --- a/q2_fmt/plugin_setup.py +++ b/q2_fmt/plugin_setup.py @@ -17,8 +17,9 @@ import q2_fmt from q2_types.feature_table import ( FeatureTable, Frequency, RelativeFrequency, PresenceAbsence) -from q2_stats._type import (Dist1D, Matched, Independent, Ordered, - Unordered, StatsTable, Pairwise, NestedOrdered) +from q2_stats.types import (Dist1D, Matched, Independent, Ordered, + Unordered, StatsTable, Pairwise, + NestedOrdered) import q2_fmt._examples as ex citations = Citations.load('citations.bib', package='q2_fmt')