Skip to content

Commit 3c8fa14

Browse files
author
LegrandNico
committed
Rename the package to metadpy
1 parent c2fb1db commit 3c8fa14

36 files changed

+170
-171
lines changed

.github/workflows/linting.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
pip install types-setuptools
3030
- name: Run tests and coverage
3131
run: |
32-
mypy ./metadPy/ --ignore-missing-imports
33-
flake8 ./metadPy/
34-
black ./metadPy/
35-
isort ./metadPy/
32+
mypy ./metadpy/ --ignore-missing-imports
33+
flake8 ./metadpy/
34+
black ./metadpy/
35+
isort ./metadpy/

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ repos:
2020
rev: 'v0.982' # Use the sha / tag you want to point at
2121
hooks:
2222
- id: mypy
23-
files: ^metadPy/
23+
files: ^metadpy/
2424
args: [--ignore-missing-imports]

MANIFEST.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Add models files
2-
include metadPy/models/group_level_numpyro.py
3-
include metadPy/models/subject_level_numpyro.py
4-
include metadPy/models/subject_level_pymc.py
2+
include metadpy/models/group_level_numpyro.py
3+
include metadpy/models/subject_level_numpyro.py
4+
include metadpy/models/subject_level_pymc.py

README.md

Lines changed: 26 additions & 26 deletions
Large diffs are not rendered by default.

codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
ignore:
2-
- "./metadPy/tests/*"
2+
- "./metadpy/tests/*"

docs/source/api.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. _api_ref:
22

3-
.. currentmodule:: metadPy
3+
.. currentmodule:: metadpy
44

55

66
.. contents:: Table of Contents
@@ -12,7 +12,7 @@ API
1212
Bayesian
1313
--------
1414

15-
.. currentmodule:: metadPy.bayesian
15+
.. currentmodule:: metadpy.bayesian
1616

1717
.. autosummary::
1818
:toctree: generated/bayesian
@@ -25,7 +25,7 @@ Bayesian
2525
MLE
2626
---
2727

28-
.. currentmodule:: metadPy.mle
28+
.. currentmodule:: metadpy.mle
2929

3030
.. autosummary::
3131
:toctree: generated/mle
@@ -37,7 +37,7 @@ MLE
3737
Plotting
3838
--------
3939

40-
.. currentmodule:: metadPy.plotting
40+
.. currentmodule:: metadpy.plotting
4141

4242
.. autosummary::
4343
:toctree: generated/plotting
@@ -48,7 +48,7 @@ Plotting
4848
SDT
4949
---
5050

51-
.. currentmodule:: metadPy.sdt
51+
.. currentmodule:: metadpy.sdt
5252

5353
.. autosummary::
5454
:toctree: generated/sdt
@@ -62,7 +62,7 @@ SDT
6262
Utils
6363
-----
6464

65-
.. currentmodule:: metadPy.utils
65+
.. currentmodule:: metadpy.utils
6666

6767
.. autosummary::
6868
:toctree: generated/utils

docs/source/conf.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@
1212
#
1313
import time
1414

15+
import metadpy
1516
import sphinx_bootstrap_theme
1617

17-
import metadPy
18-
1918
# -- Project information -----------------------------------------------------
2019

21-
project = "metadPy"
20+
project = "metadpy"
2221
copyright = "2022-{}, Nicolas Legrand".format(time.strftime("%Y"))
2322
author = "Nicolas Legrand"
24-
release = metadPy.__version__
23+
release = metadpy.__version__
2524

2625

2726
image_scrapers = ("matplotlib",)
@@ -86,7 +85,7 @@
8685
"icon_links": [
8786
dict(
8887
name="GitHub",
89-
url="https://github.com/embodied-computation-group/metadPy",
88+
url="https://github.com/embodied-computation-group/metadpy",
9089
icon="fab fa-github-square",
9190
),
9291
dict(
@@ -101,7 +100,7 @@
101100
),
102101
],
103102
"logo": {
104-
"text": "metadPy",
103+
"text": "metadpy",
105104
},
106105
}
107106

