From 353be973196a1e542c45b80c3ca36bd0e71d7fdb Mon Sep 17 00:00:00 2001 From: Yousef Alayoubi Date: Sat, 27 Jul 2024 15:04:52 +0200 Subject: [PATCH] rename scanpro.py to main.py to solve circular import error --- scanpro/__init__.py | 19 ------------------- scanpro/{scanpro.py => main.py} | 0 scanpro/utils.py | 4 ++-- 3 files changed, 2 insertions(+), 21 deletions(-) rename scanpro/{scanpro.py => main.py} (100%) diff --git a/scanpro/__init__.py b/scanpro/__init__.py index d99ca73..8dee4bf 100644 --- a/scanpro/__init__.py +++ b/scanpro/__init__.py @@ -1,20 +1 @@ -from importlib import import_module from ._version import __version__ - -# Set functions to be available directly from upper scanpro, i.e. "from scanpro import scanpro" -global_classes = ["scanpro.scanpro.scanpro", - "scanpro.scanpro.run_scanpro", - "scanpro.scanpro.anova", - "scanpro.scanpro.t_test", - "scanpro.scanpro.sim_scanpro" - ] - -for c in global_classes: - - module_name = ".".join(c.split(".")[:-1]) - attribute_name = c.split(".")[-1] - - module = import_module(module_name) - attribute = getattr(module, attribute_name) - - globals()[attribute_name] = attribute diff --git a/scanpro/scanpro.py b/scanpro/main.py similarity index 100% rename from scanpro/scanpro.py rename to scanpro/main.py diff --git a/scanpro/utils.py b/scanpro/utils.py index 230942e..476116d 100644 --- a/scanpro/utils.py +++ b/scanpro/utils.py @@ -4,7 +4,7 @@ import pandas as pd from scipy.stats import binom, nbinom -from scanpro import gaussq2 +import scanpro def del_index(x, indices): @@ -143,7 +143,7 @@ def gauss_quad_prob(n, dist="uniform", ll=0, u=1, mu=0, sigma=1, alpha=1, beta=1 z = np.zeros(n) z[0] = 1 ierr = 0 - gaussq2.gausq2(n, a, b, z, ierr) + scanpro.gaussq2.gausq2(n, a, b, z, ierr) x = a # nodes w = z**2 # weights if dist == 'uniform': # skipped other dists since we only use uniform!