From 2f871f52f005fe9d8923e421192a804dc11e3412 Mon Sep 17 00:00:00 2001 From: falexwolf Date: Thu, 24 Aug 2017 17:16:54 +0200 Subject: [PATCH] avoided duplicating exports in api.pl and api.pp --- scanpy/api/pl.py | 28 ++++++--------------------- scanpy/api/pp.py | 10 ++++++---- scanpy/plotting/__init__.py | 33 ++++++++++++++++---------------- scanpy/preprocessing/__init__.py | 1 - 4 files changed, 28 insertions(+), 44 deletions(-) diff --git a/scanpy/api/pl.py b/scanpy/api/pl.py index 051f5d2a11..b57da4d750 100644 --- a/scanpy/api/pl.py +++ b/scanpy/api/pl.py @@ -1,22 +1,6 @@ -# TODO: should not be duplicated from plotting.__init__ -from ..plotting.ann_data import scatter, violin -from ..plotting.ann_data import ranking - -from ..plotting.preprocessing import filter_genes_dispersion - -from ..plotting.tools import pca, pca_loadings, pca_scatter, pca_variance_ratio -from ..plotting.tools import diffmap -from ..plotting.tools import draw_graph -from ..plotting.tools import tsne -from ..plotting.tools import aga, aga_attachedness, aga_graph, aga_path, aga_scatter -from ..plotting.tools import dpt, dpt_scatter, dpt_groups_pseudotime, dpt_timeseries -from ..plotting.tools import louvain -from ..plotting.tools import rank_genes_groups, rank_genes_groups_violin -from ..plotting.tools import sim - -from ..plotting.rcmod import reset_rcParams -from ..plotting import palettes - -from ..plotting.utils import matrix -from ..plotting.utils import timeseries, timeseries_subplot, timeseries_as_heatmap - +# we need this dummy module as otherwise, sphinx cannot produce the overview of +# the api module +# +# importing all ("*") is ok, as scanpy.plotting.__init__ is carefully maintained +# to only contain the functions of the api +from ..plotting import * diff --git a/scanpy/api/pp.py b/scanpy/api/pp.py index a0977849fb..b56800f18e 100644 --- a/scanpy/api/pp.py +++ b/scanpy/api/pp.py @@ -1,4 +1,6 @@ -# TODO: this duplicates scanpy.preprocessing.__init__ -from ..preprocessing.recipes import recipe_zheng17, recipe_weinreb16 -from ..preprocessing.simple import filter_cells, filter_genes, filter_genes_dispersion -from ..preprocessing.simple import log1p, pca, normalize_per_cell, regress_out, scale, subsample +# we need this dummy module as otherwise, sphinx cannot produce the overview of +# the api module +# +# importing all ("*") is ok, as scanpy.preprocessing.__init__ is carefully maintained +# to only contain the functions of the api +from ..preprocessing import * diff --git a/scanpy/plotting/__init__.py b/scanpy/plotting/__init__.py index 10cba3f828..0e17a5055b 100644 --- a/scanpy/plotting/__init__.py +++ b/scanpy/plotting/__init__.py @@ -1,24 +1,23 @@ -# TODO: should not be duplicated from api.pl -from ..plotting.ann_data import scatter, violin -from ..plotting.ann_data import ranking +from .ann_data import scatter, violin +from .ann_data import ranking -from ..plotting.preprocessing import filter_genes_dispersion +from .preprocessing import filter_genes_dispersion -from ..plotting.tools import pca, pca_loadings, pca_scatter, pca_variance_ratio -from ..plotting.tools import diffmap -from ..plotting.tools import draw_graph -from ..plotting.tools import tsne -from ..plotting.tools import aga, aga_attachedness, aga_graph, aga_path, aga_scatter -from ..plotting.tools import dpt, dpt_scatter, dpt_groups_pseudotime, dpt_timeseries -from ..plotting.tools import louvain -from ..plotting.tools import rank_genes_groups, rank_genes_groups_violin -from ..plotting.tools import sim +from .tools import pca, pca_loadings, pca_scatter, pca_variance_ratio +from .tools import diffmap +from .tools import draw_graph +from .tools import tsne +from .tools import aga, aga_attachedness, aga_graph, aga_path, aga_scatter +from .tools import dpt, dpt_scatter, dpt_groups_pseudotime, dpt_timeseries +from .tools import louvain +from .tools import rank_genes_groups, rank_genes_groups_violin +from .tools import sim -from ..plotting.rcmod import reset_rcParams -from ..plotting import palettes +from .rcmod import reset_rcParams +from . import palettes -from ..plotting.utils import matrix -from ..plotting.utils import timeseries, timeseries_subplot, timeseries_as_heatmap +from .utils import matrix +from .utils import timeseries, timeseries_subplot, timeseries_as_heatmap # reset matplotlib.rcParams reset_rcParams() diff --git a/scanpy/preprocessing/__init__.py b/scanpy/preprocessing/__init__.py index 0c24f2b0f6..1d5b14fe98 100644 --- a/scanpy/preprocessing/__init__.py +++ b/scanpy/preprocessing/__init__.py @@ -1,4 +1,3 @@ -# this duplicates scanpy.api.pp from ..preprocessing.recipes import recipe_zheng17, recipe_weinreb16 from ..preprocessing.simple import filter_cells, filter_genes, filter_genes_dispersion from ..preprocessing.simple import log1p, pca, normalize_per_cell, regress_out, scale, subsample