docs/source/examples/1-What metacognition looks like.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"source": [
1818
"import matplotlib.pyplot as plt\n",
1919
"import seaborn as sns\n",
20-
"from metadPy.plotting import plot_confidence\n",
21-
"from metadPy.utils import type2_SDT_simuation\n",
20+
"from metadpy.plotting import plot_confidence\n",
21+
"from metadpy.utils import type2_SDT_simuation\n",
2222
"\n",
2323
"sns.set_context(\"talk\")"
2424
]

docs/source/examples/1-What metacognition looks like.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Adapted from the tutorial proposed by the HMeta-d toolbox: https://github.com/me
1919
```{code-cell} ipython3
2020
import matplotlib.pyplot as plt
2121
import seaborn as sns
22-
from metadPy.plotting import plot_confidence
23-
from metadPy.utils import type2_SDT_simuation
22+
from metadpy.plotting import plot_confidence
23+
from metadpy.utils import type2_SDT_simuation
2424
2525
sns.set_context("talk")
2626
```

docs/source/examples/2-Fitting the model-MLE.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
"import numpy as np\n",
2020
"import pandas as pd\n",
2121
"import seaborn as sns\n",
22-
"from metadPy.mle import fit_metad, metad\n",
23-
"from metadPy.plotting import plot_confidence, plot_roc\n",
24-
"from metadPy.sdt import roc_auc\n",
25-
"from metadPy.utils import (responseSimulation, trials2counts,\n",
22+
"from metadpy.mle import fit_metad, metad\n",
23+
"from metadpy.plotting import plot_confidence, plot_roc\n",
24+
"from metadpy.sdt import roc_auc\n",
25+
"from metadpy.utils import (responseSimulation, trials2counts,\n",
2626
" type2_SDT_simuation)\n",
2727
"\n",
2828
"sns.set_context(\"talk\")"
@@ -204,8 +204,8 @@
204204
"```\n",
205205
"\n",
206206
"```{hint}\n",
207-
"* You can plot the ROC curve using `metadPy.plotting.plot_roc()`\n",
208-
"* You can calculate the area using `metadPy.std.roc_auc()`\n",
207+
"* You can plot the ROC curve using `metadpy.plotting.plot_roc()`\n",
208+
"* You can calculate the area using `metadpy.std.roc_auc()`\n",
209209
"```"
210210
]
211211
},
@@ -278,7 +278,7 @@
278278
"cell_type": "markdown",
279279
"metadata": {},
280280
"source": [
281-
"**NOTE:** nR_S1 and nR_S2 are the counts of the responses to stimulus 1 (nR_S1) and stimulus 2 (nR_S2) for each confidence level. We can compute this using the function py:func:`metadPy.utils.trials2counts()`."
281+
"**NOTE:** nR_S1 and nR_S2 are the counts of the responses to stimulus 1 (nR_S1) and stimulus 2 (nR_S2) for each confidence level. We can compute this using the function py:func:`metadpy.utils.trials2counts()`."
282282
]
283283
},
284284
{

docs/source/examples/2-Fitting the model-MLE.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ import matplotlib.pyplot as plt
2121
import numpy as np
2222
import pandas as pd
2323
import seaborn as sns
24-
from metadPy.mle import fit_metad, metad
25-
from metadPy.plotting import plot_confidence, plot_roc
26-
from metadPy.sdt import roc_auc
27-
from metadPy.utils import (responseSimulation, trials2counts,
24+
from metadpy.mle import fit_metad, metad
25+
from metadpy.plotting import plot_confidence, plot_roc
26+
from metadpy.sdt import roc_auc
27+
from metadpy.utils import (responseSimulation, trials2counts,
2828
type2_SDT_simuation)
2929
3030
sns.set_context("talk")
@@ -109,8 +109,8 @@ Now you should be able to see that the area under the type2ROC curve with lower
109109
```
110110

111111
```{hint}
112-
* You can plot the ROC curve using `metadPy.plotting.plot_roc()`
113-
* You can calculate the area using `metadPy.std.roc_auc()`
112+
* You can plot the ROC curve using `metadpy.plotting.plot_roc()`
113+
* You can calculate the area using `metadpy.std.roc_auc()`
114114
```
115115

116116
+++
@@ -151,7 +151,7 @@ high_noise_df = responseSimulation(
151151

152152
+++
153153

154-
**NOTE:** nR_S1 and nR_S2 are the counts of the responses to stimulus 1 (nR_S1) and stimulus 2 (nR_S2) for each confidence level. We can compute this using the function py:func:`metadPy.utils.trials2counts()`.
154+
**NOTE:** nR_S1 and nR_S2 are the counts of the responses to stimulus 1 (nR_S1) and stimulus 2 (nR_S2) for each confidence level. We can compute this using the function py:func:`metadpy.utils.trials2counts()`.
155155

156156
```{code-cell} ipython3
157157
low_noise_nR_S1, low_noise_nR_S2 = trials2counts(data=low_noise_df, nRatings=nRatings)

docs/source/examples/3-Comparison with the hmeta-d toolbox.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"import numpy as np\n",
2525
"import pandas as pd\n",
2626
"import seaborn as sns\n",
27-
"from metadPy.bayesian import hmetad\n",
27+
"from metadpy.bayesian import hmetad\n",
2828
"\n",
2929
"sns.set_context(\"talk\")"
3030
]
@@ -57,7 +57,7 @@
5757
"id": "ZOop3bjebxbZ"
5858
},
5959
"source": [
60-
"## Using metadPy"
60+
"## Using metadpy"
6161
]
6262
},
6363
{
@@ -203,7 +203,7 @@
203203
"az.plot_posterior(traces, var_names=[\"meta_d\"], ax=axs[1])\n",
204204
"\n",
205205
"axs[0].set_ylabel(\"HMeta-d\")\n",
206-
"axs[1].set_ylabel(\"metadPy\")\n",
206+
"axs[1].set_ylabel(\"metadpy\")\n",
207207
"\n",
208208
"plt.tight_layout()"
209209
]

