Skip to content

Commit d159dca

Browse files
Improve a bit the index of the API (#355)
* Change API * Update docs/src/api.rst Co-authored-by: Joseph Paillard <[email protected]> * remove not necessary class from init * fix import * fix reference for bibliography, example, template * Apply suggestions from code review Co-authored-by: Joseph Paillard <[email protected]> * fix doc --------- Co-authored-by: Joseph Paillard <[email protected]>
1 parent 01d12f9 commit d159dca

File tree

7 files changed

+48
-26
lines changed

7 files changed

+48
-26
lines changed

docs/src/api.rst

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,37 @@
44
API
55
=================
66

7-
Estimators
8-
==========
9-
107
.. currentmodule:: hidimstat
118

12-
Functions
13-
=========
9+
Base Classes
10+
============
11+
12+
.. autosummary::
13+
:toctree: ./generated/api/base/
14+
:template: class.rst
15+
16+
base_variable_importance.BaseVariableImportance
17+
base_perturbation.BasePerturbation
18+
19+
Feature Importance Classes
20+
==========================
21+
22+
.. autosummary::
23+
:toctree: ./generated/api/class/
24+
:template: class.rst
25+
26+
LOCO
27+
CFI
28+
PFI
29+
D0CRT
30+
31+
Feature Importance functions
32+
============================
1433

1534
.. autosummary::
16-
:toctree: ./generated/api/function/
35+
:toctree: ./generated/api/class/
1736
:template: function.rst
1837

19-
quantile_aggregation
2038
clustered_inference
2139
clustered_inference_pvalue
2240
desparsified_lasso
@@ -25,18 +43,22 @@ Functions
2543
ensemble_clustered_inference
2644
ensemble_clustered_inference_pvalue
2745
model_x_knockoff
28-
reid
2946

30-
Classes
31-
=======
47+
Samplers
48+
========
3249

3350
.. autosummary::
3451
:toctree: ./generated/api/class/
3552
:template: class.rst
36-
37-
BaseVariableImportance
38-
BasePerturbation
39-
LOCO
40-
CFI
41-
PFI
42-
D0CRT
53+
54+
conditional_sampling.ConditionalSampler
55+
56+
Helper Functions
57+
================
58+
59+
.. autosummary::
60+
:toctree: ./generated/api/helper_functions/
61+
:template: function.rst
62+
63+
quantile_aggregation
64+
reid

docs/tools/_templates/class.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
.. automethod:: __init__
1111
{% endblock %}
1212

13-
.. include:: {{module}}.{{objname}}.examples
13+
.. include:: ../../gallery/backreference/{{module}}.{{objname}}.examples
1414

1515
.. raw:: html
1616

docs/tools/_templates/function.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55

66
.. autofunction:: {{ objname }}
77

8-
.. include:: {{module}}.{{objname}}.examples
8+
.. include:: ../../gallery/backreference/{{module}}.{{objname}}.examples

docs/tools/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
]
5151

5252
# Add any paths that contain templates here, relative to this directory.
53-
templates_path = ["./_templates"]
53+
templates_path = ["../tools/_templates"]
5454
# List of patterns, relative to source directory, that match files and
5555
# directories to ignore when looking for source files.
5656
# This patterns also effect to html_static_path and html_extra_path
@@ -69,7 +69,7 @@
6969
# Add any paths that contain custom static files (such as style sheets) here,
7070
# relative to this directory. They are copied after the builtin static files,
7171
# so a file named "default.css" will overwrite the builtin "default.css".
72-
html_static_path = ["./_static"]
72+
html_static_path = ["../tools/_static"]
7373
html_logo = "./_static/logo.png"
7474
# The theme to use for HTML and HTML Help pages. See the documentation for
7575
# a list of builtin themes.
@@ -99,7 +99,7 @@
9999
source_suffix = [".rst", ".md"]
100100

101101
# sphinxcontrib-bibtex
102-
bibtex_bibfiles = ["./references.bib"]
102+
bibtex_bibfiles = ["../tools/references.bib"]
103103
bibtex_style = "unsrt"
104104
bibtex_reference_style = "author_year"
105105
bibtex_footbibliography_header = ""

src/hidimstat/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from .base_variable_importance import BaseVariableImportance
2-
from .base_perturbation import BasePerturbation
31
from .ensemble_clustered_inference import (
42
clustered_inference,
53
clustered_inference_pvalue,

test/test_conditional_feature_importance.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
from sklearn.model_selection import train_test_split
99
from sklearn.metrics import root_mean_squared_error
1010

11-
from hidimstat import CFI, BasePerturbation
11+
from hidimstat import CFI
12+
from hidimstat.base_perturbation import BasePerturbation
1213
from hidimstat._utils.exception import InternalError
1314

1415

test/test_leave_one_covariate_out.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
from sklearn.model_selection import train_test_split
88
from hidimstat._utils.scenario import multivariate_simulation
99

10-
from hidimstat import LOCO, BasePerturbation
10+
from hidimstat import LOCO
11+
from hidimstat.base_perturbation import BasePerturbation
1112

1213

1314
def test_loco():

0 commit comments

Comments
 (0)