Skip to content

Commit

Permalink
rename scanpro.py to main.py to solve circular import error
Browse files Browse the repository at this point in the history
  • Loading branch information
yalayoubi committed Jul 27, 2024
1 parent b875825 commit 353be97
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 21 deletions.
19 changes: 0 additions & 19 deletions scanpro/__init__.py
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
4 changes: 2 additions & 2 deletions scanpro/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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!
Expand Down

0 comments on commit 353be97

Please sign in to comment.