docs/source/examples/3-Comparison with the hmeta-d toolbox.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import matplotlib.pyplot as plt
2626
import numpy as np
2727
import pandas as pd
2828
import seaborn as sns
29-
from metadPy.bayesian import hmetad
29+
from metadpy.bayesian import hmetad
3030
3131
sns.set_context("talk")
3232
```
@@ -45,7 +45,7 @@ nR_S2 = np.array([2, 5, 15, 22, 33, 38, 40, 45])
4545

4646
+++ {"id": "ZOop3bjebxbZ"}
4747

48-
## Using metadPy
48+
## Using metadpy
4949

5050
```{code-cell} ipython3
5151
---
@@ -93,7 +93,7 @@ az.plot_posterior(hmetad_df.meta_d.to_numpy(), ax=axs[0])
9393
az.plot_posterior(traces, var_names=["meta_d"], ax=axs[1])
9494
9595
axs[0].set_ylabel("HMeta-d")
96-
axs[1].set_ylabel("metadPy")
96+
axs[1].set_ylabel("metadpy")
9797
9898
plt.tight_layout()
9999
```

docs/source/examples/Example 1 - Fitting MLE - Subject and group level.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
"import matplotlib.pyplot as plt\n",
2424
"import numpy as np\n",
2525
"import seaborn as sns\n",
26-
"from metadPy import load_dataset\n",
27-
"from metadPy.mle import metad\n",
28-
"from metadPy.plotting import plot_confidence, plot_roc\n",
26+
"from metadpy import load_dataset\n",
27+
"from metadpy.mle import metad\n",
28+
"from metadpy.plotting import plot_confidence, plot_roc\n",
2929
"\n",
3030
"sns.set_context(\"talk\")"
3131
]
@@ -37,9 +37,9 @@
3737
"id": "2oE_wkIxVPbe"
3838
},
3939
"source": [
40-
"In this notebook, we are going to estimate meta-*d'* using Maximum Likelihood Estimation ([MLE](https://en.wikipedia.org/wiki/Maximum_likelihood_estimation)) {cite:p}`fleming:2014,maniscalo:2014,maniscalo:2012` using the function implemented in [metadPy](https://github.com/LegrandNico/metadPy). This function is directly adapted from the transcription of the Matlab `fit_meta_d_MLE.m` by Alan Lee that can be retrieved [here](http://www.columbia.edu/~bsm2105/type2sdt/).\n",
40+
"In this notebook, we are going to estimate meta-*d'* using Maximum Likelihood Estimation ([MLE](https://en.wikipedia.org/wiki/Maximum_likelihood_estimation)) {cite:p}`fleming:2014,maniscalo:2014,maniscalo:2012` using the function implemented in [metadpy](https://github.com/LegrandNico/metadpy). This function is directly adapted from the transcription of the Matlab `fit_meta_d_MLE.m` by Alan Lee that can be retrieved [here](http://www.columbia.edu/~bsm2105/type2sdt/).\n",
4141
"\n",
42-
"We are going to see, however, that [metadPy](https://github.com/LegrandNico/metadPy) greatly simplifies the preprocessing of raw data, letting the user fit the model for many participants/groups/conditions from the results data frame in a single command call. Another advantage here is that the python code supporting the model fitting is optimized using [Numba](http://numba.pydata.org/), which greatly improves its performance."
42+
"We are going to see, however, that [metadpy](https://github.com/LegrandNico/metadpy) greatly simplifies the preprocessing of raw data, letting the user fit the model for many participants/groups/conditions from the results data frame in a single command call. Another advantage here is that the python code supporting the model fitting is optimized using [Numba](http://numba.pydata.org/), which greatly improves its performance."
4343
]
4444
},
4545
{
@@ -114,7 +114,7 @@
114114
"id": "GJFs74YdcqxR"
115115
},
116116
"source": [
117-
"The model is fitted using the `metadPy.mle.metad()` function. This function accepts response-signal arrays as input if the data comes from a single subject."
117+
"The model is fitted using the `metadpy.mle.metad()` function. This function accepts response-signal arrays as input if the data comes from a single subject."
118118
]
119119
},
120120
{
@@ -651,7 +651,7 @@
651651
"Python version : 3.8.8\n",
652652
"IPython version : 8.4.0\n",
653653
"\n",
654-
"metadPy: 0.0.1\n",
654+
"metadpy: 0.0.1\n",
655655
"jax : 0.3.5\n",
656656
"numpyro: not installed\n",
657657
"pymc : 4.3.0\n",
@@ -667,7 +667,7 @@
667667
],
668668
"source": [
669669
"%load_ext watermark\n",
670-
"%watermark -n -u -v -iv -w -p metadPy,jax,numpyro,pymc"
670+
"%watermark -n -u -v -iv -w -p metadpy,jax,numpyro,pymc"
671671
]
672672
},
673673
{

docs/source/examples/Example 1 - Fitting MLE - Subject and group level.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ Author: Nicolas Legrand <nicolas.legrand@cfin.au.dk>
2323
import matplotlib.pyplot as plt
2424
import numpy as np
2525
import seaborn as sns
26-
from metadPy import load_dataset
27-
from metadPy.mle import metad
28-
from metadPy.plotting import plot_confidence, plot_roc
26+
from metadpy import load_dataset
27+
from metadpy.mle import metad
28+
from metadpy.plotting import plot_confidence, plot_roc
2929
3030
sns.set_context("talk")
3131
```
3232

