Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into bbi_examples
Browse files Browse the repository at this point in the history
  • Loading branch information
achamma723 committed Jul 18, 2024
2 parents f156cbc + bea5578 commit d072b93
Show file tree
Hide file tree
Showing 41 changed files with 491 additions and 478 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
pip install -r doc_conf/doc-requirements.txt
pip install -e .
python -m pip install -e .
python -m pip install .[doc,plotting]
- name: Sphinx build
id: build-docs
run: |
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/build_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,22 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# - name: Lint with flake8
# uses: py-actions/[email protected]
- name: Generate coverage report
run: |
pip install pytest pytest-cov
python -m pip install .[test]
pytest --cov=./ --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
Expand Down
6 changes: 3 additions & 3 deletions doc_conf/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
# serve to show the default.

import os
import sys
import warnings
import sphinx_gallery
import sphinx_bootstrap_theme
from distutils.version import LooseVersion

import matplotlib
import sphinx_bootstrap_theme
import sphinx_gallery

# Disable agg warnings in doc
warnings.filterwarnings(
Expand Down
20 changes: 0 additions & 20 deletions doc_conf/doc-requirements.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@
arXiv preprint arXiv:2106.02590.
"""

import matplotlib.pyplot as plt

#############################################################################
# Imports needed for this script
# ------------------------------
import numpy as np
import matplotlib.pyplot as plt
from sklearn.feature_extraction import image
from sklearn.cluster import FeatureAgglomeration
from sklearn.feature_extraction import image

from hidimstat.scenario import multivariate_simulation
from hidimstat.stat_tools import zscore_from_pval, pval_from_cb
from hidimstat.desparsified_lasso import desparsified_lasso
from hidimstat.clustered_inference import clustered_inference
from hidimstat.desparsified_lasso import desparsified_lasso
from hidimstat.ensemble_clustered_inference import ensemble_clustered_inference

from hidimstat.scenario import multivariate_simulation
from hidimstat.stat_tools import pval_from_cb, zscore_from_pval

#############################################################################
# Specific plotting functions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
# Imports needed for this script
# ------------------------------

import matplotlib.pyplot as plt
import numpy as np
from hidimstat.BBI import BlockBasedImportance
from sklearn.datasets import load_diabetes
import matplotlib.pyplot as plt

from hidimstat.BBI import BlockBasedImportance

plt.rcParams.update({"font.size": 14})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,21 @@
# ------------------------------
import numpy as np
import pandas as pd
from sklearn.utils import Bunch
from sklearn.cluster import FeatureAgglomeration
from sklearn.feature_extraction import image
from sklearn.linear_model import Ridge
from nilearn import datasets
from nilearn.input_data import NiftiMasker
from nilearn.image import mean_img
from nilearn.input_data import NiftiMasker
from nilearn.plotting import plot_stat_map, show
from sklearn.cluster import FeatureAgglomeration
from sklearn.feature_extraction import image
from sklearn.linear_model import Ridge
from sklearn.utils import Bunch

from hidimstat.stat_tools import zscore_from_pval, pval_from_scale
from hidimstat.standardized_svr import standardized_svr
from hidimstat.permutation_test import permutation_test, permutation_test_cv
from hidimstat.adaptive_permutation_threshold import ada_svr
from hidimstat.clustered_inference import clustered_inference
from hidimstat.ensemble_clustered_inference import ensemble_clustered_inference
from hidimstat.permutation_test import permutation_test, permutation_test_cv
from hidimstat.standardized_svr import standardized_svr
from hidimstat.stat_tools import pval_from_scale, zscore_from_pval


#############################################################################
Expand Down
12 changes: 6 additions & 6 deletions examples/plot_2D_simulation_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@
arXiv preprint arXiv:2106.02590.
"""

import matplotlib.pyplot as plt

#############################################################################
# Imports needed for this script
# ------------------------------
import numpy as np
import matplotlib.pyplot as plt
from sklearn.feature_extraction import image
from sklearn.cluster import FeatureAgglomeration
from sklearn.feature_extraction import image

from hidimstat.scenario import multivariate_simulation
from hidimstat.stat_tools import zscore_from_pval, pval_from_cb
from hidimstat.desparsified_lasso import desparsified_lasso
from hidimstat.clustered_inference import clustered_inference
from hidimstat.desparsified_lasso import desparsified_lasso
from hidimstat.ensemble_clustered_inference import ensemble_clustered_inference

from hidimstat.scenario import multivariate_simulation
from hidimstat.stat_tools import pval_from_cb, zscore_from_pval

#############################################################################
# Specific plotting functions
Expand Down
5 changes: 3 additions & 2 deletions examples/plot_diabetes_variable_importance_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@
# Imports needed for this script
# ------------------------------

import matplotlib.pyplot as plt
import numpy as np
from hidimstat.BBI import BlockBasedImportance
from sklearn.datasets import load_diabetes
import matplotlib.pyplot as plt

from hidimstat.BBI import BlockBasedImportance

plt.rcParams.update({"font.size": 14})

Expand Down
16 changes: 8 additions & 8 deletions examples/plot_fmri_data_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,21 @@
# ------------------------------
import numpy as np
import pandas as pd
from sklearn.utils import Bunch
from sklearn.cluster import FeatureAgglomeration
from sklearn.feature_extraction import image
from sklearn.linear_model import Ridge
from nilearn import datasets
from nilearn.input_data import NiftiMasker
from nilearn.image import mean_img
from nilearn.input_data import NiftiMasker
from nilearn.plotting import plot_stat_map, show
from sklearn.cluster import FeatureAgglomeration
from sklearn.feature_extraction import image
from sklearn.linear_model import Ridge
from sklearn.utils import Bunch

from hidimstat.stat_tools import zscore_from_pval, pval_from_scale
from hidimstat.standardized_svr import standardized_svr
from hidimstat.permutation_test import permutation_test, permutation_test_cv
from hidimstat.adaptive_permutation_threshold import ada_svr
from hidimstat.clustered_inference import clustered_inference
from hidimstat.ensemble_clustered_inference import ensemble_clustered_inference
from hidimstat.permutation_test import permutation_test, permutation_test_cv
from hidimstat.standardized_svr import standardized_svr
from hidimstat.stat_tools import pval_from_scale, zscore_from_pval


#############################################################################
Expand Down
5 changes: 3 additions & 2 deletions examples_not_exhibited/plot_fig_1_nguyen_et_al.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
"""
import matplotlib.pyplot as plt
import numpy as np
from joblib import Parallel, delayed
from sklearn.preprocessing import StandardScaler

from hidimstat.knockoffs import knockoff_aggregation, model_x_knockoff
from hidimstat.knockoffs.data_simulation import simu_data
from hidimstat.knockoffs.utils import cal_fdp_power
from joblib import Parallel, delayed
from sklearn.preprocessing import StandardScaler

color_blue = "#1f77b4"
color_teal = "#1fbecf"
Expand Down
9 changes: 5 additions & 4 deletions examples_not_exhibited/plot_meg_data_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@
"""

import os
import numpy as np

import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import mne
from scipy.sparse.csgraph import connected_components
import numpy as np
from mne.datasets import sample, somato
from mne.inverse_sparse.mxne_inverse import _prepare_gain, _make_sparse_stc
from mne.minimum_norm import make_inverse_operator, apply_inverse
from mne.inverse_sparse.mxne_inverse import _make_sparse_stc, _prepare_gain
from mne.minimum_norm import apply_inverse, make_inverse_operator
from scipy.sparse.csgraph import connected_components
from sklearn.cluster import FeatureAgglomeration
from sklearn.metrics.pairwise import pairwise_distances

Expand Down
Loading

0 comments on commit d072b93

Please sign in to comment.