Skip to content

Commit

Permalink
Replace relative imports with absolute ones (#674)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Apr 28, 2022
1 parent b806510 commit 6cd751e
Show file tree
Hide file tree
Showing 34 changed files with 118 additions and 115 deletions.
10 changes: 5 additions & 5 deletions nimare/annotate/cogat.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import numpy as np
import pandas as pd

from .. import references
from ..due import due
from ..extract import download_cognitive_atlas
from ..utils import _uk_to_us
from . import utils
from nimare import references
from nimare.annotate import utils
from nimare.due import due
from nimare.extract import download_cognitive_atlas
from nimare.utils import _uk_to_us

LGR = logging.getLogger(__name__)

Expand Down
8 changes: 4 additions & 4 deletions nimare/annotate/gclda.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
from nilearn._utils import load_niimg
from scipy.stats import multivariate_normal

from .. import references
from ..base import NiMAREBase
from ..due import due
from ..utils import get_template
from nimare import references
from nimare.base import NiMAREBase
from nimare.due import due
from nimare.utils import get_template

LGR = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion nimare/annotate/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer

from ..utils import get_resource_path
from nimare.utils import get_resource_path

LGR = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions nimare/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
from nilearn._utils.niimg_conversions import _check_same_fov
from nilearn.image import concat_imgs, resample_to_img

from .results import MetaResult
from .utils import get_masker, mm2vox
from nimare.results import MetaResult
from nimare.utils import get_masker, mm2vox

LGR = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions nimare/correct.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import numpy as np
import statsmodels.stats.multitest as mc

from .results import MetaResult
from .transforms import p_to_z
from nimare.results import MetaResult
from nimare.transforms import p_to_z

LGR = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions nimare/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import pandas as pd
from nilearn._utils import load_niimg

from .base import NiMAREBase
from .utils import (
from nimare.base import NiMAREBase
from nimare.utils import (
_dict_to_coordinates,
_dict_to_df,
_listify,
Expand Down
16 changes: 8 additions & 8 deletions nimare/decode/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
from nilearn.masking import apply_mask
from tqdm.auto import tqdm

from .. import references
from ..base import Decoder
from ..due import due
from ..meta.cbma.base import CBMAEstimator
from ..meta.cbma.mkda import MKDAChi2
from ..stats import pearson
from ..utils import _check_type, _safe_transform
from .utils import weight_priors
from nimare import references
from nimare.base import Decoder
from nimare.decode.utils import weight_priors
from nimare.due import due
from nimare.meta.cbma.base import CBMAEstimator
from nimare.meta.cbma.mkda import MKDAChi2
from nimare.stats import pearson
from nimare.utils import _check_type, _safe_transform

LGR = logging.getLogger(__name__)

Expand Down
16 changes: 8 additions & 8 deletions nimare/decode/discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
from scipy.stats import binom
from statsmodels.sandbox.stats.multicomp import multipletests

from .. import references
from ..base import Decoder
from ..due import due
from ..meta.kernel import KernelTransformer, MKDAKernel
from ..stats import one_way, pearson, two_way
from ..transforms import p_to_z
from ..utils import _check_type, get_masker
from .utils import weight_priors
from nimare import references
from nimare.base import Decoder
from nimare.decode.utils import weight_priors
from nimare.due import due
from nimare.meta.kernel import KernelTransformer, MKDAKernel
from nimare.stats import one_way, pearson, two_way
from nimare.transforms import p_to_z
from nimare.utils import _check_type, get_masker


@due.dcite(references.GCLDA_DECODING, description="Citation for GCLDA decoding.")
Expand Down
6 changes: 3 additions & 3 deletions nimare/decode/encode.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from nilearn.masking import unmask
from sklearn.feature_extraction.text import CountVectorizer

from .. import references
from ..due import due
from .utils import weight_priors
from nimare import references
from nimare.decode.utils import weight_priors
from nimare.due import due


@due.dcite(references.GCLDA_DECODING, description="Citation for GCLDA encoding.")
Expand Down
2 changes: 1 addition & 1 deletion nimare/due.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Note that it might be better to avoid naming it duecredit.py to avoid shadowing
installed duecredit.
Then use in your code as
from .due import due, Doi, BibTeX
from nimare.due import due, Doi, BibTeX
See https://github.com/duecredit/duecredit/blob/master/README.md for examples.
Origin: Originally a part of the duecredit
Copyright: 2015-2016 DueCredit developers
Expand Down
6 changes: 3 additions & 3 deletions nimare/extract/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
import requests
from tqdm.auto import tqdm

from ..dataset import Dataset
from ..utils import get_resource_path
from .utils import (
from nimare.dataset import Dataset
from nimare.extract.utils import (
_download_zipped_file,
_expand_df,
_get_concept_reltype,
_get_dataset_dir,
_longify,
)
from nimare.utils import get_resource_path

LGR = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion nimare/extract/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import requests
from fuzzywuzzy import fuzz

from ..utils import _uk_to_us
from nimare.utils import _uk_to_us

LGR = logging.getLogger(__name__)

Expand Down
10 changes: 5 additions & 5 deletions nimare/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

import numpy as np

from .dataset import Dataset
from .io import convert_neurovault_to_dataset
from .meta.utils import compute_ale_ma, get_ale_kernel
from .transforms import ImageTransformer
from .utils import get_template, mm2vox, vox2mm
from nimare.dataset import Dataset
from nimare.io import convert_neurovault_to_dataset
from nimare.meta.utils import compute_ale_ma, get_ale_kernel
from nimare.transforms import ImageTransformer
from nimare.utils import get_template, mm2vox, vox2mm

# defaults for creating a neurovault dataset
NEUROVAULT_IDS = (8836, 8838, 8893, 8895, 8892, 8891, 8962, 8894, 8956, 8854, 9000)
Expand Down
4 changes: 2 additions & 2 deletions nimare/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import requests
from scipy import sparse

from .dataset import Dataset
from .extract.utils import _get_dataset_dir
from nimare.dataset import Dataset
from nimare.extract.utils import _get_dataset_dir

LGR = logging.getLogger(__name__)

Expand Down
14 changes: 7 additions & 7 deletions nimare/meta/cbma/ale.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
from joblib import Parallel, delayed
from tqdm.auto import tqdm

from ... import references
from ...due import due
from ...stats import null_to_p, nullhist_to_p
from ...transforms import p_to_z
from ...utils import tqdm_joblib, use_memmap
from ..kernel import ALEKernel
from .base import CBMAEstimator, PairwiseCBMAEstimator
from nimare import references
from nimare.due import due
from nimare.meta.cbma.base import CBMAEstimator, PairwiseCBMAEstimator
from nimare.meta.kernel import ALEKernel
from nimare.stats import null_to_p, nullhist_to_p
from nimare.transforms import p_to_z
from nimare.utils import tqdm_joblib, use_memmap

LGR = logging.getLogger(__name__)

Expand Down
14 changes: 7 additions & 7 deletions nimare/meta/cbma/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@
from scipy import ndimage
from tqdm.auto import tqdm

from ...base import MetaEstimator
from ...results import MetaResult
from ...stats import null_to_p, nullhist_to_p
from ...transforms import p_to_z
from ...utils import (
from nimare.base import MetaEstimator
from nimare.meta.kernel import KernelTransformer
from nimare.meta.utils import _calculate_cluster_measures, _get_last_bin
from nimare.results import MetaResult
from nimare.stats import null_to_p, nullhist_to_p
from nimare.transforms import p_to_z
from nimare.utils import (
_add_metadata_to_dataframe,
_check_type,
_safe_transform,
tqdm_joblib,
use_memmap,
vox2mm,
)
from ..kernel import KernelTransformer
from ..utils import _calculate_cluster_measures, _get_last_bin

LGR = logging.getLogger(__name__)

Expand Down
16 changes: 8 additions & 8 deletions nimare/meta/cbma/mkda.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
from statsmodels.sandbox.stats.multicomp import multipletests
from tqdm.auto import tqdm

from ... import references
from ...due import due
from ...stats import null_to_p, one_way, two_way
from ...transforms import p_to_z
from ...utils import tqdm_joblib, use_memmap, vox2mm
from ..kernel import KDAKernel, MKDAKernel
from ..utils import _calculate_cluster_measures
from .base import CBMAEstimator, PairwiseCBMAEstimator
from nimare import references
from nimare.due import due
from nimare.meta.cbma.base import CBMAEstimator, PairwiseCBMAEstimator
from nimare.meta.kernel import KDAKernel, MKDAKernel
from nimare.meta.utils import _calculate_cluster_measures
from nimare.stats import null_to_p, one_way, two_way
from nimare.transforms import p_to_z
from nimare.utils import tqdm_joblib, use_memmap, vox2mm

LGR = logging.getLogger(__name__)

Expand Down
6 changes: 3 additions & 3 deletions nimare/meta/ibma.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
from nilearn.input_data import NiftiMasker
from nilearn.mass_univariate import permuted_ols

from ..base import MetaEstimator
from ..transforms import p_to_z, t_to_z
from ..utils import _boolean_unmask
from nimare.base import MetaEstimator
from nimare.transforms import p_to_z, t_to_z
from nimare.utils import _boolean_unmask

LGR = logging.getLogger(__name__)

Expand Down
15 changes: 10 additions & 5 deletions nimare/meta/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,22 @@
import pandas as pd
from nilearn import image

from .. import references
from ..base import Transformer
from ..due import due
from ..utils import (
from nimare import references
from nimare.base import Transformer
from nimare.due import due
from nimare.meta.utils import (
compute_ale_ma,
compute_kda_ma,
compute_p2m_ma,
get_ale_kernel,
)
from nimare.utils import (
_add_metadata_to_dataframe,
_safe_transform,
mm2vox,
use_memmap,
vox2mm,
)
from .utils import compute_ale_ma, compute_kda_ma, compute_p2m_ma, get_ale_kernel

LGR = logging.getLogger(__name__)

Expand Down
8 changes: 4 additions & 4 deletions nimare/meta/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import numpy.linalg as npl
from scipy import ndimage

from .. import references
from ..due import due
from ..extract import download_peaks2maps_model
from ..utils import _determine_chunk_size
from nimare import references
from nimare.due import due
from nimare.extract import download_peaks2maps_model
from nimare.utils import _determine_chunk_size

os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"
LGR = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion nimare/references.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""References to be imported and injected at relevant places throughout the library."""
from .due import BibTeX, Doi
from nimare.due import BibTeX, Doi

TEXT2BRAIN = Doi("https://doi.org/10.1007/978-3-030-00931-1_67")

Expand Down
2 changes: 1 addition & 1 deletion nimare/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from nibabel.funcs import squeeze_image

from .utils import get_masker
from nimare.utils import get_masker

LGR = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion nimare/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import numpy as np

from . import utils
from nimare import utils

LGR = logging.getLogger(__name__)

Expand Down
3 changes: 1 addition & 2 deletions nimare/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

import nimare
from nimare.tests.utils import get_test_data_path

from ..utils import get_resource_path
from nimare.utils import get_resource_path

# Only enable the following once in a while for a check for SettingWithCopyWarnings
# pd.options.mode.chained_assignment = "raise"
Expand Down
12 changes: 6 additions & 6 deletions nimare/tests/test_estimator_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import numpy as np
import pytest

from ..correct import FDRCorrector, FWECorrector
from ..generate import create_coordinate_dataset
from ..meta import ale, kernel, mkda
from ..results import MetaResult
from ..utils import mm2vox
from .utils import _check_p_values, _create_signal_mask, _transform_res
from nimare.correct import FDRCorrector, FWECorrector
from nimare.generate import create_coordinate_dataset
from nimare.meta import ale, kernel, mkda
from nimare.results import MetaResult
from nimare.tests.utils import _check_p_values, _create_signal_mask, _transform_res
from nimare.utils import mm2vox

# set significance levels used for testing.
ALPHA = 0.05
Expand Down
4 changes: 2 additions & 2 deletions nimare/tests/test_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import pytest
from numpy.random import RandomState

from ..dataset import Dataset
from ..generate import (
from nimare.dataset import Dataset
from nimare.generate import (
_array_like,
_create_foci,
_create_source,
Expand Down

0 comments on commit 6cd751e

Please sign in to comment.