3333
+++ {"id": "2oE_wkIxVPbe"}
3434

35-
In this notebook, we are going to estimate meta-*d'* using Maximum Likelihood Estimation ([MLE](https://en.wikipedia.org/wiki/Maximum_likelihood_estimation)) {cite:p}`fleming:2014,maniscalo:2014,maniscalo:2012` using the function implemented in [metadPy](https://github.com/LegrandNico/metadPy). This function is directly adapted from the transcription of the Matlab `fit_meta_d_MLE.m` by Alan Lee that can be retrieved [here](http://www.columbia.edu/~bsm2105/type2sdt/).
35+
In this notebook, we are going to estimate meta-*d'* using Maximum Likelihood Estimation ([MLE](https://en.wikipedia.org/wiki/Maximum_likelihood_estimation)) {cite:p}`fleming:2014,maniscalo:2014,maniscalo:2012` using the function implemented in [metadpy](https://github.com/LegrandNico/metadpy). This function is directly adapted from the transcription of the Matlab `fit_meta_d_MLE.m` by Alan Lee that can be retrieved [here](http://www.columbia.edu/~bsm2105/type2sdt/).
3636

37-
We are going to see, however, that [metadPy](https://github.com/LegrandNico/metadPy) greatly simplifies the preprocessing of raw data, letting the user fit the model for many participants/groups/conditions from the results data frame in a single command call. Another advantage here is that the python code supporting the model fitting is optimized using [Numba](http://numba.pydata.org/), which greatly improves its performance.
37+
We are going to see, however, that [metadpy](https://github.com/LegrandNico/metadpy) greatly simplifies the preprocessing of raw data, letting the user fit the model for many participants/groups/conditions from the results data frame in a single command call. Another advantage here is that the python code supporting the model fitting is optimized using [Numba](http://numba.pydata.org/), which greatly improves its performance.
3838

3939
+++ {"id": "unable-tattoo"}
4040

@@ -68,7 +68,7 @@ sns.despine()
6868

6969
+++ {"id": "GJFs74YdcqxR"}
7070

71-
The model is fitted using the `metadPy.mle.metad()` function. This function accepts response-signal arrays as input if the data comes from a single subject.
71+
The model is fitted using the `metadpy.mle.metad()` function. This function accepts response-signal arrays as input if the data comes from a single subject.
7272

7373
```{code-cell} ipython3
7474
---
@@ -211,7 +211,7 @@ sns.despine()
211211

212212
```{code-cell} ipython3
213213
%load_ext watermark
214-
%watermark -n -u -v -iv -w -p metadPy,jax,numpyro,pymc
214+
%watermark -n -u -v -iv -w -p metadpy,jax,numpyro,pymc
215215
```
216216

217217
```{code-cell} ipython3

docs/source/examples/Example 2 - Fitting Bayesian - Subject level (pymc).ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"source": [
2323
"import arviz as az\n",
2424
"import numpy as np\n",
25-
"from metadPy.bayesian import hmetad"
25+
"from metadpy.bayesian import hmetad"
2626
]
2727
},
2828
{
@@ -379,7 +379,7 @@
379379
"Python version : 3.8.8\n",
380380
"IPython version : 8.3.0\n",
381381
"\n",
382-
"metadPy: 0.0.1\n",
382+
"metadpy: 0.0.1\n",
383383
"pymc : 4.2.2\n",
384384
"\n",
385385
"numpy: 1.20.1\n",
@@ -392,7 +392,7 @@
392392
],
393393
"source": [
394394
"%load_ext watermark\n",
395-
"%watermark -n -u -v -iv -w -p metadPy,pymc"
395+
"%watermark -n -u -v -iv -w -p metadpy,pymc"
396396
]
397397
},
398398
{

0 commit comments

Comments
 (0)