From 864e8364acd8bda3632e6bc4f40370083d32e829 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Thu, 23 Feb 2023 11:51:48 +0100 Subject: [PATCH 01/43] Add launch buttons and config for Binder --- docs/_config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/_config.yml b/docs/_config.yml index 3feb2d8d..37228c11 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -30,3 +30,7 @@ repository: html: use_issues_button: true use_repository_button: true + +launch_buttons: + notebook_interface: "classic" # The interface interactive links will activate ["classic", "jupyterlab"] + binderhub_url: "https://mybinder.org" \ No newline at end of file From 72b6251e9d338d999f5151364b1715d664347689 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Thu, 23 Feb 2023 11:52:04 +0100 Subject: [PATCH 02/43] For now, use `dev_docs` branch for Binder --- docs/_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_config.yml b/docs/_config.yml index 37228c11..0cce7eef 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -23,7 +23,7 @@ bibtex_bibfiles: repository: url: https://github.com/computational-psychology/stimupy # Online location of your book path_to_book: docs # Optional path to your book, relative to the repository root - branch: main # Which branch of the repository should be used when creating links (optional) + branch: dev_docs # Which branch of the repository should be used when creating links (optional) # Add GitHub buttons to your book # See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository From fbf6b6c6776fcb23c064ba22ae444a74e283577e Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Wed, 22 Feb 2023 11:44:51 +0100 Subject: [PATCH 03/43] Add a general requirements.txt Include docs/requirements.txt --- docs/requirements.txt | 6 ++---- requirements.txt | 7 +++++++ 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 requirements.txt diff --git a/docs/requirements.txt b/docs/requirements.txt index 88abbac9..ceb430a0 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,5 +1,3 @@ jupyter-book -matplotlib -numpy -scipy -pandas \ No newline at end of file +jupytext +jupyterlab_myst \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..8095a5d6 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,7 @@ +numpy +scipy +pandas +Pillow +pytest + +-r docs/requirements.txt \ No newline at end of file From 5c294d6f9d0acd9f3dc2bbc97e75765bf698ae78 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Thu, 23 Feb 2023 11:52:50 +0100 Subject: [PATCH 04/43] Add a binder `postBuild` file Necessary to install `stimupy` itself on Binder after building Docker image before opening Notebook(s) --- postBuild | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 postBuild diff --git a/postBuild b/postBuild new file mode 100644 index 00000000..67924136 --- /dev/null +++ b/postBuild @@ -0,0 +1,4 @@ +#!/bin/bash +set -e # don't allow errors to fail silently +echo `which pip` # in case the wrong `pip` is used, this will let us debug +pip install -e . # install the custom library \ No newline at end of file From d687715336427d82030dbe6fd4190c3b47d36803 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Thu, 23 Feb 2023 11:49:12 +0100 Subject: [PATCH 05/43] Configure intersphinx --- docs/_config.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/docs/_config.yml b/docs/_config.yml index 0cce7eef..2750c22e 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -33,4 +33,25 @@ html: launch_buttons: notebook_interface: "classic" # The interface interactive links will activate ["classic", "jupyterlab"] - binderhub_url: "https://mybinder.org" \ No newline at end of file + binderhub_url: "https://mybinder.org" + +sphinx: + extra_extensions: + - sphinx.ext.intersphinx + config: + intersphinx_mapping: + numpy [stable]: + - 'https://numpy.org/doc/stable/' + - null + matplotlib [stable]: + - 'https://matplotlib.org/stable/' + - null + pandas [latest?]: + - 'https://pandas.pydata.org/docs/' + - null + scipy [latest]: + - 'https://docs.scipy.org/doc/scipy/' + - null + pillow [latest]: + - 'https://pillow.readthedocs.io/en/latest/' + - null \ No newline at end of file From ad85f814839d285ada06aabdd8dc90f6844d53bf Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Wed, 22 Feb 2023 21:06:15 +0100 Subject: [PATCH 06/43] Update installation pip from GitHub Use the "zipball" method, to avoid problems if a user doesn't have git installed --- docs/getting_started/installation.md | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/docs/getting_started/installation.md b/docs/getting_started/installation.md index 6e7262bb..188bb487 100644 --- a/docs/getting_started/installation.md +++ b/docs/getting_started/installation.md @@ -9,20 +9,38 @@ ```python pip install stimupy ``` +For now, `pip` can install directly from GitHub (the `main` branch) -For now, could do: +```python +pip install https://github.com/computational-psychology/stimupy/zipball/main +``` + +:::{admonition} Install a different version + :class: dropdown + +From a specific branch, e.g. (`main`)[https://github.com/computational-psychology/stimupy/tree/main]: +```python +pip install https://github.com/computational-psychology/stimupy/archive/refs/heads/main.zip +``` +From a specific tag, e.g. `v1.0.0`: ```python -pip install 'stimupy @ https://github.com/computational-psychology/stimupy' +pip install https://github.com/computational-psychology/stimupy/archive/tags/v1.0.0.zip ``` +From a specific commit, e.g., (`9e37617`)[https://github.com/computational-psychology/stimupy/tree/9e37617]: +```python +pip install https://github.com/computational-psychology/stimupy/archive/9e37617.zip +``` +::: :::: -::::{tab-item} conda-forge +::::{tab-item} conda Surely this must also be possible... :::: -::::{tab-item} source (GitHub) {fab}`github` + +::::{tab-item} source {fab}`github` 1. Clone the repository from GitHub: @@ -51,6 +69,7 @@ this makes changes to files immediately usable, rather than having to reinstall the package after every change. ::: :::: + ::::: From 43057ea842fa1d590d0fbb256e62b0765f6c39c5 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Thu, 23 Feb 2023 11:49:21 +0100 Subject: [PATCH 07/43] Use intersphinx on installation page --- docs/getting_started/installation.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/getting_started/installation.md b/docs/getting_started/installation.md index 188bb487..cbcc7eef 100644 --- a/docs/getting_started/installation.md +++ b/docs/getting_started/installation.md @@ -76,8 +76,8 @@ rather than having to reinstall the package after every change. ## Dependencies Dependencies should be automatically installed (at least using `pip`). `stimupy`s required dependencies are: -- numpy -- scipy -- matplotlib -- Pillow -- pandas \ No newline at end of file +- [NumPy](numpy) +- [SciPy](scipy) +- [MatPlotLib](matplotlib) +- [Pillow](pillow) +- [Pandas](pandas) \ No newline at end of file From 6cd9b62b2263a01d76abf45b50738e9c3affc30f Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Thu, 9 Mar 2023 13:34:23 +0100 Subject: [PATCH 08/43] Build RTD docs using python3.11 --- .readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 9c1029bb..15641c18 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.8" + python: "3.11" jobs: pre_build: # Generate the Sphinx configuration for this Jupyter Book so it builds. From 5a31ec6a013c9ef0fb9314cbb8c99a4d2db80807 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Tue, 7 Mar 2023 13:55:22 +0100 Subject: [PATCH 09/43] Suppress warning about 'toctree directive not expected when using etoc' --- docs/_config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/_config.yml b/docs/_config.yml index 2750c22e..b59f569c 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -54,4 +54,5 @@ sphinx: - null pillow [latest]: - 'https://pillow.readthedocs.io/en/latest/' - - null \ No newline at end of file + - null + suppress_warnings: ["etoc.toctree"] \ No newline at end of file From 5f2b51ab50a5920d95446d7583bf7eeb526bb19d Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Tue, 7 Mar 2023 18:05:36 +0100 Subject: [PATCH 10/43] Landing page for API reference Link to API ref from index --- docs/_toc.yml | 3 +++ docs/index.md | 3 ++- docs/reference/api.md | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 docs/reference/api.md diff --git a/docs/_toc.yml b/docs/_toc.yml index 74c9902a..040fb9e3 100644 --- a/docs/_toc.yml +++ b/docs/_toc.yml @@ -16,6 +16,9 @@ parts: - file: topic_guides/dimensions - file: topic_guides/gratings - file: topic_guides/visual_noise + - caption: Reference + chapters: + - file: reference/api.md - caption: Contributing chapters: - file: contributing/contribute diff --git a/docs/index.md b/docs/index.md index dbe94b60..aedd6b64 100644 --- a/docs/index.md +++ b/docs/index.md @@ -16,7 +16,8 @@ Welcome to `stimupy` ::: :::{grid-item-card} Reference 📑 - +:link: reference/api +:link-type: doc ::: :::{grid-item-card} Contribute 🎁 diff --git a/docs/reference/api.md b/docs/reference/api.md new file mode 100644 index 00000000..7069e63e --- /dev/null +++ b/docs/reference/api.md @@ -0,0 +1 @@ +# `stimupy` API From 12850418d7254a1971e70af81c13da0e3e63361b Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Thu, 9 Mar 2023 14:14:24 +0100 Subject: [PATCH 11/43] Autosummary generates documentation for modules As well as "summary" tables of members --- docs/_config.yml | 4 ++++ docs/reference/api.md | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/docs/_config.yml b/docs/_config.yml index b59f569c..31e68b25 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -38,7 +38,11 @@ launch_buttons: sphinx: extra_extensions: - sphinx.ext.intersphinx + - sphinx.ext.autosummary # generate summary tables of functions in modules + config: + autosummary_generate: True # Actually use sphinx.ext.autosummary + add_module_names: False # Don't include module names in autosummary tables intersphinx_mapping: numpy [stable]: - 'https://numpy.org/doc/stable/' diff --git a/docs/reference/api.md b/docs/reference/api.md index 7069e63e..064fd024 100644 --- a/docs/reference/api.md +++ b/docs/reference/api.md @@ -1 +1,12 @@ # `stimupy` API +```{eval-rst} +.. autosummary:: + :toctree: _api + :recursive: + + stimupy.components + stimupy.illusions + stimupy.noises + stimupy.utils + stimupy.papers +``` \ No newline at end of file From 5b9d444148c6e1eae0e0110a235af49fc815dd13 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Tue, 7 Mar 2023 13:55:40 +0100 Subject: [PATCH 12/43] Ignore generate _api docs --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 7a982c7f..98989ca9 100644 --- a/.gitignore +++ b/.gitignore @@ -65,3 +65,5 @@ target/ **/.ipynb_checkpoints/ **/.ipynb_checkpoints/ + +docs/reference/_api/ From dbda8ccd248b0bed0c1dcfd65905bd40ee3912f5 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Fri, 24 Feb 2023 20:08:44 +0100 Subject: [PATCH 13/43] Recognize NumPy docstrings `napoleon` Sphinx extension can auto-translate NumPy (and Google) style docstrings to standard `autodoc`-docstrings --- docs/_config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/_config.yml b/docs/_config.yml index 31e68b25..3aa78cbf 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -39,6 +39,7 @@ sphinx: extra_extensions: - sphinx.ext.intersphinx - sphinx.ext.autosummary # generate summary tables of functions in modules + - sphinx.ext.napoleon # recognize NumPy style docstrings config: autosummary_generate: True # Actually use sphinx.ext.autosummary From c90b44aef4f997243130393525bdb35165ca8528 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Fri, 24 Feb 2023 18:39:29 +0100 Subject: [PATCH 14/43] Comment-out autosummary_generate This option controls whether `autosummary` generates the stub `.rst`-files based on the `autosummary::` directive. This is `true` by default. --- docs/_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_config.yml b/docs/_config.yml index 3aa78cbf..c57e264f 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -42,7 +42,7 @@ sphinx: - sphinx.ext.napoleon # recognize NumPy style docstrings config: - autosummary_generate: True # Actually use sphinx.ext.autosummary + #autosummary_generate: True # autosummary generates module-level .rst files? add_module_names: False # Don't include module names in autosummary tables intersphinx_mapping: numpy [stable]: From 7b87fe74b7a9e2956237eab413cf40d88c584ba4 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Fri, 24 Feb 2023 18:45:57 +0100 Subject: [PATCH 15/43] Autodocument `members` --- docs/_config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/_config.yml b/docs/_config.yml index c57e264f..5f5b26e2 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -44,6 +44,10 @@ sphinx: config: #autosummary_generate: True # autosummary generates module-level .rst files? add_module_names: False # Don't include module names in autosummary tables + autodoc_default_options: { + "members": True, # Include module/class members. + "member-order": 'bysource', # Order members as in source file. + } intersphinx_mapping: numpy [stable]: - 'https://numpy.org/doc/stable/' From 129d298e11fcc28454d52c3195d667dcf194b27c Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Fri, 24 Feb 2023 18:47:48 +0100 Subject: [PATCH 16/43] Also document imported members e.g., shapes.disc (imported from circular.disc) --- docs/_config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/_config.yml b/docs/_config.yml index 5f5b26e2..55713ec8 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -44,6 +44,7 @@ sphinx: config: #autosummary_generate: True # autosummary generates module-level .rst files? add_module_names: False # Don't include module names in autosummary tables + autosummary_imported_members: True autodoc_default_options: { "members": True, # Include module/class members. "member-order": 'bysource', # Order members as in source file. From 0d2c040daaf0a3c53a354f92bb37079e74cb455c Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Fri, 24 Feb 2023 18:49:34 +0100 Subject: [PATCH 17/43] Autodoc should respect `__all__`-attributes --- docs/_config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/_config.yml b/docs/_config.yml index 55713ec8..5bcb8da1 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -45,6 +45,7 @@ sphinx: #autosummary_generate: True # autosummary generates module-level .rst files? add_module_names: False # Don't include module names in autosummary tables autosummary_imported_members: True + autosummary_ignore_module_all: False autodoc_default_options: { "members": True, # Include module/class members. "member-order": 'bysource', # Order members as in source file. From aa59fbd47da3883c3c8e5d5b44e6254ce2862de6 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Fri, 24 Feb 2023 20:09:37 +0100 Subject: [PATCH 18/43] Autoinclude source-code in build HTMLs (and link from API reference) --- docs/_config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/_config.yml b/docs/_config.yml index 5bcb8da1..7167bfd7 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -40,6 +40,7 @@ sphinx: - sphinx.ext.intersphinx - sphinx.ext.autosummary # generate summary tables of functions in modules - sphinx.ext.napoleon # recognize NumPy style docstrings + - sphinx.ext.viewcode # add links to source code in API reference config: #autosummary_generate: True # autosummary generates module-level .rst files? From 63bdb5b3a3d2e9cf4bc40e3bfc0149bc673c4565 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Tue, 28 Feb 2023 11:29:57 +0100 Subject: [PATCH 19/43] Use custom template for API reference This requires the config `templates_path` to be set, in order to find the template(s). Unforunately, this seems to overwrite where the theme cannot find its templates anymore. We can get around this for now by fixing some older versions of sphinx-book-theme and pydata-sphinx-theme --- docs/_config.yml | 2 + docs/_templates/autosummary/module.rst | 64 ++++++++++++++++++++++++++ docs/requirements.txt | 3 ++ 3 files changed, 69 insertions(+) create mode 100644 docs/_templates/autosummary/module.rst diff --git a/docs/_config.yml b/docs/_config.yml index 7167bfd7..4c63039b 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -51,6 +51,8 @@ sphinx: "members": True, # Include module/class members. "member-order": 'bysource', # Order members as in source file. } + templates_path: ['_templates'] # Path(s) that contain templates, relative to this config + exclude_patterns: ['_build', '_templates'] intersphinx_mapping: numpy [stable]: - 'https://numpy.org/doc/stable/' diff --git a/docs/_templates/autosummary/module.rst b/docs/_templates/autosummary/module.rst new file mode 100644 index 00000000..8b32a03e --- /dev/null +++ b/docs/_templates/autosummary/module.rst @@ -0,0 +1,64 @@ +{{ fullname | escape | underline}} + +.. automodule:: {{ fullname }} + + {% block attributes %} + {% if attributes %} + .. rubric:: {{ _('Module attributes') }} + + .. autosummary:: + {% for item in attributes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block modules %} + {% if modules %} + .. rubric:: {{ _('Modules') }} + + .. autosummary:: + :toctree: + :recursive: + {% for item in modules %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block functions %} + {% if functions %} + .. rubric:: {{ _('Functions') }} + + .. autosummary:: + :nosignatures: + {% for item in functions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block classes %} + {% if classes %} + .. rubric:: {{ _('Classes') }} + + .. autosummary:: + :toctree: + :nosignatures: + {% for item in classes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block exceptions %} + {% if exceptions %} + .. rubric:: {{ _('Exceptions') }} + + .. autosummary:: + :toctree: + {% for item in exceptions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} diff --git a/docs/requirements.txt b/docs/requirements.txt index ceb430a0..c4d4ac92 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,6 @@ +sphinx<6>4 +pydata-sphinx-theme<0.9 jupyter-book +sphinx_book_theme<1.0.0 jupytext jupyterlab_myst \ No newline at end of file From 44b781400cc1f45405a482fe8a1534a18e9e63e5 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Tue, 7 Mar 2023 13:54:28 +0100 Subject: [PATCH 20/43] Use separate templates for different modules Components, illusions have demos -- utils & papers do not --- docs/_templates/autosummary/components.rst | 75 ++++++++++++++++++++++ docs/_templates/autosummary/illusions.rst | 74 +++++++++++++++++++++ docs/_templates/autosummary/module.rst | 42 ++++++------ docs/_templates/autosummary/noises.rst | 75 ++++++++++++++++++++++ docs/_templates/autosummary/papers.rst | 71 ++++++++++++++++++++ docs/_templates/autosummary/utils.rst | 70 ++++++++++++++++++++ 6 files changed, 389 insertions(+), 18 deletions(-) create mode 100644 docs/_templates/autosummary/components.rst create mode 100644 docs/_templates/autosummary/illusions.rst create mode 100644 docs/_templates/autosummary/noises.rst create mode 100644 docs/_templates/autosummary/papers.rst create mode 100644 docs/_templates/autosummary/utils.rst diff --git a/docs/_templates/autosummary/components.rst b/docs/_templates/autosummary/components.rst new file mode 100644 index 00000000..e3349e23 --- /dev/null +++ b/docs/_templates/autosummary/components.rst @@ -0,0 +1,75 @@ +{{ fullname | escape | underline}} + +.. automodule:: {{ fullname }} + + {% block attributes %} + {% if attributes %} + Module attributes + ----------------- + + .. autosummary:: + {% for item in attributes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block modules %} + {% if modules %} + Modules + ------- + + .. autosummary:: + :toctree: {{ name }} + :recursive: + {% for item in modules %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + + {% block classes %} + {% if classes %} + Classes + ------- + + .. autosummary:: + :toctree: {{ name }} + :nosignatures: + {% for item in classes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block exceptions %} + {% if exceptions %} + Exceptions + ---------- + + .. autosummary:: + :toctree: + {% for item in exceptions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block functions %} + {% if functions %} + :doc:`Demos <../../demos/components/{{name}}>` + ------------------------------------------------------------------------------ + + + Functions + --------- + + .. autosummary:: + :nosignatures: + {% for item in functions %} + {{ item }} + {%- endfor %} + + {% endif %} + {% endblock %} \ No newline at end of file diff --git a/docs/_templates/autosummary/illusions.rst b/docs/_templates/autosummary/illusions.rst new file mode 100644 index 00000000..e2d79e42 --- /dev/null +++ b/docs/_templates/autosummary/illusions.rst @@ -0,0 +1,74 @@ +{{ fullname | escape | underline}} + +.. automodule:: {{ fullname }} + + {% block attributes %} + {% if attributes %} + Module attributes + ----------------- + + .. autosummary:: + {% for item in attributes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block modules %} + {% if modules %} + Modules + ------- + + .. autosummary:: + :toctree: {{ name }} + :recursive: + {% for item in modules %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + + {% block classes %} + {% if classes %} + Classes + ------- + + .. autosummary:: + :toctree: {{ name }} + :nosignatures: + {% for item in classes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block exceptions %} + {% if exceptions %} + Exceptions + ---------- + + .. autosummary:: + :toctree: + {% for item in exceptions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block functions %} + {% if functions %} + :doc:`Demos <../../demos/illusions/{{name}}>` + ------------------------------------------------------------------------------ + + Functions + --------- + + .. autosummary:: + :nosignatures: + {% for item in functions %} + {{ item }} + {%- endfor %} + + {% endif %} + {% endblock %} \ No newline at end of file diff --git a/docs/_templates/autosummary/module.rst b/docs/_templates/autosummary/module.rst index 8b32a03e..1963e565 100644 --- a/docs/_templates/autosummary/module.rst +++ b/docs/_templates/autosummary/module.rst @@ -4,7 +4,8 @@ {% block attributes %} {% if attributes %} - .. rubric:: {{ _('Module attributes') }} + Module attributes + ----------------- .. autosummary:: {% for item in attributes %} @@ -15,10 +16,12 @@ {% block modules %} {% if modules %} - .. rubric:: {{ _('Modules') }} + Modules + ------- .. autosummary:: - :toctree: + :toctree: {{ name }} + :template: autosummary/{{ name }}.rst :recursive: {% for item in modules %} {{ item }} @@ -26,24 +29,14 @@ {% endif %} {% endblock %} - {% block functions %} - {% if functions %} - .. rubric:: {{ _('Functions') }} - - .. autosummary:: - :nosignatures: - {% for item in functions %} - {{ item }} - {%- endfor %} - {% endif %} - {% endblock %} {% block classes %} {% if classes %} - .. rubric:: {{ _('Classes') }} + Classes + ------- .. autosummary:: - :toctree: + :toctree: {{ name }} :nosignatures: {% for item in classes %} {{ item }} @@ -53,12 +46,25 @@ {% block exceptions %} {% if exceptions %} - .. rubric:: {{ _('Exceptions') }} + Exceptions + ---------- .. autosummary:: - :toctree: {% for item in exceptions %} {{ item }} {%- endfor %} {% endif %} {% endblock %} + + {% block functions %} + {% if functions %} + Functions + --------- + + .. autosummary:: + :nosignatures: + {% for item in functions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} \ No newline at end of file diff --git a/docs/_templates/autosummary/noises.rst b/docs/_templates/autosummary/noises.rst new file mode 100644 index 00000000..5efa1a5b --- /dev/null +++ b/docs/_templates/autosummary/noises.rst @@ -0,0 +1,75 @@ +{{ fullname | escape | underline}} + +.. automodule:: {{ fullname }} + + {% block attributes %} + {% if attributes %} + Module attributes + ----------------- + + .. autosummary:: + {% for item in attributes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block modules %} + {% if modules %} + Modules + ------- + + .. autosummary:: + :toctree: {{ name }} + :recursive: + {% for item in modules %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + + {% block classes %} + {% if classes %} + Classes + ------- + + .. autosummary:: + :toctree: {{ name }} + :nosignatures: + {% for item in classes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block exceptions %} + {% if exceptions %} + Exceptions + ---------- + + .. autosummary:: + :toctree: + {% for item in exceptions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block functions %} + {% if functions %} + Demos + ----- + :doc:`reference/demos/components/{{name}}` + + Functions + --------- + + .. autosummary:: + :nosignatures: + {% for item in functions %} + {{ item }} + {%- endfor %} + + {% endif %} + {% endblock %} \ No newline at end of file diff --git a/docs/_templates/autosummary/papers.rst b/docs/_templates/autosummary/papers.rst new file mode 100644 index 00000000..08842835 --- /dev/null +++ b/docs/_templates/autosummary/papers.rst @@ -0,0 +1,71 @@ +{{ fullname | escape | underline}} + +.. automodule:: {{ fullname }} + + {% block attributes %} + {% if attributes %} + Module attributes + ----------------- + + .. autosummary:: + {% for item in attributes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block modules %} + {% if modules %} + Modules + ------- + + .. autosummary:: + :toctree: {{ name }} + :recursive: + {% for item in modules %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + + {% block classes %} + {% if classes %} + Classes + ------- + + .. autosummary:: + :toctree: {{ name }} + :nosignatures: + {% for item in classes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block exceptions %} + {% if exceptions %} + Exceptions + ---------- + + .. autosummary:: + :toctree: + {% for item in exceptions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block functions %} + {% if functions %} + Functions + --------- + + .. autosummary:: + :nosignatures: + {% for item in functions %} + {{ item }} + {%- endfor %} + + {% endif %} + {% endblock %} \ No newline at end of file diff --git a/docs/_templates/autosummary/utils.rst b/docs/_templates/autosummary/utils.rst new file mode 100644 index 00000000..269ad4f8 --- /dev/null +++ b/docs/_templates/autosummary/utils.rst @@ -0,0 +1,70 @@ +{{ fullname | escape | underline}} + +.. automodule:: {{ fullname }} + + {% block attributes %} + {% if attributes %} + Module attributes + ----------------- + + .. autosummary:: + {% for item in attributes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block modules %} + {% if modules %} + Modules + ------- + + .. autosummary:: + :toctree: {{ name }} + :recursive: + {% for item in modules %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + + {% block classes %} + {% if classes %} + Classes + ------- + + .. autosummary:: + :nosignatures: + {% for item in classes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block exceptions %} + {% if exceptions %} + Exceptions + ---------- + + .. autosummary:: + :toctree: + {% for item in exceptions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block functions %} + {% if functions %} + Functions + --------- + + .. autosummary:: + :nosignatures: + {% for item in functions %} + {{ item }} + {%- endfor %} + + {% endif %} + {% endblock %} \ No newline at end of file From a1e6234ca0d9980a743cf8146a1e59b460b00256 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Thu, 9 Mar 2023 13:59:49 +0100 Subject: [PATCH 21/43] Add demo basic shapes --- docs/_toc.yml | 1 + docs/reference/demos.md | 6 + docs/reference/demos/components/shapes.md | 288 ++++++++++++++++++++++ docs/requirements.txt | 3 +- 4 files changed, 297 insertions(+), 1 deletion(-) create mode 100644 docs/reference/demos.md create mode 100644 docs/reference/demos/components/shapes.md diff --git a/docs/_toc.yml b/docs/_toc.yml index 040fb9e3..c0c16b4f 100644 --- a/docs/_toc.yml +++ b/docs/_toc.yml @@ -19,6 +19,7 @@ parts: - caption: Reference chapters: - file: reference/api.md + - file: reference/demos.md - caption: Contributing chapters: - file: contributing/contribute diff --git a/docs/reference/demos.md b/docs/reference/demos.md new file mode 100644 index 00000000..84729aed --- /dev/null +++ b/docs/reference/demos.md @@ -0,0 +1,6 @@ +# Demos of parameters + +```{toctree} +:glob: +demos/*/* +``` \ No newline at end of file diff --git a/docs/reference/demos/components/shapes.md b/docs/reference/demos/components/shapes.md new file mode 100644 index 00000000..674b7071 --- /dev/null +++ b/docs/reference/demos/components/shapes.md @@ -0,0 +1,288 @@ +--- +jupytext: + formats: md:myst + text_representation: + extension: .md + format_name: myst +kernelspec: + display_name: Python 3 + language: python + name: python3 +--- + +```{important} +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/computational-psychology/stimupy/dev_docs?urlpath=tree/docs/reference/demos/components/shapes.md) + to get interactivity +``` + +# Basic shapes +{py:mod}`stimupy.components.shapes` +```{code-cell} +:tags: [remove-cell] +import IPython +import ipywidgets as iw +from stimupy.utils import plot_stim +``` + +## Rectangle +{py:func}`stimupy.components.shapes.rectangle` +```{code-cell} +:tags: [hide-input] +from stimupy.components.shapes import rectangle + +# Define widgets +w_height = iw.IntSlider(value=4, min=1, max=10, description="height [deg]") +w_width = iw.IntSlider(value=4, min=1, max=10, description="width [deg]") +w_ppd = iw.IntSlider(value=32, min=1, max=64, description="ppd") +w_rot = iw.IntSlider(value=0, min=0, max=360, description="rotation [deg]") + + +w_rect_height = iw.IntSlider(value=2, min=1, max=10, description="height [deg]") +w_rect_width = iw.IntSlider(value=2, min=1, max=10, description="width [deg]") + +w_rect_posx = iw.FloatSlider(value=0.0, min=-5.0, max=5.0, description="horz. position") +w_rect_posy = iw.FloatSlider(value=0.0, min=-5.0, max=5.0, description="vert. position") + +w_intensities = iw.FloatRangeSlider(value=[0.0, 1.0], min=0.0, max=1.0, step=0.1, description="intensities") + +# Layout +b_im_size = iw.HBox([w_height, w_width, w_ppd, w_rot]) +b_rect_size = iw.HBox([w_rect_height, w_rect_width]) +b_post = iw.HBox([w_rect_posx, w_rect_posy]) +b_intensities = iw.HBox([w_intensities]) +ui = iw.VBox([b_im_size, b_rect_size, b_post, b_intensities]) + +# Function for showing stim +def show_rect( + height=None, + width=None, + ppd=None, + rect_height=None, + rect_width=None, + pos_x=0.0, + pos_y=0.0, + orientation='horizontal', + intensities=(0.0, 1.0) +): + stim = rectangle( + visual_size=(height, width), + ppd=ppd, + rectangle_size=(rect_height, rect_width), + rectangle_position=(pos_y, pos_x), + intensity_rectangle=intensities[1], + intensity_background=intensities[0] + ) + plot_stim(stim, mask=False) + +# Set interactivity +out = iw.interactive_output( + show_rect, + { + "height": w_height, + "width": w_width, + "ppd": w_ppd, + "rect_height": w_rect_height, + "rect_width": w_rect_width, + "pos_x": w_rect_posx, + "pos_y": w_rect_posy, + "intensities": w_intensities, + }, +) + +# Show +display(ui, out) +``` + +## Triangle +{py:func}`stimupy.components.shapes.triangle` +```{code-cell} +:tags: [hide-input] +from stimupy.components.shapes import triangle + +# Define widgets +w_height = iw.IntSlider(value=4, min=1, max=10, description="height [deg]") +w_width = iw.IntSlider(value=4, min=1, max=10, description="width [deg]") +w_ppd = iw.IntSlider(value=32, min=1, max=64, description="ppd") +w_rot = iw.IntSlider(value=0, min=0, max=360, description="rotation [deg]") + +w_t_height = iw.IntSlider(value=4, min=1, max=10, description="triangle height [deg]") +w_t_width = iw.IntSlider(value=4, min=1, max=10, description="triangle width [deg]") + +w_intensities = iw.FloatRangeSlider(value=[0.0, 1.0], min=0.0, max=1.0, step=0.1, description="intensities") + +# Layout +b_im_size = iw.HBox([w_height, w_width, w_ppd, w_rot]) +b_geometry = iw.HBox([w_t_height, w_t_width]) +b_intensities = iw.HBox([w_intensities]) +ui = iw.VBox([b_im_size, b_intensities]) + +# Function for showing stim +def show_triangle( + height=None, + width=None, + ppd=None, + rotation=0, + triangle_height=None, + triangle_width=None, + intensities=(0.0, 1.0) +): + stim = triangle( + visual_size=(height, width), + ppd=ppd, + rotation=rotation, + triangle_size=(triangle_height, triangle_width), + intensity_triangle=intensities[1], + intensity_background=intensities[0] + ) + plot_stim(stim, mask=False) + +# Set interactivity +out = iw.interactive_output( + show_triangle, + { + "height": w_height, + "width": w_width, + "ppd": w_ppd, + "rotation": w_rot, + "triangle_height": w_t_height, + "triangle_width": w_t_width, + "intensities": w_intensities, + }, +) + +# Show +display(ui, out) +``` + +## Cross +{py:func}`stimupy.components.shapes.cross` +```{code-cell} +:tags: [hide-input] +from stimupy.components.shapes import cross + +# Define widgets +w_height = iw.IntSlider(value=4.0, min=1, max=10, description="heigh [deg]") +w_width = iw.IntSlider(value=4.0, min=1, max=10, description="width [deg]") +w_ppd = iw.IntSlider(value=32, min=1, max=64, description="ppd") +w_rot = iw.IntSlider(value=0, min=0, max=360, description="rotation [deg]") + +w_c_height = iw.IntSlider(value=4, min=1, max=10, description="cross height [deg]") +w_c_width = iw.IntSlider(value=4, min=1, max=10, description="cross width [deg]") +w_cross_thick = iw.FloatSlider(value=0.5, min=0.0, max=5.0, description="thickness [deg]") +w_cross_ratio = iw.FloatSlider(value=1.0, min=0.0, max=5.0, description="horz. arm ratio") + +w_intensities = iw.FloatRangeSlider(value=[0.0, 1.0], min=0.0, max=1.0, step=0.1, description="intensities") + +# Layout +b_im_size = iw.HBox([w_height, w_width, w_ppd, w_rot]) +b_geometry = iw.HBox([w_c_height, w_c_width, w_cross_thick, w_cross_ratio]) +b_intensities = iw.HBox([w_intensities]) +ui = iw.VBox([b_im_size, b_geometry, b_intensities]) + +# Function for showing stim +def show_cross( + height=None, + width=None, + ppd=None, + rotation=0, + cross_height=None, + cross_width=None, + thickness=None, + ratio=1.0, + intensities=(0.0, 1.0) +): + stim = cross( + visual_size=(height, width), + ppd=ppd, + rotation=rotation, + cross_size=(cross_height, cross_width), + cross_thickness=thickness, + cross_arm_ratios=(ratio, ratio), + intensity_cross=intensities[1], + intensity_background=intensities[0] + ) + plot_stim(stim, mask=False) + +# Set interactivity +out = iw.interactive_output( + show_cross, + { + "height": w_height, + "width": w_width, + "ppd": w_ppd, + "rotation": w_rot, + "cross_height": w_c_height, + "cross_width": w_c_width, + "thickness": w_cross_thick, + "ratio": w_cross_ratio, + "intensities": w_intensities, + }, +) + +# Show +display(ui, out) +``` + +## Parallelogram +{py:func}`stimupy.components.shapes.parallelogram` +```{code-cell} +:tags: [hide-input] +from stimupy.components.shapes import parallelogram + +# Define widgets +w_height = iw.IntSlider(value=5, min=1, max=10, description="heigh [deg]") +w_width = iw.IntSlider(value=5, min=1, max=10, description="width [deg]") +w_ppd = iw.IntSlider(value=32, min=1, max=64, description="ppd") +w_rot = iw.IntSlider(value=0, min=0, max=360, description="rotation [deg]") + +w_p_height = iw.IntSlider(value=2, min=1, max=10, description="cross height [deg]") +w_p_width = iw.IntSlider(value=2, min=1, max=10, description="cross width [deg]") +w_p_depth = iw.FloatSlider(value=2.0, min=-3.0, max=3.0, description="depth [deg]") + +w_intensities = iw.FloatRangeSlider(value=[0.0, 1.0], min=0.0, max=1.0, step=0.1, description="intensities") + +# Layout +b_im_size = iw.HBox([w_height, w_width, w_ppd, w_rot]) +b_geometry = iw.HBox([w_p_height, w_p_width, w_p_depth]) +b_intensities = iw.HBox([w_intensities]) +ui = iw.VBox([b_im_size, b_geometry, b_intensities]) + +# Function for showing stim +def show_parallelogram( + height=None, + width=None, + ppd=None, + rotation=0, + p_height=None, + p_width=None, + p_depth=None, + intensities=(0.0, 1.0) +): + stim = parallelogram( + visual_size=(height, width), + ppd=ppd, + rotation=rotation, + parallelogram_size=(p_height, p_width, p_depth), + intensity_parallelogram=intensities[1], + intensity_background=intensities[0] + ) + plot_stim(stim, mask=False) + +# Set interactivity +out = iw.interactive_output( + show_parallelogram, + { + "height": w_height, + "width": w_width, + "ppd": w_ppd, + "rotation": w_rot, + "p_height": w_p_height, + "p_width": w_p_width, + "p_depth": w_p_depth, + "intensities": w_intensities, + }, +) + +# Show +display(ui, out) +``` \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt index c4d4ac92..98897121 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -3,4 +3,5 @@ pydata-sphinx-theme<0.9 jupyter-book sphinx_book_theme<1.0.0 jupytext -jupyterlab_myst \ No newline at end of file +jupyterlab_myst +ipywidgets \ No newline at end of file From 0ecefc336cb85d8fe0cfafdf3c6d350ba950bf3a Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Mon, 13 Mar 2023 14:34:19 +0100 Subject: [PATCH 22/43] Fall back to earlier version of jupyter-book --- docs/requirements.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 98897121..eef51363 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,7 +1,4 @@ -sphinx<6>4 -pydata-sphinx-theme<0.9 -jupyter-book -sphinx_book_theme<1.0.0 +jupyter-book==0.14 jupytext jupyterlab_myst ipywidgets \ No newline at end of file From eb3d7185c6e9be3c703b0a41b2dc71232ca141cb Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Tue, 14 Mar 2023 15:20:18 +0100 Subject: [PATCH 23/43] Use JupyterLab interface on Binder --- docs/_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_config.yml b/docs/_config.yml index 4c63039b..0497a38c 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -32,7 +32,7 @@ html: use_repository_button: true launch_buttons: - notebook_interface: "classic" # The interface interactive links will activate ["classic", "jupyterlab"] + notebook_interface: "jupyterlab" # The interface interactive links will activate ["classic", "jupyterlab"] binderhub_url: "https://mybinder.org" sphinx: From f415243a3814a142c87a60fe8968ac81e28cbe7e Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Tue, 14 Mar 2023 15:20:56 +0100 Subject: [PATCH 24/43] Install & enable JupyText on Binder --- docs/requirements.txt | 2 +- postBuild | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index eef51363..8e236ac6 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1,4 @@ jupyter-book==0.14 -jupytext +jupytext>=1.13.3 jupyterlab_myst ipywidgets \ No newline at end of file diff --git a/postBuild b/postBuild index 67924136..77c6d6ed 100644 --- a/postBuild +++ b/postBuild @@ -1,4 +1,13 @@ #!/bin/bash set -e # don't allow errors to fail silently echo `which pip` # in case the wrong `pip` is used, this will let us debug -pip install -e . # install the custom library \ No newline at end of file + +# Install and enable extensions... +pip install "jupytext[myst]>=1.13.3" +jupyter nbextension install --py jupytext --user +jupyter nbextension enable --py jupytext --user +jupyter lab build +jupyter serverextension enable jupytext + +# Install stimupy +pip install -e . From f52bf29786af6c3e82c12e169a96d63055c8efd3 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Tue, 14 Mar 2023 15:26:07 +0100 Subject: [PATCH 25/43] Override default viewer on Binder to open MySTs as JupyText Notebooks --- binder/labconfig/default_setting_overrides.json | 8 ++++++++ postBuild => binder/postBuild | 4 ++++ 2 files changed, 12 insertions(+) create mode 100644 binder/labconfig/default_setting_overrides.json rename postBuild => binder/postBuild (71%) diff --git a/binder/labconfig/default_setting_overrides.json b/binder/labconfig/default_setting_overrides.json new file mode 100644 index 00000000..e4b5cc12 --- /dev/null +++ b/binder/labconfig/default_setting_overrides.json @@ -0,0 +1,8 @@ +{ + "@jupyterlab/docmanager-extension:plugin": { + "defaultViewers": { + "markdown": "Jupytext Notebook", + "myst": "Jupytext Notebook" + } + } +} \ No newline at end of file diff --git a/postBuild b/binder/postBuild similarity index 71% rename from postBuild rename to binder/postBuild index 77c6d6ed..3850a7d3 100644 --- a/postBuild +++ b/binder/postBuild @@ -2,6 +2,10 @@ set -e # don't allow errors to fail silently echo `which pip` # in case the wrong `pip` is used, this will let us debug +# See https://github.com/mwouts/jupytext/issues/803#issuecomment-982170660 +mkdir -p ${HOME}/.jupyter/labconfig +cp binder/labconfig/* ${HOME}/.jupyter/labconfig + # Install and enable extensions... pip install "jupytext[myst]>=1.13.3" jupyter nbextension install --py jupytext --user From 111b3d1fcd32dec07eaddf1e1ae41044b128a6d7 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Tue, 14 Mar 2023 15:37:44 +0100 Subject: [PATCH 26/43] Add MystNB to requirements to enable to Binder --- docs/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/requirements.txt b/docs/requirements.txt index 8e236ac6..dbe7e0ed 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1,5 @@ jupyter-book==0.14 jupytext>=1.13.3 jupyterlab_myst +myst_nb ipywidgets \ No newline at end of file From 179f2928a4b7c57373ae29ac33e9dd1140b47793 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Tue, 14 Mar 2023 16:25:31 +0100 Subject: [PATCH 27/43] Specify optional dev-dependencies for docs in pyproject.toml Can install using `pip install -e ".[docs]"` --- .readthedocs.yaml | 3 ++- binder/requirements.txt | 3 +++ docs/requirements.txt | 5 ----- pyproject.toml | 11 ++++++++++- requirements.txt | 7 ------- 5 files changed, 15 insertions(+), 14 deletions(-) create mode 100644 binder/requirements.txt delete mode 100644 docs/requirements.txt delete mode 100644 requirements.txt diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 15641c18..5398903e 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -11,9 +11,10 @@ build: python: install: - - requirements: docs/requirements.txt - method: pip path: . + extra_requirements: + - docs sphinx: builder: html diff --git a/binder/requirements.txt b/binder/requirements.txt new file mode 100644 index 00000000..31f1d651 --- /dev/null +++ b/binder/requirements.txt @@ -0,0 +1,3 @@ +jupytext>=1.13.3 +jupyterlab_myst +myst_nb \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index dbe7e0ed..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -jupyter-book==0.14 -jupytext>=1.13.3 -jupyterlab_myst -myst_nb -ipywidgets \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 64e15be4..57245bb4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,6 +23,8 @@ maintainers = [ {name = "Joris Vincent", email = "j.vincent@tu-berlin.de"}, ] +dynamic = ["version"] + requires-python = ">=3.6" dependencies = [ "numpy", @@ -32,7 +34,14 @@ dependencies = [ "Pillow" ] -dynamic = ["version"] +[project.optional-dependencies] +docs = [ + "jupyter-book==0.14", + "jupytext>=1.13.3", + "jupyterlab_myst", + "myst_nb", + "ipywidgets", +] [project.urls] repository = "https://github.com/computational-psychology/stimupy.git" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 8095a5d6..00000000 --- a/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -numpy -scipy -pandas -Pillow -pytest - --r docs/requirements.txt \ No newline at end of file From fe43dd8f3628d0a39a1211268ee1dc22bfc151d9 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Tue, 14 Mar 2023 16:46:03 +0100 Subject: [PATCH 28/43] Revert f415243 No need to enable extensions on Binder --- binder/postBuild | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/binder/postBuild b/binder/postBuild index 3850a7d3..8129f278 100644 --- a/binder/postBuild +++ b/binder/postBuild @@ -6,12 +6,5 @@ echo `which pip` # in case the wrong `pip` is used, this will let us debug mkdir -p ${HOME}/.jupyter/labconfig cp binder/labconfig/* ${HOME}/.jupyter/labconfig -# Install and enable extensions... -pip install "jupytext[myst]>=1.13.3" -jupyter nbextension install --py jupytext --user -jupyter nbextension enable --py jupytext --user -jupyter lab build -jupyter serverextension enable jupytext - # Install stimupy -pip install -e . +pip install -e . \ No newline at end of file From 8ab276099c017ff79d0eadacaab31c02e3cf64e2 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Tue, 14 Mar 2023 17:00:16 +0100 Subject: [PATCH 29/43] Add documentation badge to README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 7d6f5e8e..ee57d4e1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Stimupy +[![Documentation Status](https://readthedocs.org/projects/stimupy/badge/?version=latest)](https://stimupy.readthedocs.io/en/latest/?badge=latest) + Contains submodules for - drawing basic visual stimulus components ([components](stimupy/components/)) - creating different (brightness) illusions ([illusions](stimupy/illusions/)) From 3a3302d3da7b070873bd05ea4e695cd6f44ecca5 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Tue, 14 Mar 2023 17:44:28 +0100 Subject: [PATCH 30/43] Update README --- README.md | 94 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 70 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index ee57d4e1..c3d14a61 100644 --- a/README.md +++ b/README.md @@ -2,25 +2,70 @@ [![Documentation Status](https://readthedocs.org/projects/stimupy/badge/?version=latest)](https://stimupy.readthedocs.io/en/latest/?badge=latest) -Contains submodules for -- drawing basic visual stimulus components ([components](stimupy/components/)) -- creating different (brightness) illusions ([illusions](stimupy/illusions/)) -- replicating illusions in certain published papers ([papers](stimupy/papers/)) -converting pixel values to degrees of visual angle ([utils](stimupy/utils/)) +`Stimupy` is a pure-Python package +for creating new and exiting visual stimuli +commonly used in the sudy of contrast, brightness/lightness, +and other aspects of visual perception. + +## Core features: +Stimupy has been designed to generate stimuli from code, +so that they are reproducible, flexible, and easy. +- Stimuli available through stimupy are: + - basic visual stimulus [components](stimupy/components/), + such as basic shapes, gratings, Gaussians, Gabors + - visual [noise](stimupy/noises/) textures, of different kinds, + - and many different stimuli commonly referred to as [illusions](stimupy/illusions/) + with some special regions of interest, + such as Simultaneous Brightness Contrast, White's illusion, + but also Hermann Grids, checkerboards, Ponzo illusion, etc. + +- All these stimuli are fully parameterizable + with interpretable parameters that are relevant to vision scientists + (e.g. visual angle, spatial frequency, target placements). + - This also makes it possible to explore stimulus parameter spaces + which might reveal relations between formerly unconnected stimuli + +- Stimuli are also composable/composed: +`illusions` tend to be composed from several `components`. + +- Generated stimuli are output as a Python `dict`ionary, +containing the stimulus-image as a NumPy-array, +together with other useful stimulus-specific information +(e.g. (target) masks, sizes etc.). + - Since Python dictionaries are mutable data structures (compared to objects), + they allow the user to add additional information easily. + - The image as NumPy-array (rather than, e.g., an OpenGL texture), + makes these stimuli fully interoperablye using common NumPy tooling. + +- In addition, we provide many [utils](stimupy/utils/) functions + to apply common operations to either the images, or the full stimulus-`dict`s. + +- Reuse of existing stimuli and stimulus sets should be a key aim, + so also included are exact replications of stimuli previously published (e.g. ModelFest) + as described in their respecive [papers](stimupy/papers/) + +See the [documentation](https://stimupy.readthedocs.io/en/latest/) for more details + +## Your stimulus (set) is not here? +Given the modular nature of the package, +any stimulus or stimulus set not currently available, can be easily added. +Open an [issue](https://github.com/computational-psychology/stimupy/issues/new) +and let us know what you'd like to see added. + +If you want to contribute yourself, see [contributing](#contributing-to-stimupy) -For details, please refer to the source directory (stimupy/), -the respective subdirectories and the docstrings. ## Installation -Either install using `pip`: +For now, `pip` can install directly from GitHub (the `main` branch) +GitHub repository ```python -pip install 'stimupy @ https://github.com/computational-psychology/stimupy' +pip install https://github.com/computational-psychology/stimupy/zipball/main ``` OR (for developers), install from source: -1. Clone the repository from GitHub (TUB): +1. Clone the repository from GitHub: ```bash git clone git@github.com:computational-psychology/stimupy.git @@ -42,19 +87,20 @@ rather than having to reinstall the package after every change. ### Dependencies Dependencies should be automatically installed (at least using `pip`). `stimupy`s required dependencies are: -- numpy -- scipy -- matplotlib -- Pillow -- pandas +- [NumPy](https://numpy.org/) +- [SciPy](https://scipy.org/) +- [matplotlib](https://matplotlib.org/) +- [Pillow](https://pillow.readthedocs.io/) +- [pandas](https://pandas.pydata.org/) +## Citing stimupy -## Importing -To use in your own code, `import` (from) the modules. -```python -from stimupy import components -from stimupy import noises -from stimupy import illusions -from stimupy import papers -from stimupy import utils -``` +## Contributing to stimupy +1. *Fork* the [GitHub repository](https://github.com/computational-psychology/stimupy/) +2. *Clone* the repository to your local machine +3. *Install* `stimupy` using the developer install: `pip install -e ".[dev]"` +4. *Edit* the code: + - To contribute a stimulus set, add it to `stimupy/papers/` + - To contribute a stimulus function, add it to the relevant directory +5. *Commit & Push* to your fork +6. *Pull request* from your fork to our repository \ No newline at end of file From d4ec3cd44058d117af2b8cc7e0c74204b61ee7af Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Tue, 14 Mar 2023 19:25:23 +0100 Subject: [PATCH 31/43] Binder link demo links to lab interface, not raw notebook Otherwise it gets rendered as plain markdown --- docs/reference/demos/components/shapes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/demos/components/shapes.md b/docs/reference/demos/components/shapes.md index 674b7071..683eeeae 100644 --- a/docs/reference/demos/components/shapes.md +++ b/docs/reference/demos/components/shapes.md @@ -11,7 +11,7 @@ kernelspec: --- ```{important} -[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/computational-psychology/stimupy/dev_docs?urlpath=tree/docs/reference/demos/components/shapes.md) +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/computational-psychology/stimupy/dev_docs?urlpath=lab/tree/docs/reference/demos/components/shapes.md) to get interactivity ``` From ffe6c9916c29df4d2ba5aced58014a1327e90aa4 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Wed, 15 Mar 2023 12:13:06 +0100 Subject: [PATCH 32/43] pyproject.toml specify version earlier --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 90f18a67..eac942e5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,6 +23,8 @@ maintainers = [ {name = "Joris Vincent", email = "j.vincent@tu-berlin.de"}, ] +dynamic = ["version"] + requires-python = ">=3.6" dependencies = [ "numpy", @@ -32,7 +34,7 @@ dependencies = [ "Pillow" ] -dynamic = ["version"] + [project.urls] repository = "https://github.com/computational-psychology/stimupy.git" From 5528cad2c7bf99693d4af234ccacfb441e3d595a Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Wed, 15 Mar 2023 12:13:37 +0100 Subject: [PATCH 33/43] Dev-dependencies specified in pyproject.toml Can install using `pip install -e ".[dev]"` --- pyproject.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index eac942e5..771be3e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,6 +35,13 @@ dependencies = [ ] +[project.optional-dependencies] +dev = [ + "pytest", + "black", + "pyupgrade", + "flake8" +] [project.urls] repository = "https://github.com/computational-psychology/stimupy.git" From bafb8f72add1b4bb021aaea4d84ca07bbab67a70 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Wed, 15 Mar 2023 12:13:56 +0100 Subject: [PATCH 34/43] Docs-dependencies specified in pyproject.toml Can install using `pip install -e ".[docs]"` --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 771be3e8..56c492c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,6 +42,10 @@ dev = [ "pyupgrade", "flake8" ] +docs = [ + "jupyter-book", +] + [project.urls] repository = "https://github.com/computational-psychology/stimupy.git" From 3d3a4578c95c114f0ef1b8521d11fbf48d811369 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Wed, 15 Mar 2023 12:14:04 +0100 Subject: [PATCH 35/43] Update requirements.txt's --- docs/requirements.txt | 6 +----- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 88abbac9..195b5bc9 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,5 +1 @@ -jupyter-book -matplotlib -numpy -scipy -pandas \ No newline at end of file +.[docs] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 55b033e9..1d9b0701 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -pytest \ No newline at end of file +.[dev,docs] \ No newline at end of file From 312ddeccbff554b76a8cb84b5ac559032c9e466e Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Wed, 15 Mar 2023 13:55:43 +0100 Subject: [PATCH 36/43] Docs: Fix references in docstrings --- stimupy/components/edges.py | 8 +- stimupy/illusions/angulars.py | 8 +- stimupy/illusions/benarys.py | 36 ++- stimupy/illusions/checkerboards.py | 28 ++- stimupy/illusions/circulars.py | 64 +++-- stimupy/illusions/cornsweets.py | 8 +- stimupy/illusions/cubes.py | 32 ++- stimupy/illusions/delboeufs.py | 20 +- stimupy/illusions/dungeons.py | 14 +- stimupy/illusions/frames.py | 28 ++- stimupy/illusions/gratings.py | 36 +-- stimupy/illusions/hermanns.py | 9 +- stimupy/illusions/mondrians.py | 9 +- stimupy/illusions/mueller_lyers.py | 20 +- stimupy/illusions/ponzos.py | 10 +- stimupy/illusions/sbcs.py | 39 ++-- stimupy/illusions/todorovics.py | 160 +++++++------ stimupy/illusions/wedding_cakes.py | 5 +- stimupy/illusions/whites.py | 56 +++-- stimupy/papers/RHS2007.py | 283 ++++++++++++++--------- stimupy/papers/carney1999.py | 360 ++++++++++++++++++----------- stimupy/papers/domijan2015.py | 191 +++++++++------ stimupy/papers/murray2020.py | 104 +++++---- stimupy/papers/white1981.py | 104 +++++---- stimupy/papers/white1985.py | 78 ++++--- 25 files changed, 1056 insertions(+), 654 deletions(-) diff --git a/stimupy/components/edges.py b/stimupy/components/edges.py index d4d92631..d31c5328 100644 --- a/stimupy/components/edges.py +++ b/stimupy/components/edges.py @@ -173,10 +173,12 @@ def cornsweet_edge( References ---------- - Boyaci, H., Fang, F., Murray, S.O., Kersten, D. (2007). Responses to lightness - variations in early human visual cortex. Current Biology 17, 989-993. + Boyaci, H., Fang, F., Murray, S.O., Kersten, D. (2007). + Responses to lightness variations in early human visual cortex. + Current Biology 17, 989-993. https://doi.org/10.1016/j.cub.2007.05.005 - Cornsweet, T. (1970). Visual perception. Academic press. + Cornsweet, T. (1970). + Visual perception. Academic press. https://doi.org/10.1016/B978-0-12-189750-5.X5001-5 """ if ramp_width is None: diff --git a/stimupy/illusions/angulars.py b/stimupy/illusions/angulars.py index 527b2af5..5690e64b 100644 --- a/stimupy/illusions/angulars.py +++ b/stimupy/illusions/angulars.py @@ -81,9 +81,11 @@ def pinwheel( References ---------- - Robinson, A. E., Hammon, P. S., & de Sa, V. R. (2007). Explaining brightness - illusions using spatial filtering and local response normalization. Vision - research, 47(12), 1631-1644. https://doi.org/10.1016/j.visres.2007.02.017 + Robinson, A. E., Hammon, P. S., & de Sa, V. R. (2007). + Explaining brightness illusions + using spatial filtering and local response normalization. + Vision Research, 47(12), 1631-1644. + https://doi.org/10.1016/j.visres.2007.02.017 """ # Radial grating diff --git a/stimupy/illusions/benarys.py b/stimupy/illusions/benarys.py index 9110aaa2..626d54da 100644 --- a/stimupy/illusions/benarys.py +++ b/stimupy/illusions/benarys.py @@ -69,8 +69,10 @@ def cross_generalized( References ----------- - Benary, W. (1924). Beobachtungen zu einem Experiment ueber Helligkeitskontrast. - Psychologische Forschung, 5, 131–142. https://doi.org/10.1007/BF00402398 + Benary, W. (1924). + Beobachtungen zu einem Experiment über Helligkeitskontrast. + Psychologische Forschung, 5, 131-142. + https://doi.org/10.1007/BF00402398 """ if cross_thickness is None: raise ValueError( @@ -146,8 +148,10 @@ def cross_rectangles( References ----------- - Benary, W. (1924). Beobachtungen zu einem Experiment ueber Helligkeitskontrast. - Psychologische Forschung, 5, 131–142. https://doi.org/10.1007/BF00402398 + Benary, W. (1924). + Beobachtungen zu einem Experiment über Helligkeitskontrast. + Psychologische Forschung, 5, 131-142. + https://doi.org/10.1007/BF00402398 """ if cross_thickness is None: raise ValueError( @@ -235,8 +239,10 @@ def cross_triangles( References ----------- - Benary, W. (1924). Beobachtungen zu einem Experiment ueber Helligkeitskontrast. - Psychologische Forschung, 5, 131–142. https://doi.org/10.1007/BF00402398 + Benary, W. (1924). + Beobachtungen zu einem Experiment über Helligkeitskontrast. + Psychologische Forschung, 5, 131-142. + https://doi.org/10.1007/BF00402398 """ if cross_thickness is None: raise ValueError( @@ -336,8 +342,10 @@ def todorovic_generalized( References ----------- - Benary, W. (1924). Beobachtungen zu einem Experiment ueber Helligkeitskontrast. - Psychologische Forschung, 5, 131–142. https://doi.org/10.1007/BF00402398 + Benary, W. (1924). + Beobachtungen zu einem Experiment über Helligkeitskontrast. + Psychologische Forschung, 5, 131-142. + https://doi.org/10.1007/BF00402398 """ if L_width is None: raise ValueError("todorovic_generalized() missing argument 'L_width' which is not 'None'") @@ -422,8 +430,10 @@ def todorovic_rectangles( References ----------- - Benary, W. (1924). Beobachtungen zu einem Experiment ueber Helligkeitskontrast. - Psychologische Forschung, 5, 131–142. https://doi.org/10.1007/BF00402398 + Benary, W. (1924). + Beobachtungen zu einem Experiment über Helligkeitskontrast. + Psychologische Forschung, 5, 131-142. + https://doi.org/10.1007/BF00402398 """ if L_width is None: raise ValueError("todorovic_rectangles() missing argument 'L_width' which is not 'None'") @@ -500,8 +510,10 @@ def todorovic_triangles( References ----------- - Benary, W. (1924). Beobachtungen zu einem Experiment ueber Helligkeitskontrast. - Psychologische Forschung, 5, 131–142. https://doi.org/10.1007/BF00402398 + Benary, W. (1924). + Beobachtungen zu einem Experiment über Helligkeitskontrast. + Psychologische Forschung, 5, 131-142. + https://doi.org/10.1007/BF00402398 """ if L_width is None: raise ValueError("todorovic_triangles() missing argument 'L_width' which is not 'None'") diff --git a/stimupy/illusions/checkerboards.py b/stimupy/illusions/checkerboards.py index 73dfffe1..caf9446e 100644 --- a/stimupy/illusions/checkerboards.py +++ b/stimupy/illusions/checkerboards.py @@ -182,11 +182,13 @@ def checkerboard( References ---------- - Blakeslee, B., & McCourt, M. E. (2004). A unified theory of brightness contrast and - assimilation incorporating oriented multiscale spatial filtering and contrast - normalization. Vision Research, 44(21), 2483-2503. https://doi.org/10/fmcx5p - De Valois, R. L., & De Valois, K. K. (1988). Spatial Vision. Oxford University Press. - + Blakeslee, B., & McCourt, M. E. (2004). + A unified theory of brightness contrast and assimilation + incorporating oriented multiscale spatial filtering and contrast normalization. + Vision Research, 44(21), 2483-2503. + https://doi.org/10/fmcx5p + De Valois, R. L., & De Valois, K. K. (1988). + Spatial Vision. Oxford University Press. """ # Set up basic checkerboard @@ -264,15 +266,17 @@ def contrast_contrast( mask with integer index for each target (key: "target_mask"), and additional keys containing stimulus parameters - References: - ----------- - Chubb, C., Sperling, G., & Solomon, J. A. (1989). Texture interactions determine - perceived contrast. Proc. Natl. Acad. Sci. USA, 5. + References + ---------- + Chubb, C., Sperling, G., & Solomon, J. A. (1989). + Texture interactions determine perceived contrast. + Proc. Natl. Acad. Sci. USA, 5. https://doi.org/10.1073/pnas.86.23.9631 - Domijan, D. (2015). A Neurocomputational account of the role of contour facilitation - in brightness perception. Frontiers in Human Neuroscience, 9(February), 1-16. + Domijan, D. (2015). + A Neurocomputational account of the role + of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9(February), 1-16. https://doi.org/10/gh62x2 - """ # Set up basic checkerboard diff --git a/stimupy/illusions/circulars.py b/stimupy/illusions/circulars.py index b17f2717..7da04181 100644 --- a/stimupy/illusions/circulars.py +++ b/stimupy/illusions/circulars.py @@ -74,10 +74,15 @@ def rings( References ----------- - Hong, S. W., and Shevell, S. K. (2004). Brightness contrast and assimilation from patterned - inducing backgrounds. Vision Research, 44, 35–43. https://doi.org/10.1016/j.visres.2003.07.010 - Howe, P. D. L. (2005). White's effect: removing the junctions but preserving the - strength of the illusion. Perception, 34, 557–564. https://doi.org/10.1068/p5414 + Hong, S. W., and Shevell, S. K. (2004). + Brightness contrast and assimilation from patterned inducing backgrounds. + Vision Research, 44, 35-43. + https://doi.org/10.1016/j.visres.2003.07.010 + Howe, P. D. L. (2005). + White's effect: + removing the junctions but preserving the strength of the illusion. + Perception, 34, 557-564. + https://doi.org/10.1068/p5414 """ # Get stim @@ -194,10 +199,15 @@ def two_sided_rings( References ----------- - Hong, S. W., and Shevell, S. K. (2004). Brightness contrast and assimilation from patterned - inducing backgrounds. Vision Research, 44, 35–43. https://doi.org/10.1016/j.visres.2003.07.010 - Howe, P. D. L. (2005). White's effect: removing the junctions but preserving the - strength of the illusion. Perception, 34, 557–564. https://doi.org/10.1068/p5414 + Hong, S. W., and Shevell, S. K. (2004). + Brightness contrast and assimilation from patterned inducing backgrounds. + Vision Research, 44, 35-43. + https://doi.org/10.1016/j.visres.2003.07.010 + Howe, P. D. L. (2005). + White's effect: + removing the junctions but preserving the strength of the illusion. + Perception, 34, 557-564. + https://doi.org/10.1068/p5414 """ # Resolve resolution @@ -300,12 +310,19 @@ def bullseye( References ----------- - Bindman, D., & Chubb, C. (2004). Brightness assimilation in Bullseye displays. - Vision Research, 44, 309–319. https://doi.org/10.1016/S0042-6989(03)00430-9 - Hong, S. W., and Shevell, S. K. (2004). Brightness contrast and assimilation from patterned - inducing backgrounds. Vision Research, 44, 35–43. https://doi.org/10.1016/j.visres.2003.07.010 - Howe, P. D. L. (2005). White's effect: removing the junctions but preserving the - strength of the illusion. Perception, 34, 557–564. https://doi.org/10.1068/p5414 + Bindman, D., & Chubb, C. (2004). + Brightness assimilation in bullseye displays. + Vision Research, 44, 309-319. + https://doi.org/10.1016/S0042-6989(03)00430-9 + Hong, S. W., and Shevell, S. K. (2004). + Brightness contrast and assimilation from patterned inducing backgrounds. + Vision Research, 44, 35-43. + https://doi.org/10.1016/j.visres.2003.07.010 + Howe, P. D. L. (2005). + White's effect: + removing the junctions but preserving the strength of the illusion. + Perception, 34, 557-564. + https://doi.org/10.1068/p5414 """ stim = rings( visual_size=visual_size, @@ -388,12 +405,19 @@ def two_sided_bullseye( References ----------- - Bindman, D., & Chubb, C. (2004). Brightness assimilation in Bullseye displays. - Vision Research, 44, 309–319. https://doi.org/10.1016/S0042-6989(03)00430-9 - Hong, S. W., and Shevell, S. K. (2004). Brightness contrast and assimilation from patterned - inducing backgrounds. Vision Research, 44, 35–43. https://doi.org/10.1016/j.visres.2003.07.010 - Howe, P. D. L. (2005). White's effect: removing the junctions but preserving the - strength of the illusion. Perception, 34, 557–564. https://doi.org/10.1068/p5414 + Bindman, D., & Chubb, C. (2004). + Brightness assimilation in bullseye displays. + Vision Research, 44, 309-319. + https://doi.org/10.1016/S0042-6989(03)00430-9 + Hong, S. W., and Shevell, S. K. (2004). + Brightness contrast and assimilation from patterned inducing backgrounds. + Vision Research, 44, 35-43. + https://doi.org/10.1016/j.visres.2003.07.010 + Howe, P. D. L. (2005). + White's effect: + removing the junctions but preserving the strength of the illusion. + Perception, 34, 557-564. + https://doi.org/10.1068/p5414 """ # Resolve resolution diff --git a/stimupy/illusions/cornsweets.py b/stimupy/illusions/cornsweets.py index d7433f2c..0b80a1cc 100644 --- a/stimupy/illusions/cornsweets.py +++ b/stimupy/illusions/cornsweets.py @@ -53,10 +53,12 @@ def cornsweet( References ---------- - Boyaci, H., Fang, F., Murray, S.O., Kersten, D. (2007). Responses to lightness - variations in early human visual cortex. Current Biology 17, 989-993. + Boyaci, H., Fang, F., Murray, S.O., Kersten, D. (2007). + Responses to lightness variations in early human visual cortex. + Current Biology 17, 989-993. https://doi.org/10.1016/j.cub.2007.05.005 - Cornsweet, T. (1970). Visual perception. Academic press. + Cornsweet, T. (1970). + Visual perception. Academic press. https://doi.org/10.1016/B978-0-12-189750-5.X5001-5 """ diff --git a/stimupy/illusions/cubes.py b/stimupy/illusions/cubes.py index f6d3b7f8..307665fe 100644 --- a/stimupy/illusions/cubes.py +++ b/stimupy/illusions/cubes.py @@ -49,12 +49,16 @@ def varying_cells( References ---------- - Agostini, T., and Galmonte, A. (2002). Perceptual organization overcomes the - effects of local surround in determining simultaneous lightness contrast. - Psychol. Sci. 13, 89–93. https://doi.org/10.1111/1467-9280.00417 - Domijan, D. (2015). A neurocomputational account of the role of contour - facilitation in brightness perception. Frontiers in Human Neuroscience, - 9, 93. https://doi.org/10.3389/fnhum.2015.00093 + Agostini, T., and Galmonte, A. (2002). + Perceptual organization overcomes the effects of local surround + in determining simultaneous lightness contrast. + Psychol. Sci. 13, 89-93. + https://doi.org/10.1111/1467-9280.00417 + Domijan, D. (2015). + A neurocomputational account + of the role of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9, 93. + https://doi.org/10.3389/fnhum.2015.00093 """ if isinstance(cell_heights, (float, int)): @@ -185,12 +189,16 @@ def cube( References ---------- - Agostini, T., and Galmonte, A. (2002). Perceptual organization overcomes the - effects of local surround in determining simultaneous lightness contrast. - Psychol. Sci. 13, 89–93. https://doi.org/10.1111/1467-9280.00417 - Domijan, D. (2015). A neurocomputational account of the role of contour - facilitation in brightness perception. Frontiers in Human Neuroscience, - 9, 93. https://doi.org/10.3389/fnhum.2015.00093 + Agostini, T., and Galmonte, A. (2002). + Perceptual organization overcomes the effects of local surround + in determining simultaneous lightness contrast. + Psychol. Sci. 13, 89-93. + https://doi.org/10.1111/1467-9280.00417 + Domijan, D. (2015). + A neurocomputational account + of the role of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9, 93. + https://doi.org/10.3389/fnhum.2015.00093 """ # Resolve resolution diff --git a/stimupy/illusions/delboeufs.py b/stimupy/illusions/delboeufs.py index 5fb22ed4..1f813bb8 100644 --- a/stimupy/illusions/delboeufs.py +++ b/stimupy/illusions/delboeufs.py @@ -42,7 +42,7 @@ def delboeuf( intensity value of background (default: 1) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the target (key: "target_mask"), @@ -50,9 +50,11 @@ def delboeuf( References ---------- - Delboeuf, F. J. (1865). Note sur certaines illusions d’optique: Essai d'une - théorie psychophysique de la maniere dont l’oeil apprécie les distances - et les angles. Bulletins de l’Académie Royale des Sciences, Lettres et + Delboeuf, F. J. (1865). + Note sur certaines illusions d'optique: + Essai d'une théorie psychophysique de la maniere + dont l'oeil apprécie les distances et les angles. + Bulletins de l'Académie Royale des Sciences, Lettres et Beaux-arts de Belgique, 19, 195-216. """ if outer_radius is None: @@ -123,7 +125,7 @@ def two_sided( intensity value of background (default: 1) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the target (key: "target_mask"), @@ -131,9 +133,11 @@ def two_sided( References ---------- - Delboeuf, F. J. (1865). Note sur certaines illusions d’optique: Essai d'une - théorie psychophysique de la maniere dont l’oeil apprécie les distances - et les angles. Bulletins de l’Académie Royale des Sciences, Lettres et + Delboeuf, F. J. (1865). + Note sur certaines illusions d'optique: + Essai d'une théorie psychophysique de la maniere + dont l'oeil apprécie les distances et les angles. + Bulletins de l'Académie Royale des Sciences, Lettres et Beaux-arts de Belgique, 19, 195-216. """ if outer_radii is None: diff --git a/stimupy/illusions/dungeons.py b/stimupy/illusions/dungeons.py index e653345b..86a5c236 100644 --- a/stimupy/illusions/dungeons.py +++ b/stimupy/illusions/dungeons.py @@ -43,7 +43,7 @@ def dungeon( intensity value for target Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), @@ -51,11 +51,15 @@ def dungeon( References ----------- - Bressan, P. (2001). Explaining lightness illusions. Perception, 30(9), 1031–1046. + Bressan, P. (2001). + Explaining lightness illusions. + Perception, 30(9), 1031-1046. https://doi.org/10.1068/p3109 - Domijan, D. (2015). A neurocomputational account of the role of contour - facilitation in brightness perception. Frontiers in Human Neuroscience, - 9, 93. https://doi.org/10.3389/fnhum.2015.00093 + Domijan, D. (2015). + A neurocomputational account + of the role of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9, 93. + https://doi.org/10.3389/fnhum.2015.00093 """ if isinstance(visual_size, (float, int)) or (visual_size is None): diff --git a/stimupy/illusions/frames.py b/stimupy/illusions/frames.py index c1667527..08556af1 100644 --- a/stimupy/illusions/frames.py +++ b/stimupy/illusions/frames.py @@ -66,9 +66,11 @@ def rings( References ---------- - Domijan, D. (2015). A neurocomputational account of the role of contour - facilitation in brightness perception. Frontiers in Human Neuroscience, - 9, 93. https://doi.org/10.3389/fnhum.2015.00093 + Domijan, D. (2015). + A neurocomputational account + of the role of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9, 93. + https://doi.org/10.3389/fnhum.2015.00093 """ # Frames component @@ -156,9 +158,11 @@ def two_sided_rings( References ---------- - Domijan, D. (2015). A neurocomputational account of the role of contour - facilitation in brightness perception. Frontiers in Human Neuroscience, - 9, 93. https://doi.org/10.3389/fnhum.2015.00093 + Domijan, D. (2015). + A neurocomputational account + of the role of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9, 93. + https://doi.org/10.3389/fnhum.2015.00093 """ # Resolve resolution @@ -324,8 +328,10 @@ def bullseye( References ----------- - Bindman, D., & Chubb, C. (2004). Brightness assimilation in Bullseye displays. - Vision Research, 44, 309–319. https://doi.org/10.1016/S0042-6989(03)00430-9 + Bindman, D., & Chubb, C. (2004). + Brightness assimilation in bullseye displays. + Vision Research, 44, 309-319. + https://doi.org/10.1016/S0042-6989(03)00430-9 """ stim = rings( @@ -452,8 +458,10 @@ def two_sided_bullseye( References ----------- - Bindman, D., & Chubb, C. (2004). Brightness assimilation in Bullseye displays. - Vision Research, 44, 309–319. https://doi.org/10.1016/S0042-6989(03)00430-9 + Bindman, D., & Chubb, C. (2004). + Brightness assimilation in bullseye displays. + Vision Research, 44, 309-319. + https://doi.org/10.1016/S0042-6989(03)00430-9 """ # Resolve resolution diff --git a/stimupy/illusions/gratings.py b/stimupy/illusions/gratings.py index 6b4d9917..f7a5fb72 100644 --- a/stimupy/illusions/gratings.py +++ b/stimupy/illusions/gratings.py @@ -189,9 +189,11 @@ def uniform( References ---------- - White, M. (1981). The effect of the nature of the surround on the perceived - lightness of grey bars within square-wave test gratings. Perception, 10(2), - 215–230. https://doi.org/10.1068/p100215 + White, M. (1981). + The effect of the nature of the surround on the perceived lightness + of grey bars within square-wave test grating. + Perception, 10, 215-230. + https://doi.org/10.1068/p100215 """ # Resolve resolution @@ -258,9 +260,11 @@ def grating_masked( References ---------- - White, M. (1981). The effect of the nature of the surround on the perceived - lightness of grey bars within square-wave test gratings. Perception, 10(2), - 215–230. https://doi.org/10.1068/p100215 + White, M. (1981). + The effect of the nature of the surround on the perceived lightness + of grey bars within square-wave test grating. + Perception, 10, 215-230. + https://doi.org/10.1068/p100215 """ # Create gratings @@ -317,9 +321,11 @@ def grating( References ---------- - White, M. (1981). The effect of the nature of the surround on the perceived - lightness of grey bars within square-wave test gratings. Perception, 10(2), - 215–230. https://doi.org/10.1068/p100215 + White, M. (1981). + The effect of the nature of the surround on the perceived lightness + of grey bars within square-wave test grating. + Perception, 10, 215-230. + https://doi.org/10.1068/p100215 """ stim = grating_masked( @@ -505,8 +511,10 @@ def induction( References ---------- - McCourt, M. E. (1982). A spatial frequency dependent grating-induction effect. - Vision Research, 22, 119–134. https://doi.org/10.1016/0042-6989(82)90173-0 + McCourt, M. E. (1982). + A spatial frequency dependent grating-induction effect. + Vision Research, 22, 119-134. + https://doi.org/10.1016/0042-6989(82)90173-0 """ if target_width is None: raise ValueError("induction() missing argument 'target_width' which is not 'None'") @@ -610,8 +618,10 @@ def induction_blur( References ---------- - McCourt, M. E. (1982). A spatial frequency dependent grating-induction effect. - Vision Research, 22, 119–134. https://doi.org/10.1016/0042-6989(82)90173-0 + McCourt, M. E. (1982). + A spatial frequency dependent grating-induction effect. + Vision Research, 22, 119-134. + https://doi.org/10.1016/0042-6989(82)90173-0 """ if target_width is None: raise ValueError("induction_blur() missing argument 'target_width' which is not 'None'") diff --git a/stimupy/illusions/hermanns.py b/stimupy/illusions/hermanns.py index cf8b666a..313dad71 100644 --- a/stimupy/illusions/hermanns.py +++ b/stimupy/illusions/hermanns.py @@ -15,8 +15,7 @@ def grid( intensity_background=0.0, intensity_grid=1.0, ): - """ - Hermann grid + """Hermann's (1870) grid Parameters ---------- @@ -42,8 +41,10 @@ def grid( References ---------- - Hermann L (1870). Eine Erscheinung simultanen Contrastes". Pflügers Archiv - fuer die gesamte Physiologie. 3: 13–15. https://doi.org/10.1007/BF01855743 + Hermann L (1870). + Eine Erscheinung simultanen Contrastes". + Pflügers Archiv für die gesamte Physiologie. 3: 13-15. + https://doi.org/10.1007/BF01855743 """ if element_size is None: raise ValueError("grid() missing argument 'element_size' which is not 'None'") diff --git a/stimupy/illusions/mondrians.py b/stimupy/illusions/mondrians.py index 36d9e748..7aff64c6 100644 --- a/stimupy/illusions/mondrians.py +++ b/stimupy/illusions/mondrians.py @@ -17,8 +17,7 @@ def corrugated_mondrians( target_indices=None, intensity_background=0.5, ): - """ - Corrugated mondrians + """Corrugated Mondrians Parameters ---------- @@ -47,8 +46,10 @@ def corrugated_mondrians( References ---------- - Adelson, E. H. (1993). Perceptual organization and the judgment of brightness. - Science, 262(5142), 2042–2044. https://doi.org/10.1126/science.8266102 + Adelson, E. H. (1993). + Perceptual organization and the judgment of brightness. + Science, 262, 2042-2044. + https://doi.org/10.1126/science.8266102 """ if mondrian_depths is None: raise ValueError( diff --git a/stimupy/illusions/mueller_lyers.py b/stimupy/illusions/mueller_lyers.py index 386a3b1c..6b3ba119 100644 --- a/stimupy/illusions/mueller_lyers.py +++ b/stimupy/illusions/mueller_lyers.py @@ -23,8 +23,7 @@ def mueller_lyer( intensity_target=0.5, intensity_background=0.0, ): - """ - Mueller-Lyer illusion + """Mueller-Lyer's (1896) illusion Parameters ---------- @@ -58,9 +57,10 @@ def mueller_lyer( References ---------- - Mueller-Lyer, F. (1896). Zur Lehre von den optischen Taeuschungen. Ueber - Kontrast und Konfluxion. Zeitschrift fuer Psychologie und Physiologie - der Sinnesorgane, IX, 1-16. + Mueller-Lyer, F. (1896). + Zur Lehre von den optischen Taeuschungen. + Ueber Kontrast und Konfluxion. + Zeitschrift fuer Psychologie und Physiologie der Sinnesorgane, IX, 1-16. """ if outer_lines_length is None: raise ValueError( @@ -176,8 +176,7 @@ def two_sided( intensity_target=0.5, intensity_background=0.0, ): - """ - Mueller-Lyer illusion + """Two-sided Mueller-Lyer's (1896) illusion Parameters ---------- @@ -211,9 +210,10 @@ def two_sided( References ---------- - Mueller-Lyer, F. (1896). Zur Lehre von den optischen Taeuschungen. Ueber - Kontrast und Konfluxion. Zeitschrift fuer Psychologie und Physiologie - der Sinnesorgane, IX, 1-16. + Mueller-Lyer, F. (1896). + Zur Lehre von den optischen Taeuschungen. + Ueber Kontrast und Konfluxion. + Zeitschrift fuer Psychologie und Physiologie der Sinnesorgane, IX, 1-16. """ # Resolve resolution shape, visual_size, ppd = resolution.resolve(shape=shape, visual_size=visual_size, ppd=ppd) diff --git a/stimupy/illusions/ponzos.py b/stimupy/illusions/ponzos.py index 9d1f85bc..4b3f74d1 100644 --- a/stimupy/illusions/ponzos.py +++ b/stimupy/illusions/ponzos.py @@ -20,8 +20,7 @@ def ponzo( intensity_target_lines=0.5, intensity_background=0.0, ): - """ - Ponzo illusion + """Ponzo's (1910) illusion Parameters ---------- @@ -61,9 +60,10 @@ def ponzo( References ---------- - Ponzo, M. (1910). Intorno ad alcune illusioni nel campo delle sensazioni - tattili, sull'illusione di Aristotele e fenomeni analoghi. Wilhelm - Engelmann. + Ponzo, M. (1910). + Intorno ad alcune illusioni nel campo delle sensazioni tattili, + sull'illusione di Aristotele e fenomeni analoghi. + Wilhelm Engelmann. """ if outer_lines_length is None: raise ValueError("ponzo() missing argument 'outer_lines_length' which is not 'None'") diff --git a/stimupy/illusions/sbcs.py b/stimupy/illusions/sbcs.py index d37151b6..62c7c7d6 100644 --- a/stimupy/illusions/sbcs.py +++ b/stimupy/illusions/sbcs.py @@ -53,7 +53,8 @@ def generalized( References ---------- - Chevreul, M. (1855). The principle of harmony and contrast of colors. + Chevreul, M. (1855). + The principle of harmony and contrast of colors. """ if target_size is None: raise ValueError("generalized() missing argument 'target_size' which is not 'None'") @@ -108,7 +109,7 @@ def basic( intensity value for target Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the target (key: "target_mask"), @@ -116,7 +117,8 @@ def basic( References ---------- - Chevreul, M. (1855). The principle of harmony and contrast of colors. + Chevreul, M. (1855). + The principle of harmony and contrast of colors. """ if target_size is None: raise ValueError("basic() missing argument 'target_size' which is not 'None'") @@ -159,7 +161,7 @@ def two_sided( intensity value for target Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the target (key: "target_mask"), @@ -167,7 +169,8 @@ def two_sided( References ---------- - Chevreul, M. (1855). The principle of harmony and contrast of colors. + Chevreul, M. (1855). + The principle of harmony and contrast of colors. """ if target_size is None: raise ValueError("two_sided() missing argument 'target_size' which is not 'None'") @@ -240,7 +243,7 @@ def with_dots( intensity value for target Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the target (key: "target_mask"), @@ -248,8 +251,10 @@ def with_dots( References ---------- - Bressan, P., & Kramer, P. (2008). Gating of remote effects on lightness. Journal - of Vision, 8(2), 16–16. https://doi.org/10.1167/8.2.16 + Bressan, P., & Kramer, P. (2008). + Gating of remote effects on lightness. + Journal of Vision, 8(2), 16-16. + https://doi.org/10.1167/8.2.16 """ if n_dots is None: raise ValueError("with_dots() missing argument 'n_dots' which is not 'None'") @@ -384,8 +389,10 @@ def dotted( References ---------- - Bressan, P., & Kramer, P. (2008). Gating of remote effects on lightness. Journal - of Vision, 8(2), 16–16. https://doi.org/10.1167/8.2.16 + Bressan, P., & Kramer, P. (2008). + Gating of remote effects on lightness. + Journal of Vision, 8(2), 16-16. + https://doi.org/10.1167/8.2.16 """ if n_dots is None: raise ValueError("dotted() missing argument 'n_dots' which is not 'None'") @@ -519,8 +526,10 @@ def two_sided_with_dots( References ---------- - Bressan, P., & Kramer, P. (2008). Gating of remote effects on lightness. Journal - of Vision, 8(2), 16–16. https://doi.org/10.1167/8.2.16 + Bressan, P., & Kramer, P. (2008). + Gating of remote effects on lightness. + Journal of Vision, 8(2), 16-16. + https://doi.org/10.1167/8.2.16 """ # Resolve resolution @@ -610,8 +619,10 @@ def two_sided_dotted( References ---------- - Bressan, P., & Kramer, P. (2008). Gating of remote effects on lightness. Journal - of Vision, 8(2), 16–16. https://doi.org/10.1167/8.2.16 + Bressan, P., & Kramer, P. (2008). + Gating of remote effects on lightness. + Journal of Vision, 8(2), 16-16. + https://doi.org/10.1167/8.2.16 """ # Resolve resolution diff --git a/stimupy/illusions/todorovics.py b/stimupy/illusions/todorovics.py index 9a5305d0..cdeb3c83 100644 --- a/stimupy/illusions/todorovics.py +++ b/stimupy/illusions/todorovics.py @@ -59,21 +59,23 @@ def rectangle_generalized( intensity value for covers Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the target (key: "target_mask"), and additional keys containing stimulus parameters References - ----------- - Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the - White effect, simultaneous brightness contrast and grating induction. Vision - Research, 39, 4361–4377. - Pessoa, L., Baratoff, G., Neumann, H., & Todorovic, D. (1998). Lightness and junctions: - variations on White’s display. Investigative Ophthalmology and Visual Science - (Supplement), 39, S159. - Todorovic, D. (1997). Lightness and junctions. Perception, 26, 379–395. + ---------- + Blakeslee, B., & McCourt, M. E. (1999). + A multiscale spatial filtering account + of the White effect, simultaneous brightness contrast and grating induction. + Vision Research, 39, 4361-4377. + Pessoa, L., Baratoff, G., Neumann, H., & Todorovic, D. (1998). + Lightness and junctions: variations on White's display. + Investigative Ophthalmology and Visual Science (Supplement), 39, S159. + Todorovic, D. (1997). + Lightness and junctions. Perception, 26, 379-395. """ if target_size is None: raise ValueError( @@ -179,21 +181,23 @@ def rectangle( intensity value for covers Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the target (key: "target_mask"), and additional keys containing stimulus parameters References - ----------- - Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the - White effect, simultaneous brightness contrast and grating induction. Vision - Research, 39, 4361–4377. - Pessoa, L., Baratoff, G., Neumann, H., & Todorovic, D. (1998). Lightness and junctions: - variations on White’s display. Investigative Ophthalmology and Visual Science - (Supplement), 39, S159. - Todorovic, D. (1997). Lightness and junctions. Perception, 26, 379–395. + ---------- + Blakeslee, B., & McCourt, M. E. (1999). + A multiscale spatial filtering account + of the White effect, simultaneous brightness contrast and grating induction. + Vision Research, 39, 4361-4377. + Pessoa, L., Baratoff, G., Neumann, H., & Todorovic, D. (1998). + Lightness and junctions: variations on White's display. + Investigative Ophthalmology and Visual Science (Supplement), 39, S159. + Todorovic, D. (1997). + Lightness and junctions. Perception, 26, 379-395. """ if target_size is None: raise ValueError("rectangle() missing argument 'target_size' which is not 'None'") @@ -280,21 +284,23 @@ def cross_generalized( intensity value for covers Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the target (key: "target_mask"), and additional keys containing stimulus parameters References - ----------- - Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the - White effect, simultaneous brightness contrast and grating induction. Vision - Research, 39, 4361–4377. - Pessoa, L., Baratoff, G., Neumann, H., & Todorovic, D. (1998). Lightness and junctions: - variations on White’s display. Investigative Ophthalmology and Visual Science - (Supplement), 39, S159. - Todorovic, D. (1997). Lightness and junctions. Perception, 26, 379–395. + ---------- + Blakeslee, B., & McCourt, M. E. (1999). + A multiscale spatial filtering account + of the White effect, simultaneous brightness contrast and grating induction. + Vision Research, 39, 4361-4377. + Pessoa, L., Baratoff, G., Neumann, H., & Todorovic, D. (1998). + Lightness and junctions: variations on White's display. + Investigative Ophthalmology and Visual Science (Supplement), 39, S159. + Todorovic, D. (1997). + Lightness and junctions. Perception, 26, 379-395. """ if cross_size is None: raise ValueError("cross_generalized() missing argument 'cross_size' which is not 'None'") @@ -400,21 +406,23 @@ def cross( intensity value for covers Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the target (key: "target_mask"), and additional keys containing stimulus parameters References - ----------- - Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the - White effect, simultaneous brightness contrast and grating induction. Vision - Research, 39, 4361–4377. - Pessoa, L., Baratoff, G., Neumann, H., & Todorovic, D. (1998). Lightness and junctions: - variations on White’s display. Investigative Ophthalmology and Visual Science - (Supplement), 39, S159. - Todorovic, D. (1997). Lightness and junctions. Perception, 26, 379–395. + ---------- + Blakeslee, B., & McCourt, M. E. (1999). + A multiscale spatial filtering account + of the White effect, simultaneous brightness contrast and grating induction. + Vision Research, 39, 4361-4377. + Pessoa, L., Baratoff, G., Neumann, H., & Todorovic, D. (1998). + Lightness and junctions: variations on White's display. + Investigative Ophthalmology and Visual Science (Supplement), 39, S159. + Todorovic, D. (1997). + Lightness and junctions. Perception, 26, 379-395. """ if cross_size is None: raise ValueError("cross() missing argument 'cross_size' which is not 'None'") @@ -493,21 +501,23 @@ def equal( intensity value for covers Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the target (key: "target_mask"), and additional keys containing stimulus parameters References - ----------- - Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the - White effect, simultaneous brightness contrast and grating induction. Vision - Research, 39, 4361–4377. - Pessoa, L., Baratoff, G., Neumann, H., & Todorovic, D. (1998). Lightness and junctions: - variations on White’s display. Investigative Ophthalmology and Visual Science - (Supplement), 39, S159. - Todorovic, D. (1997). Lightness and junctions. Perception, 26, 379–395. + ---------- + Blakeslee, B., & McCourt, M. E. (1999). + A multiscale spatial filtering account + of the White effect, simultaneous brightness contrast and grating induction. + Vision Research, 39, 4361-4377. + Pessoa, L., Baratoff, G., Neumann, H., & Todorovic, D. (1998). + Lightness and junctions: variations on White's display. + Investigative Ophthalmology and Visual Science (Supplement), 39, S159. + Todorovic, D. (1997). + Lightness and junctions. Perception, 26, 379-395. """ if cross_size is None: raise ValueError("equal() missing argument 'cross_size' which is not 'None'") @@ -570,21 +580,23 @@ def two_sided_rectangle( intensity values for covers Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the target (key: "target_mask"), and additional keys containing stimulus parameters References - ----------- - Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the - White effect, simultaneous brightness contrast and grating induction. Vision - Research, 39, 4361–4377. - Pessoa, L., Baratoff, G., Neumann, H., & Todorovic, D. (1998). Lightness and junctions: - variations on White’s display. Investigative Ophthalmology and Visual Science - (Supplement), 39, S159. - Todorovic, D. (1997). Lightness and junctions. Perception, 26, 379–395. + ---------- + Blakeslee, B., & McCourt, M. E. (1999). + A multiscale spatial filtering account + of the White effect, simultaneous brightness contrast and grating induction. + Vision Research, 39, 4361-4377. + Pessoa, L., Baratoff, G., Neumann, H., & Todorovic, D. (1998). + Lightness and junctions: variations on White's display. + Investigative Ophthalmology and Visual Science (Supplement), 39, S159. + Todorovic, D. (1997). + Lightness and junctions. Perception, 26, 379-395. """ # Resolve resolution @@ -660,21 +672,23 @@ def two_sided_cross( intensity values for covers Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the target (key: "target_mask"), and additional keys containing stimulus parameters References - ----------- - Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the - White effect, simultaneous brightness contrast and grating induction. Vision - Research, 39, 4361–4377. - Pessoa, L., Baratoff, G., Neumann, H., & Todorovic, D. (1998). Lightness and junctions: - variations on White’s display. Investigative Ophthalmology and Visual Science - (Supplement), 39, S159. - Todorovic, D. (1997). Lightness and junctions. Perception, 26, 379–395. + ---------- + Blakeslee, B., & McCourt, M. E. (1999). + A multiscale spatial filtering account + of the White effect, simultaneous brightness contrast and grating induction. + Vision Research, 39, 4361-4377. + Pessoa, L., Baratoff, G., Neumann, H., & Todorovic, D. (1998). + Lightness and junctions: variations on White's display. + Investigative Ophthalmology and Visual Science (Supplement), 39, S159. + Todorovic, D. (1997). + Lightness and junctions. Perception, 26, 379-395. """ # Resolve resolution @@ -745,21 +759,23 @@ def two_sided_equal( intensity value for covers Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the target (key: "target_mask"), and additional keys containing stimulus parameters References - ----------- - Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the - White effect, simultaneous brightness contrast and grating induction. Vision - Research, 39, 4361–4377. - Pessoa, L., Baratoff, G., Neumann, H., & Todorovic, D. (1998). Lightness and junctions: - variations on White’s display. Investigative Ophthalmology and Visual Science - (Supplement), 39, S159. - Todorovic, D. (1997). Lightness and junctions. Perception, 26, 379–395. + ---------- + Blakeslee, B., & McCourt, M. E. (1999). + A multiscale spatial filtering account + of the White effect, simultaneous brightness contrast and grating induction. + Vision Research, 39, 4361-4377. + Pessoa, L., Baratoff, G., Neumann, H., & Todorovic, D. (1998). + Lightness and junctions: variations on White's display. + Investigative Ophthalmology and Visual Science (Supplement), 39, S159. + Todorovic, D. (1997). + Lightness and junctions. Perception, 26, 379-395. """ # Resolve resolution diff --git a/stimupy/illusions/wedding_cakes.py b/stimupy/illusions/wedding_cakes.py index aa606bc2..43cddb43 100644 --- a/stimupy/illusions/wedding_cakes.py +++ b/stimupy/illusions/wedding_cakes.py @@ -56,8 +56,9 @@ def wedding_cake( References ----------- - Clifford, C. W. G., & Spehar, B. (2003). Using colour to disambiguate contrast and - assimilation in White’s effect. Journal of Vision, 3, 294a. + Clifford, C. W. G., & Spehar, B. (2003). + Using colour to disambiguate contrast and assimilation in White's effect. + Journal of Vision, 3, 294a. https://doi.org/10.1167/3.9.294 """ if L_size is None: diff --git a/stimupy/illusions/whites.py b/stimupy/illusions/whites.py index bc9352be..7ce21c0d 100644 --- a/stimupy/illusions/whites.py +++ b/stimupy/illusions/whites.py @@ -92,8 +92,10 @@ def generalized( References ---------- - White, M. (1979). A new effect of pattern on perceived lightness. Perception, - 8(4), 413–416. https://doi.org/10.1068/p080413 + White, M. (1979). + A new effect of pattern on perceived lightness. + Perception, 8(4), 413-416. + https://doi.org/10.1068/p080413 """ if target_heights is None: raise ValueError("generalized() missing argument 'target_heights' which is not 'None'") @@ -237,8 +239,10 @@ def white( References ---------- - White, M. (1979). A new effect of pattern on perceived lightness. Perception, - 8(4), 413–416. https://doi.org/10.1068/p080413 + White, M. (1979). + A new effect of pattern on perceived lightness. + Perception, 8(4), 413-416. + https://doi.org/10.1068/p080413 """ stim = generalized( @@ -333,8 +337,10 @@ def white_two_rows( References ---------- - White, M. (1979). A new effect of pattern on perceived lightness. Perception, - 8(4), 413–416. https://doi.org/10.1068/p080413 + White, M. (1979). + A new effect of pattern on perceived lightness. + Perception, 8(4), 413-416. + https://doi.org/10.1068/p080413 """ if not isinstance(target_center_offset, (float, int)): raise ValueError("target_center_offset should be a single float / int") @@ -427,19 +433,22 @@ def anderson( stripe height in degrees visual angle Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "mask"), and additional keys containing stimulus parameters References - ----------- - Anderson, B. L. (2001). Contrasting theories of White’s illusion. Perception, 30, 1499–1501 - Blakeslee, B., Pasieka, W., & McCourt, M. E. (2005). Oriented multiscale spatial filtering - and contrast normalization: a parsimonious model of brightness induction in a continuum - of stimuli including White, Howe and simultaneous brightness contrast. Vision Research, - 45, 607–615. + ---------- + Anderson, B. L. (2001). + Contrasting theories of White's illusion. + Perception, 30, 1499-1501. + Blakeslee, B., Pasieka, W., & McCourt, M. E. (2005). + Oriented multiscale spatial filtering and contrast normalization: + a parsimonious model of brightness induction in a continuum + of stimuli including White, Howe and simultaneous brightness contrast. + Vision Research, 45, 607-615. """ if target_height is None: raise ValueError("anderson() missing argument 'target_height' which is not 'None'") @@ -577,12 +586,15 @@ def howe( References ----------- - Blakeslee, B., Pasieka, W., & McCourt, M. E. (2005). Oriented multiscale spatial filtering - and contrast normalization: a parsimonious model of brightness induction in a continuum - of stimuli including White, Howe and simultaneous brightness contrast. Vision Research, - 45, 607–615. - Howe, P. D. L. (2001). A comment on the Anderson (1997), the Todorovic (1997), and the Ross - and Pessoa (2000) explanations of White’s effect. Perception, 30, 1023–1026 + Blakeslee, B., Pasieka, W., & McCourt, M. E. (2005). + Oriented multiscale spatial filtering and contrast normalization: + a parsimonious model of brightness induction in a continuum + of stimuli including White, Howe and simultaneous brightness contrast. + Vision Research, 45, 607-615. + Howe, P. D. L. (2001). + A comment on the Anderson (1997), the Todorovic (1997), + and the Ross nd Pessoa (2000) explanations of White's effect. + Perception, 30, 1023-1026 """ return anderson( visual_size=visual_size, @@ -668,9 +680,9 @@ def yazdanbakhsh( References ---------- - Yazdanbakhsh, A., Arabzadeh, E., Babadi, B., and Fazl, A. (2002). Munker-White- - like illusions without T-junctions. Perception 31, 711–715. - https://doi.org/10.1068/p3348 + Yazdanbakhsh, A., Arabzadeh, E., Babadi, B., and Fazl, A. (2002). + Munker-White-like illusions without T-junctions. + Perception 31, 711-715. https://doi.org/10.1068/p3348 """ if target_height is None: raise ValueError("yazdanbakhsh() missing argument 'target_height' which is not 'None'") diff --git a/stimupy/papers/RHS2007.py b/stimupy/papers/RHS2007.py index c68d4be3..359125ee 100644 --- a/stimupy/papers/RHS2007.py +++ b/stimupy/papers/RHS2007.py @@ -22,10 +22,12 @@ >>> from stimupy.papers.RHS2007 import * References ------------ -Robinson, A. E., Hammon, P. S., & de Sa, V. R. (2007). Explaining brightness -illusions using spatial filtering and local response normalization. Vision -research, 47(12), 1631-1644. https://doi.org/10.1016/j.visres.2007.02.017 +---------- +Robinson, A. E., Hammon, P. S., & de Sa, V. R. (2007). + Explaining brightness illusions + using spatial filtering and local response normalization. + Vision Research, 47(12), 1631-1644. + https://doi.org/10.1016/j.visres.2007.02.017 """ import numpy as np @@ -121,11 +123,14 @@ def WE_thick(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- - Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the - White effect, simultaneous brightness contrast and grating induction. Vision - Research, 39, 4361–4377. - White, M. (1979). A new effect of pattern on perceived lightness. Perception, 8, 413–416. + ---------- + Blakeslee, B., & McCourt, M. E. (1999). + A multiscale spatial filtering account + of the White effect, simultaneous brightness contrast and grating induction. + Vision Research, 39, 4361-4377. + White, M. (1979). + A new effect of pattern on perceived lightness. + Perception, 8, 413-416. """ height, width = 12.0, 16.0 @@ -180,11 +185,13 @@ def WE_thin_wide(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- - Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the - White effect, simultaneous brightness contrast and grating induction. Vision - Research, 39, 4361–4377. - White, M. (1979). A new effect of pattern on perceived lightness. Perception, 8, 413–416. + ---------- + Blakeslee, B., & McCourt, M. E. (1999). + A multiscale spatial filtering account + of the White effect, simultaneous brightness contrast and grating induction. + Vision Research, 39, 4361-4377. + White, M. (1979). + A new effect of pattern on perceived lightness. Perception, 8, 413-416. """ height, width = 12.0, 16.0 @@ -300,11 +307,13 @@ def WE_anderson(ppd=PPD, pad=True): References ----------- - Anderson, B. L. (2001). Contrasting theories of White’s illusion. Perception, 30, 1499–1501 - Blakeslee, B., Pasieka, W., & McCourt, M. E. (2005). Oriented multiscale spatial filtering - and contrast normalization: a parsimonious model of brightness induction in a continuum - of stimuli including White, Howe and simultaneous brightness contrast. Vision Research, - 45, 607–615. + Anderson, B. L. (2001). + Contrasting theories of White's illusion. Perception, 30, 1499-1501 + Blakeslee, B., Pasieka, W., & McCourt, M. E. (2005). + Oriented multiscale spatial filtering and contrast normalization: + a parsimonious model of brightness induction in a continuum of stimuli + including White, Howe and simultaneous brightness contrast. + Vision Research, 45, 607-615. """ height, width = 16.0, 16.0 @@ -365,12 +374,15 @@ def WE_howe(ppd=PPD, pad=True): References ----------- - Blakeslee, B., Pasieka, W., & McCourt, M. E. (2005). Oriented multiscale spatial filtering - and contrast normalization: a parsimonious model of brightness induction in a continuum - of stimuli including White, Howe and simultaneous brightness contrast. Vision Research, - 45, 607–615. - Howe, P. D. L. (2001). A comment on the Anderson (1997), the Todorovic (1997), and the Ross - and Pessoa (2000) explanations of White’s effect. Perception, 30, 1023–1026 + Blakeslee, B., Pasieka, W., & McCourt, M. E. (2005). + Oriented multiscale spatial filtering and contrast normalization: + a parsimonious model of brightness induction in a continuum + of stimuli including White, Howe and simultaneous brightness contrast. + Vision Research, 45, 607-615. + Howe, P. D. L. (2001). + A comment on the Anderson (1997), the Todorovic (1997), + and the Ross and Pessoa (2000) explanations of White's effect. + Perception, 30, 1023-1026 """ height, width = 16.0, 16.0 @@ -426,8 +438,9 @@ def WE_zigzag(ppd=PPD, pad=True): References ----------- - Clifford, C. W. G., & Spehar, B. (2003). Using colour to disambiguate contrast and - assimilation in White’s effect. Journal of Vision, 3, 294a. + Clifford, C. W. G., & Spehar, B. (2003). + Using colour to disambiguate contrast and assimilation in White's effect. + Journal of Vision, 3, 294a. https://doi.org/10.1167/3.9.294 """ @@ -469,7 +482,9 @@ def WE_radial_thick_small(ppd=PPD, pad=True): References ----------- - Anstis, S. (2003). White’s effect in brightness & color. Online Demonstration + Anstis, S. (2003). + White's effect in brightness & color. + Online Demonstration """ n_segments = 14 @@ -521,8 +536,10 @@ def WE_radial_thick(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- - Anstis, S. (2003). White’s effect in brightness & color. Online Demonstration + ---------- + Anstis, S. (2003). + White's effect in brightness & color. + Online Demonstration """ n_segments = 18 @@ -574,8 +591,10 @@ def WE_radial_thin_small(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- - Anstis, S. (2003). White’s effect in brightness & color. Online Demonstration + ---------- + Anstis, S. (2003). + White's effect in brightness & color. + Online Demonstration """ n_segments = 26 @@ -627,8 +646,10 @@ def WE_radial_thin(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- - Anstis, S. (2003). White’s effect in brightness & color. Online Demonstration + ---------- + Anstis, S. (2003). + White's effect in brightness & color. + Online Demonstration """ n_segments = 42 @@ -680,9 +701,11 @@ def WE_circular1(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- - Howe, P. D. L. (2005). White’s effect: removing the junctions but preserving the strength - of the illusion. Perception, 34, 557–564. + ---------- + Howe, P. D. L. (2005). + White's effect: + removing the junctions but preserving the strength of the illusion. + Perception, 34, 557-564. """ height, width = 16.0, 16.0 @@ -739,8 +762,10 @@ def WE_circular05(ppd=PPD, pad=True): References ----------- - Howe, P. D. L. (2005). White’s effect: removing the junctions but preserving the strength - of the illusion. Perception, 34, 557–564. + Howe, P. D. L. (2005). + White's effect: + removing the junctions but preserving the strength of the illusion. + Perception, 34, 557-564. """ height, width = 16.0, 16.0 @@ -797,8 +822,10 @@ def WE_circular025(ppd=PPD, pad=True): References ----------- - Howe, P. D. L. (2005). White’s effect: removing the junctions but preserving the strength - of the illusion. Perception, 34, 557–564. + Howe, P. D. L. (2005). + White's effect: + removing the junctions but preserving the strength of the illusion. + Perception, 34, 557-564. """ height, width = 16.0, 16.0 @@ -855,11 +882,14 @@ def grating_induction(ppd=PPD, pad=True): References ----------- - Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the - White effect, simultaneous brightness contrast and grating induction. Vision - Research, 39, 4361–4377. - McCourt, M. E. (1982). A spatial frequency dependent grating-induction effect. Vision - Research, 22, 119–134. + Blakeslee, B., & McCourt, M. E. (1999). + A multiscale spatial filtering account + of the White effect, simultaneous brightness contrast and grating induction. + Vision Research, 39, 4361-4377. + McCourt, M. E. (1982). + A spatial frequency dependent grating-induction effect. + Vision Research, 22, 119-134. + https://doi.org/10.1016/0042-6989(82)90173-0 """ height, width = 12.0, 16.0 @@ -916,9 +946,10 @@ def sbc_large(ppd=PPD, pad=True): References ----------- - Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the - White effect, simultaneous brightness contrast and grating induction. Vision - Research, 39, 4361–4377. + Blakeslee, B., & McCourt, M. E. (1999). + A multiscale spatial filtering account + of the White effect, simultaneous brightness contrast and grating induction. + Vision Research, 39, 4361-4377. """ params = { @@ -975,9 +1006,10 @@ def sbc_small(ppd=PPD, pad=True): References ----------- - Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the - White effect, simultaneous brightness contrast and grating induction. Vision - Research, 39, 4361–4377. + Blakeslee, B., & McCourt, M. E. (1999). + A multiscale spatial filtering account + of the White effect, simultaneous brightness contrast and grating induction. + Vision Research, 39, 4361-4377. """ params = { @@ -1034,12 +1066,13 @@ def todorovic_equal(ppd=PPD, pad=True): References ----------- - Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the - White effect, simultaneous brightness contrast and grating induction. Vision - Research, 39, 4361–4377. - Pessoa, L., Baratoff, G., Neumann, H., & Todorovic, D. (1998). Lightness and junctions: - variations on White’s display. Investigative Ophthalmology and Visual Science - (Supplement), 39, S159. + Blakeslee, B., & McCourt, M. E. (1999). + A multiscale spatial filtering account + of the White effect, simultaneous brightness contrast and grating induction. + Vision Research, 39, 4361-4377. + Pessoa, L., Baratoff, G., Neumann, H., & Todorovic, D. (1998). + Lightness and junctions: variations on White's display. + Investigative Ophthalmology and Visual Science (Supplement), 39, S159. """ params = { @@ -1099,10 +1132,13 @@ def todorovic_in_large(ppd=PPD, pad=True): References ----------- - Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the - White effect, simultaneous brightness contrast and grating induction. Vision - Research, 39, 4361–4377. - Todorovic, D. (1997). Lightness and junctions. Perception, 26, 379–395. + Blakeslee, B., & McCourt, M. E. (1999). + A multiscale spatial filtering account + of the White effect, simultaneous brightness contrast and grating induction. + Vision Research, 39, 4361-4377. + Todorovic, D. (1997). + Lightness and junctions. + Perception, 26, 379-395. """ params = { @@ -1162,10 +1198,13 @@ def todorovic_in_small(ppd=PPD, pad=True): References ----------- - Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the - White effect, simultaneous brightness contrast and grating induction. Vision - Research, 39, 4361–4377. - Todorovic, D. (1997). Lightness and junctions. Perception, 26, 379–395. + Blakeslee, B., & McCourt, M. E. (1999). + A multiscale spatial filtering account + of the White effect, simultaneous brightness contrast and grating induction. + Vision Research, 39, 4361-4377. + Todorovic, D. (1997). + Lightness and junctions. + Perception, 26, 379-395. """ params = { @@ -1226,12 +1265,13 @@ def todorovic_out(ppd=PPD, pad=True): References ----------- - Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the - White effect, simultaneous brightness contrast and grating induction. Vision - Research, 39, 4361–4377. - Pessoa, L., Baratoff, G., Neumann, H., & Todorovic, D. (1998). Lightness and junctions: - variations on White’s display. Investigative Ophthalmology and Visual Science - (Supplement), 39, S159. + Blakeslee, B., & McCourt, M. E. (1999). + A multiscale spatial filtering account + of the White effect, simultaneous brightness contrast and grating induction. + Vision Research, 39, 4361-4377. + Pessoa, L., Baratoff, G., Neumann, H., & Todorovic, D. (1998). + Lightness and junctions: variations on White's display. + Investigative Ophthalmology and Visual Science (Supplement), 39, S159. """ params = { @@ -1291,10 +1331,13 @@ def checkerboard_016(ppd=PPD, pad=True): References ----------- - Blakeslee, B., & McCourt, M. E. (2004). A unified theory of brightness contrast and - assimilation incorporating oriented multi-scale spatial filtering and contrast - normalization. Vision Research, 44, 2483–2503. - DeValois, R. L., & DeValois, K. K. (1988). Spatial vision. New York: Oxford University Press. + Blakeslee, B., & McCourt, M. E. (2004). + A unified theory of brightness contrast and assimilation + incorporating oriented multi-scale spatial filtering and contrast normalization. + Vision Research, 44, 2483-2503. + DeValois, R. L., & DeValois, K. K. (1988). + Spatial vision. + New York: Oxford University Press. """ nchecks_height, nchecks_width = 40, 102 @@ -1346,10 +1389,13 @@ def checkerboard_094(ppd=PPD, pad=True): References ----------- - Blakeslee, B., & McCourt, M. E. (2004). A unified theory of brightness contrast and - assimilation incorporating oriented multi-scale spatial filtering and contrast - normalization. Vision Research, 44, 2483–2503. - DeValois, R. L., & DeValois, K. K. (1988). Spatial vision. New York: Oxford University Press. + Blakeslee, B., & McCourt, M. E. (2004). + A unified theory of brightness contrast and assimilation + incorporating oriented multi-scale spatial filtering and contrast normalization. + Vision Research, 44, 2483-2503. + DeValois, R. L., & DeValois, K. K. (1988). + Spatial vision. + New York: Oxford University Press. """ nchecks_height, nchecks_width = 7, 25 @@ -1401,10 +1447,13 @@ def checkerboard_21(ppd=PPD, pad=True): References ----------- - Blakeslee, B., & McCourt, M. E. (2004). A unified theory of brightness contrast and - assimilation incorporating oriented multi-scale spatial filtering and contrast - normalization. Vision Research, 44, 2483–2503. - DeValois, R. L., & DeValois, K. K. (1988). Spatial vision. New York: Oxford University Press. + Blakeslee, B., & McCourt, M. E. (2004). + A unified theory of brightness contrast and assimilation + incorporating oriented multi-scale spatial filtering and contrast normalization. + Vision Research, 44, 2483-2503. + DeValois, R. L., & DeValois, K. K. (1988). + Spatial vision. + New York: Oxford University Press. """ nchecks_height, nchecks_width = 3, 10 @@ -1454,10 +1503,14 @@ def corrugated_mondrian(ppd=PPD, pad=True): References ----------- - Blakeslee, B., & McCourt, M. E. (2001). A multiscale spatial filtering account of the - Wertheimer-Benary effect and the corrugated Mondrian. Vision Research, 41, 2487–2502. - Adelson, E. H. (1993). Perceptual organization and the judgment of brightness. Science, - 262, 2042–2044. + Blakeslee, B., & McCourt, M. E. (2001). + A multiscale spatial filtering account + of the Wertheimer-Benary effect and the corrugated Mondrian. + Vision Research, 41, 2487-2502. + Adelson, E. H. (1993). + Perceptual organization and the judgment of brightness. + Science, 262, 2042-2044. + https://doi.org/10.1126/science.8266102 """ v1, v2, v3, v4 = 0.0, 0.4, 0.75, 1.0 @@ -1513,10 +1566,14 @@ def benary_cross(ppd=PPD, pad=True): References ----------- - Blakeslee, B., & McCourt, M. E. (2001). A multiscale spatial filtering account of the - Wertheimer-Benary effect and the corrugated Mondrian. Vision Research, 41, 2487–2502. - Benary, W. (1924). Beobachtungen zu einem Experiment über Helligkeitskontrast. - Psychologische Forschung, 5, 131–142. + Blakeslee, B., & McCourt, M. E. (2001). + A multiscale spatial filtering account + of the Wertheimer-Benary effect and the corrugated Mondrian. + Vision Research, 41, 2487-2502. + Benary, W. (1924). + Beobachtungen zu einem Experiment über Helligkeitskontrast. + Psychologische Forschung, 5, 131-142. + https://doi.org/10.1007/BF00402398 """ params = { @@ -1575,9 +1632,13 @@ def todorovic_benary1_2(ppd=PPD, pad=True): References ----------- - Blakeslee, B., & McCourt, M. E. (2001). A multiscale spatial filtering account of the - Wertheimer-Benary effect and the corrugated Mondrian. Vision Research, 41, 2487–2502. - Todorovic, D. (1997). Lightness and junctions. Perception, 26, 379–395. + Blakeslee, B., & McCourt, M. E. (2001). + A multiscale spatial filtering account + of the Wertheimer-Benary effect and the corrugated Mondrian. + Vision Research, 41, 2487-2502. + Todorovic, D. (1997). + Lightness and junctions. + Perception, 26, 379-395. """ params = { @@ -1633,9 +1694,13 @@ def todorovic_benary3_4(ppd=PPD, pad=True): References ----------- - Blakeslee, B., & McCourt, M. E. (2001). A multiscale spatial filtering account of the - Wertheimer-Benary effect and the corrugated Mondrian. Vision Research, 41, 2487–2502. - Todorovic, D. (1997). Lightness and junctions. Perception, 26, 379–395. + Blakeslee, B., & McCourt, M. E. (2001). + A multiscale spatial filtering account + of the Wertheimer-Benary effect and the corrugated Mondrian. + Vision Research, 41, 2487-2502. + Todorovic, D. (1997). + Lightness and junctions. + Perception, 26, 379-395. """ params = { @@ -1691,9 +1756,13 @@ def todorovic_benary1_2_3_4(ppd=PPD, pad=True): References ----------- - Blakeslee, B., & McCourt, M. E. (2001). A multiscale spatial filtering account of the - Wertheimer-Benary effect and the corrugated Mondrian. Vision Research, 41, 2487–2502. - Todorovic, D. (1997). Lightness and junctions. Perception, 26, 379–395. + Blakeslee, B., & McCourt, M. E. (2001). + A multiscale spatial filtering account + of the Wertheimer-Benary effect and the corrugated Mondrian. + Vision Research, 41, 2487-2502. + Todorovic, D. (1997). + Lightness and junctions. + Perception, 26, 379-395. """ params = { @@ -1745,8 +1814,10 @@ def bullseye_thin(ppd=PPD, pad=True): References ----------- - Bindman, D., & Chubb, C. (2004). Brightness assimilation in bullseye displays. Vision - Research, 44, 309–319. + Bindman, D., & Chubb, C. (2004). + Brightness assimilation in bullseye displays. + Vision Research, 44, 309-319. + https://doi.org/10.1016/S0042-6989(03)00430-9 """ frame_radii = np.array([0.304, 0.426, 0.548, 0.670, 0.792]) @@ -1804,8 +1875,10 @@ def bullseye_thick(ppd=PPD, pad=True): References ----------- - Bindman, D., & Chubb, C. (2004). Brightness assimilation in bullseye displays. Vision - Research, 44, 309–319. + Bindman, D., & Chubb, C. (2004). + Brightness assimilation in bullseye displays. + Vision Research, 44, 309-319. + https://doi.org/10.1016/S0042-6989(03)00430-9 """ frame_radii = np.array([0.304, 0.547, 0.790, 1.033, 1.276]) diff --git a/stimupy/papers/carney1999.py b/stimupy/papers/carney1999.py index 1aafc7be..e8f69d2a 100644 --- a/stimupy/papers/carney1999.py +++ b/stimupy/papers/carney1999.py @@ -25,9 +25,11 @@ References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ from pathlib import Path @@ -138,9 +140,11 @@ def GaborPatch1(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -185,9 +189,11 @@ def GaborPatch2(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -232,9 +238,11 @@ def GaborPatch3(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -279,9 +287,11 @@ def GaborPatch4(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -326,9 +336,11 @@ def GaborPatch5(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -373,9 +385,11 @@ def GaborPatch6(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -420,9 +434,11 @@ def GaborPatch7(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -467,9 +483,11 @@ def GaborPatch8(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -514,9 +532,11 @@ def GaborPatch9(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -561,9 +581,11 @@ def GaborPatch10(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -608,9 +630,11 @@ def GaborPatch11(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -655,9 +679,11 @@ def GaborPatch12(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -702,9 +728,11 @@ def GaborPatch13(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -749,9 +777,11 @@ def GaborPatch14(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -796,9 +826,11 @@ def ElongatedGabor15(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -843,9 +875,11 @@ def ElongatedGabor16(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -890,9 +924,11 @@ def ElongatedGabor17(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -937,9 +973,11 @@ def Baguette18(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -984,9 +1022,11 @@ def Baguette19(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -1031,9 +1071,11 @@ def Baguette20(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -1078,9 +1120,11 @@ def Baguette21(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -1125,9 +1169,11 @@ def Subthreshold22(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -1179,9 +1225,11 @@ def Subthreshold23(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -1233,9 +1281,11 @@ def Subthreshold24(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -1287,9 +1337,11 @@ def Subthreshold25(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -1340,9 +1392,11 @@ def Gaussians26(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -1384,9 +1438,11 @@ def Gaussians27(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -1428,9 +1484,11 @@ def Gaussians28(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -1472,9 +1530,11 @@ def Gaussians29(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -1516,9 +1576,11 @@ def Edge30(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ stim = gaussian_edge(visual_size=256 / PPD, ppd=ppd, rotation=90, sigma=0.5) @@ -1553,9 +1615,11 @@ def Line31(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ stim = lines.line( @@ -1603,9 +1667,11 @@ def Dipole32(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ stim = lines.dipole( @@ -1654,9 +1720,11 @@ def GaborString33(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -1712,9 +1780,11 @@ def GaborString34(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -1771,9 +1841,11 @@ def Noise35_random(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ stim = binary_noise(visual_size=256 / PPD, ppd=ppd / 2, rms_contrast=1) @@ -1804,9 +1876,11 @@ def Noise35(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ # Read natural image from Modelfest img = read_tif(Path(__file__).parents[0] / "carney1999_noise.tif") @@ -1852,9 +1926,11 @@ def Orientation36(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -1900,9 +1976,11 @@ def Orientation37(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -1948,9 +2026,11 @@ def Plaids38(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -2001,9 +2081,11 @@ def Plaids39(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { @@ -2052,9 +2134,11 @@ def Disk40(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ stim = shapes.disc(visual_size=256 / PPD, ppd=ppd, radius=0.125, origin="center") @@ -2090,9 +2174,11 @@ def Bessel41(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ stim = bessel(visual_size=256 / PPD, ppd=ppd, frequency=4, origin="center") @@ -2135,9 +2221,11 @@ def Checkerboard42(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ params = { "visual_size": 256 / PPD, @@ -2183,9 +2271,11 @@ def NaturalScene43(ppd=PPD): References ----------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., - ... & Eckstein, M. P. (1999). Development of an image/threshold database - for designing and testing human vision models. Proceedings of SPIE, 3644, - 542-551. https://doi.org/10.1117/12.348473 + ... & Eckstein, M. P. (1999). + Development of an image/threshold database + for designing and testing human vision models. + Proceedings of SPIE, 3644, 542-551. + https://doi.org/10.1117/12.348473 """ # Read natural image from Modelfest diff --git a/stimupy/papers/domijan2015.py b/stimupy/papers/domijan2015.py index 8cfe6973..e0b326ee 100644 --- a/stimupy/papers/domijan2015.py +++ b/stimupy/papers/domijan2015.py @@ -29,9 +29,11 @@ References ----------- -Domijan, D. (2015). A neurocomputational account of the role of contour -facilitation in brightness perception. Frontiers in Human Neuroscience, -9, 93. https://doi.org/10.3389/fnhum.2015.00093 +Domijan, D. (2015). + A neurocomputational account + of the role of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9, 93. + https://doi.org/10.3389/fnhum.2015.00093 """ import numpy as np @@ -204,10 +206,12 @@ def dungeon(visual_size=VSIZES["dungeon"], ppd=PPD, shape=SHAPES["dungeon"]): and additional keys containing stimulus parameters References - ----------- - Domijan, D. (2015). A neurocomputational account of the role of contour - facilitation in brightness perception. Frontiers in Human Neuroscience, - 9, 93. https://doi.org/10.3389/fnhum.2015.00093 + ---------- + Domijan, D. (2015). + A neurocomputational account + of the role of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9, 93. + https://doi.org/10.3389/fnhum.2015.00093 """ # Resolve resolution @@ -273,10 +277,12 @@ def cube(visual_size=VSIZES["cube"], ppd=PPD, shape=SHAPES["cube"]): and additional keys containing stimulus parameters References - ----------- - Domijan, D. (2015). A neurocomputational account of the role of contour - facilitation in brightness perception. Frontiers in Human Neuroscience, - 9, 93. https://doi.org/10.3389/fnhum.2015.00093 + ---------- + Domijan, D. (2015). + A neurocomputational account + of the role of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9, 93. + https://doi.org/10.3389/fnhum.2015.00093 """ # Resolve resolution @@ -341,10 +347,12 @@ def grating(visual_size=VSIZES["grating"], ppd=PPD, shape=SHAPES["grating"]): and additional keys containing stimulus parameters References - ----------- - Domijan, D. (2015). A neurocomputational account of the role of contour - facilitation in brightness perception. Frontiers in Human Neuroscience, - 9, 93. https://doi.org/10.3389/fnhum.2015.00093 + ---------- + Domijan, D. (2015). + A neurocomputational account + of the role of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9, 93. + https://doi.org/10.3389/fnhum.2015.00093 """ # Resolve resolution @@ -411,10 +419,12 @@ def rings(visual_size=VSIZES["rings"], ppd=PPD, shape=SHAPES["rings"]): and additional keys containing stimulus parameters References - ----------- - Domijan, D. (2015). A neurocomputational account of the role of contour - facilitation in brightness perception. Frontiers in Human Neuroscience, - 9, 93. https://doi.org/10.3389/fnhum.2015.00093 + ---------- + Domijan, D. (2015). + A neurocomputational account + of the role of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9, 93. + https://doi.org/10.3389/fnhum.2015.00093 """ # Resolve resolution @@ -476,10 +486,12 @@ def bullseye(visual_size=VSIZES["bullseye"], ppd=PPD, shape=SHAPES["bullseye"]): and additional keys containing stimulus parameters References - ----------- - Domijan, D. (2015). A neurocomputational account of the role of contour - facilitation in brightness perception. Frontiers in Human Neuroscience, - 9, 93. https://doi.org/10.3389/fnhum.2015.00093 + ---------- + Domijan, D. (2015). + A neurocomputational account + of the role of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9, 93. + https://doi.org/10.3389/fnhum.2015.00093 """ # Resolve resolution @@ -543,10 +555,12 @@ def simultaneous_brightness_contrast( and additional keys containing stimulus parameters References - ----------- - Domijan, D. (2015). A neurocomputational account of the role of contour - facilitation in brightness perception. Frontiers in Human Neuroscience, - 9, 93. https://doi.org/10.3389/fnhum.2015.00093 + ---------- + Domijan, D. (2015). + A neurocomputational account + of the role of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9, 93. + https://doi.org/10.3389/fnhum.2015.00093 """ # Resolve resolution @@ -609,10 +623,12 @@ def white(visual_size=VSIZES["white"], ppd=PPD, pad=PAD, shape=SHAPES["white"]): and additional keys containing stimulus parameters References - ----------- - Domijan, D. (2015). A neurocomputational account of the role of contour - facilitation in brightness perception. Frontiers in Human Neuroscience, - 9, 93. https://doi.org/10.3389/fnhum.2015.00093 + ---------- + Domijan, D. (2015). + A neurocomputational account + of the role of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9, 93. + https://doi.org/10.3389/fnhum.2015.00093 """ # Resolve resolution @@ -675,10 +691,12 @@ def benary(visual_size=VSIZES["benary"], ppd=PPD, shape=SHAPES["benary"]): and additional keys containing stimulus parameters References - ----------- - Domijan, D. (2015). A neurocomputational account of the role of contour - facilitation in brightness perception. Frontiers in Human Neuroscience, - 9, 93. https://doi.org/10.3389/fnhum.2015.00093 + ---------- + Domijan, D. (2015). + A neurocomputational account + of the role of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9, 93. + https://doi.org/10.3389/fnhum.2015.00093 """ # Resolve resolution @@ -734,10 +752,12 @@ def todorovic(visual_size=VSIZES["todorovic"], ppd=PPD, shape=SHAPES["todorovic" and additional keys containing stimulus parameters References - ----------- - Domijan, D. (2015). A neurocomputational account of the role of contour - facilitation in brightness perception. Frontiers in Human Neuroscience, - 9, 93. https://doi.org/10.3389/fnhum.2015.00093 + ---------- + Domijan, D. (2015). + A neurocomputational account + of the role of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9, 93. + https://doi.org/10.3389/fnhum.2015.00093 """ # Note: Compared to original, targets are moved by one pixel @@ -807,10 +827,12 @@ def checkerboard_contrast_contrast( and additional keys containing stimulus parameters References - ----------- - Domijan, D. (2015). A neurocomputational account of the role of contour - facilitation in brightness perception. Frontiers in Human Neuroscience, - 9, 93. https://doi.org/10.3389/fnhum.2015.00093 + ---------- + Domijan, D. (2015). + A neurocomputational account + of the role of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9, 93. + https://doi.org/10.3389/fnhum.2015.00093 """ # Resolve resolution @@ -895,10 +917,12 @@ def checkerboard( and additional keys containing stimulus parameters References - ----------- - Domijan, D. (2015). A neurocomputational account of the role of contour - facilitation in brightness perception. Frontiers in Human Neuroscience, - 9, 93. https://doi.org/10.3389/fnhum.2015.00093 + ---------- + Domijan, D. (2015). + A neurocomputational account + of the role of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9, 93. + https://doi.org/10.3389/fnhum.2015.00093 """ # Resolve resolution @@ -966,10 +990,12 @@ def checkerboard_extended( and additional keys containing stimulus parameters References - ----------- - Domijan, D. (2015). A neurocomputational account of the role of contour - facilitation in brightness perception. Frontiers in Human Neuroscience, - 9, 93. https://doi.org/10.3389/fnhum.2015.00093 + ---------- + Domijan, D. (2015). + A neurocomputational account + of the role of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9, 93. + https://doi.org/10.3389/fnhum.2015.00093 """ # Resolve resolution @@ -1034,12 +1060,15 @@ def white_yazdanbakhsh( and additional keys containing stimulus parameters References - ----------- - Domijan, D. (2015). A neurocomputational account of the role of contour - facilitation in brightness perception. Frontiers in Human Neuroscience, - 9, 93. https://doi.org/10.3389/fnhum.2015.00093 - Yazdanbakhsh, A., Arabzadeh, E., Babadi, B., and Fazl, A. (2002). Munker-White- - like illusions without T-junctions. Perception 31, 711–715. + ---------- + Domijan, D. (2015). + A neurocomputational account + of the role of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9, 93. + https://doi.org/10.3389/fnhum.2015.00093 + Yazdanbakhsh, A., Arabzadeh, E., Babadi, B., and Fazl, A. (2002). + Munker-White-like illusions without T-junctions. + Perception 31, 711-715. https://doi.org/10.1068/p3348 """ @@ -1113,15 +1142,20 @@ def white_anderson( and additional keys containing stimulus parameters References - ----------- - Anderson, B. L. (2001). Contrasting theories of White’s illusion. Perception, 30, 1499–1501 - Blakeslee, B., Pasieka, W., & McCourt, M. E. (2005). Oriented multiscale spatial filtering - and contrast normalization: a parsimonious model of brightness induction in a continuum - of stimuli including White, Howe and simultaneous brightness contrast. Vision Research, - 45, 607–615. - Domijan, D. (2015). A neurocomputational account of the role of contour - facilitation in brightness perception. Frontiers in Human Neuroscience, - 9, 93. https://doi.org/10.3389/fnhum.2015.00093 + ---------- + Anderson, B. L. (2001). + Contrasting theories of White's illusion. + Perception, 30, 1499-1501. + Blakeslee, B., Pasieka, W., & McCourt, M. E. (2005). + Oriented multiscale spatial filtering and contrast normalization: + a parsimonious model of brightness induction in a continuum + of stimuli including White, Howe and simultaneous brightness contrast. + Vision Research, 45, 607-615. + Domijan, D. (2015). + A neurocomputational account + of the role of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9, 93. + https://doi.org/10.3389/fnhum.2015.00093 """ # Resolve resolution @@ -1193,16 +1227,21 @@ def white_howe(visual_size=VSIZES["white_howe"], ppd=PPD, shape=SHAPES["white_ho and additional keys containing stimulus parameters References - ----------- - Blakeslee, B., Pasieka, W., & McCourt, M. E. (2005). Oriented multiscale spatial filtering - and contrast normalization: a parsimonious model of brightness induction in a continuum - of stimuli including White, Howe and simultaneous brightness contrast. Vision Research, - 45, 607–615. - Domijan, D. (2015). A neurocomputational account of the role of contour - facilitation in brightness perception. Frontiers in Human Neuroscience, - 9, 93. https://doi.org/10.3389/fnhum.2015.00093 - Howe, P. D. L. (2001). A comment on the Anderson (1997), the Todorovic (1997), and the Ross - and Pessoa (2000) explanations of White’s effect. Perception, 30, 1023–1026 + ---------- + Blakeslee, B., Pasieka, W., & McCourt, M. E. (2005). + Oriented multiscale spatial filtering and contrast normalization: + a parsimonious model of brightness induction in a continuum + of stimuli including White, Howe and simultaneous brightness contrast. + Vision Research, 45, 607-615. + Domijan, D. (2015). + A neurocomputational account + of the role of contour facilitation in brightness perception. + Frontiers in Human Neuroscience, 9, 93. + https://doi.org/10.3389/fnhum.2015.00093 + Howe, P. D. L. (2001). + A comment on the Anderson (1997), the Todorovic (1997), + and the Ross nd Pessoa (2000) explanations of White's effect. + Perception, 30, 1023-1026 """ # Resolve resolution diff --git a/stimupy/papers/murray2020.py b/stimupy/papers/murray2020.py index f3ec1d57..89103b00 100644 --- a/stimupy/papers/murray2020.py +++ b/stimupy/papers/murray2020.py @@ -24,9 +24,11 @@ References ----------- -Murray, R. F. (2020). A model of lightness perception guided by -probabilistic assumptions about lighting and reflectance. -Journal of Vision, 20(7), 28. https://doi.org/10/gh57gf +Murray, R. F. (2020). + A model of lightness perception + guided by probabilistic assumptions about lighting and reflectance. + Journal of Vision, 20(7), 28. + https://doi.org/10/gh57gf """ import os.path @@ -120,9 +122,11 @@ def argyle(ppd=PPD): References ----------- - Murray, R. F. (2020). A model of lightness perception guided by - probabilistic assumptions about lighting and reflectance. - Journal of Vision, 20(7), 28. https://doi.org/10/gh57gf + Murray, R. F. (2020). + A model of lightness perception + guided by probabilistic assumptions about lighting and reflectance. + Journal of Vision, 20(7), 28. + https://doi.org/10/gh57gf """ a = mat_content["argyle"] @@ -170,9 +174,11 @@ def argyle_control(ppd=PPD): References ----------- - Murray, R. F. (2020). A model of lightness perception guided by - probabilistic assumptions about lighting and reflectance. - Journal of Vision, 20(7), 28. https://doi.org/10/gh57gf + Murray, R. F. (2020). + A model of lightness perception + guided by probabilistic assumptions about lighting and reflectance. + Journal of Vision, 20(7), 28. + https://doi.org/10/gh57gf """ a = mat_content["argyle_control"] @@ -222,9 +228,11 @@ def argyle_long(ppd=PPD): References ----------- - Murray, R. F. (2020). A model of lightness perception guided by - probabilistic assumptions about lighting and reflectance. - Journal of Vision, 20(7), 28. https://doi.org/10/gh57gf + Murray, R. F. (2020). + A model of lightness perception + guided by probabilistic assumptions about lighting and reflectance. + Journal of Vision, 20(7), 28. + https://doi.org/10/gh57gf """ a = mat_content["argyle_long"] @@ -274,9 +282,11 @@ def snake(ppd=PPD): References ----------- - Murray, R. F. (2020). A model of lightness perception guided by - probabilistic assumptions about lighting and reflectance. - Journal of Vision, 20(7), 28. https://doi.org/10/gh57gf + Murray, R. F. (2020). + A model of lightness perception + guided by probabilistic assumptions about lighting and reflectance. + Journal of Vision, 20(7), 28. + https://doi.org/10/gh57gf """ a = mat_content["snake"] @@ -326,9 +336,11 @@ def snake_control(ppd=PPD): References ----------- - Murray, R. F. (2020). A model of lightness perception guided by - probabilistic assumptions about lighting and reflectance. - Journal of Vision, 20(7), 28. https://doi.org/10/gh57gf + Murray, R. F. (2020). + A model of lightness perception + guided by probabilistic assumptions about lighting and reflectance. + Journal of Vision, 20(7), 28. + https://doi.org/10/gh57gf """ a = mat_content["snake_control"] @@ -378,9 +390,11 @@ def koffka_adelson(ppd=PPD): References ----------- - Murray, R. F. (2020). A model of lightness perception guided by - probabilistic assumptions about lighting and reflectance. - Journal of Vision, 20(7), 28. https://doi.org/10/gh57gf + Murray, R. F. (2020). + A model of lightness perception + guided by probabilistic assumptions about lighting and reflectance. + Journal of Vision, 20(7), 28. + https://doi.org/10/gh57gf """ a = mat_content["koffka_adelson"] @@ -430,9 +444,11 @@ def koffka_broken(ppd=PPD): References ----------- - Murray, R. F. (2020). A model of lightness perception guided by - probabilistic assumptions about lighting and reflectance. - Journal of Vision, 20(7), 28. https://doi.org/10/gh57gf + Murray, R. F. (2020). + A model of lightness perception + guided by probabilistic assumptions about lighting and reflectance. + Journal of Vision, 20(7), 28. + https://doi.org/10/gh57gf """ a = mat_content["koffka_broken"] @@ -482,9 +498,11 @@ def koffka_connected(ppd=PPD): References ----------- - Murray, R. F. (2020). A model of lightness perception guided by - probabilistic assumptions about lighting and reflectance. - Journal of Vision, 20(7), 28. https://doi.org/10/gh57gf + Murray, R. F. (2020). + A model of lightness perception + guided by probabilistic assumptions about lighting and reflectance. + Journal of Vision, 20(7), 28. + https://doi.org/10/gh57gf """ a = mat_content["koffka_connected"] @@ -534,9 +552,11 @@ def checkassim(ppd=PPD, pad=PAD): References ----------- - Murray, R. F. (2020). A model of lightness perception guided by - probabilistic assumptions about lighting and reflectance. - Journal of Vision, 20(7), 28. https://doi.org/10/gh57gf + Murray, R. F. (2020). + A model of lightness perception + guided by probabilistic assumptions about lighting and reflectance. + Journal of Vision, 20(7), 28. + https://doi.org/10/gh57gf """ params = { @@ -592,9 +612,11 @@ def simcon(ppd=PPD): References ----------- - Murray, R. F. (2020). A model of lightness perception guided by - probabilistic assumptions about lighting and reflectance. - Journal of Vision, 20(7), 28. https://doi.org/10/gh57gf + Murray, R. F. (2020). + A model of lightness perception + guided by probabilistic assumptions about lighting and reflectance. + Journal of Vision, 20(7), 28. + https://doi.org/10/gh57gf """ a = mat_content["simcon"] @@ -644,9 +666,11 @@ def simcon_articulated(ppd=PPD): References ----------- - Murray, R. F. (2020). A model of lightness perception guided by - probabilistic assumptions about lighting and reflectance. - Journal of Vision, 20(7), 28. https://doi.org/10/gh57gf + Murray, R. F. (2020). + A model of lightness perception + guided by probabilistic assumptions about lighting and reflectance. + Journal of Vision, 20(7), 28. + https://doi.org/10/gh57gf """ a = mat_content["simcon_articulated"] @@ -696,9 +720,11 @@ def white(ppd=PPD): References ----------- - Murray, R. F. (2020). A model of lightness perception guided by - probabilistic assumptions about lighting and reflectance. - Journal of Vision, 20(7), 28. https://doi.org/10/gh57gf + Murray, R. F. (2020). + A model of lightness perception + guided by probabilistic assumptions about lighting and reflectance. + Journal of Vision, 20(7), 28. + https://doi.org/10/gh57gf """ params = { diff --git a/stimupy/papers/white1981.py b/stimupy/papers/white1981.py index cd7bc0e0..76ebffd6 100644 --- a/stimupy/papers/white1981.py +++ b/stimupy/papers/white1981.py @@ -22,9 +22,11 @@ References ----------- -White, M. (1981). The effect of the nature of the surround on the perceived - lightness of grey bars within square-wave test grating. Perception, 10, - 215–230. https://doi.org/10.1068/p100215 +White, M. (1981). + The effect of the nature of the surround on the perceived lightness + of grey bars within square-wave test grating. + Perception, 10, 215-230. + https://doi.org/10.1068/p100215 """ import copy @@ -110,9 +112,11 @@ def square_white(ppd=PPD): References ----------- - White, M. (1981). The effect of the nature of the surround on the perceived - lightness of grey bars within square-wave test grating. Perception, 10, - 215–230. + White, M. (1981). + The effect of the nature of the surround on the perceived lightness + of grey bars within square-wave test grating. + Perception, 10, 215-230. + https://doi.org/10.1068/p100215 """ params = { @@ -145,9 +149,11 @@ def square_black(ppd=PPD): References ----------- - White, M. (1981). The effect of the nature of the surround on the perceived - lightness of grey bars within square-wave test grating. Perception, 10, - 215–230. + White, M. (1981). + The effect of the nature of the surround on the perceived lightness + of grey bars within square-wave test grating. + Perception, 10, 215-230. + https://doi.org/10.1068/p100215 """ params = { @@ -181,9 +187,11 @@ def grating_white_white(ppd=PPD): References ----------- - White, M. (1981). The effect of the nature of the surround on the perceived - lightness of grey bars within square-wave test grating. Perception, 10, - 215–230. + White, M. (1981). + The effect of the nature of the surround on the perceived lightness + of grey bars within square-wave test grating. + Perception, 10, 215-230. + https://doi.org/10.1068/p100215 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) @@ -222,9 +230,11 @@ def grating_white_black(ppd=PPD): References ----------- - White, M. (1981). The effect of the nature of the surround on the perceived - lightness of grey bars within square-wave test grating. Perception, 10, - 215–230. + White, M. (1981). + The effect of the nature of the surround on the perceived lightness + of grey bars within square-wave test grating. + Perception, 10, 215-230. + https://doi.org/10.1068/p100215 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) @@ -263,9 +273,11 @@ def grating_black_white(ppd=PPD): References ----------- - White, M. (1981). The effect of the nature of the surround on the perceived - lightness of grey bars within square-wave test grating. Perception, 10, - 215–230. + White, M. (1981). + The effect of the nature of the surround on the perceived lightness + of grey bars within square-wave test grating. + Perception, 10, 215-230. + https://doi.org/10.1068/p100215 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) @@ -304,9 +316,11 @@ def grating_black_black(ppd=PPD): References ----------- - White, M. (1981). The effect of the nature of the surround on the perceived - lightness of grey bars within square-wave test grating. Perception, 10, - 215–230. + White, M. (1981). + The effect of the nature of the surround on the perceived lightness + of grey bars within square-wave test grating. + Perception, 10, 215-230. + https://doi.org/10.1068/p100215 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) @@ -345,9 +359,11 @@ def grating_white_in(ppd=PPD): References ----------- - White, M. (1981). The effect of the nature of the surround on the perceived - lightness of grey bars within square-wave test grating. Perception, 10, - 215–230. + White, M. (1981). + The effect of the nature of the surround on the perceived lightness + of grey bars within square-wave test grating. + Perception, 10, 215-230. + https://doi.org/10.1068/p100215 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) @@ -395,9 +411,11 @@ def grating_black_in(ppd=PPD): References ----------- - White, M. (1981). The effect of the nature of the surround on the perceived - lightness of grey bars within square-wave test grating. Perception, 10, - 215–230. + White, M. (1981). + The effect of the nature of the surround on the perceived lightness + of grey bars within square-wave test grating. + Perception, 10, 215-230. + https://doi.org/10.1068/p100215 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) @@ -445,9 +463,11 @@ def grating_white_out(ppd=PPD): References ----------- - White, M. (1981). The effect of the nature of the surround on the perceived - lightness of grey bars within square-wave test grating. Perception, 10, - 215–230. + White, M. (1981). + The effect of the nature of the surround on the perceived lightness + of grey bars within square-wave test grating. + Perception, 10, 215-230. + https://doi.org/10.1068/p100215 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) @@ -495,9 +515,11 @@ def grating_black_out(ppd=PPD): References ----------- - White, M. (1981). The effect of the nature of the surround on the perceived - lightness of grey bars within square-wave test grating. Perception, 10, - 215–230. + White, M. (1981). + The effect of the nature of the surround on the perceived lightness + of grey bars within square-wave test grating. + Perception, 10, 215-230. + https://doi.org/10.1068/p100215 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) @@ -545,9 +567,11 @@ def grating_white_orthogonal(ppd=PPD): References ----------- - White, M. (1981). The effect of the nature of the surround on the perceived - lightness of grey bars within square-wave test grating. Perception, 10, - 215–230. + White, M. (1981). + The effect of the nature of the surround on the perceived lightness + of grey bars within square-wave test grating. + Perception, 10, 215-230. + https://doi.org/10.1068/p100215 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) @@ -597,9 +621,11 @@ def grating_black_orthogonal(ppd=PPD): References ----------- - White, M. (1981). The effect of the nature of the surround on the perceived - lightness of grey bars within square-wave test grating. Perception, 10, - 215–230. + White, M. (1981). + The effect of the nature of the surround on the perceived lightness + of grey bars within square-wave test grating. + Perception, 10, 215-230. + https://doi.org/10.1068/p100215 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) diff --git a/stimupy/papers/white1985.py b/stimupy/papers/white1985.py index 4119b385..8b624672 100644 --- a/stimupy/papers/white1985.py +++ b/stimupy/papers/white1985.py @@ -22,8 +22,10 @@ References ----------- -White, M. & White, T. (1985). Counterphase lightness induction. Vision - research, 25 (9), 1331-1335. https://doi.org/10.1016/0042-6989(85)90049-5 +White, M. & White, T. (1985). + Counterphase lightness induction. + Vision Research, 25 (9), 1331-1335. + https://doi.org/10.1016/0042-6989(85)90049-5 """ import copy @@ -109,8 +111,10 @@ def wide_0phase(ppd=PPD): References ----------- - White, M. & White, T. (1985). Counterphase lightness induction. Vision research, - 25 (9), 1331-1335. https://doi.org/10.1016/0042-6989(85)90049-5 + White, M. & White, T. (1985). + Counterphase lightness induction. + Vision Research, 25 (9), 1331-1335. + https://doi.org/10.1016/0042-6989(85)90049-5 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) @@ -151,8 +155,10 @@ def wide_36phase(ppd=PPD): References ----------- - White, M. & White, T. (1985). Counterphase lightness induction. Vision research, - 25 (9), 1331-1335. https://doi.org/10.1016/0042-6989(85)90049-5 + White, M. & White, T. (1985). + Counterphase lightness induction. + Vision Research, 25 (9), 1331-1335. + https://doi.org/10.1016/0042-6989(85)90049-5 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) @@ -192,8 +198,10 @@ def wide_72phase(ppd=PPD): References ----------- - White, M. & White, T. (1985). Counterphase lightness induction. Vision research, - 25 (9), 1331-1335. https://doi.org/10.1016/0042-6989(85)90049-5 + White, M. & White, T. (1985). + Counterphase lightness induction. + Vision Research, 25 (9), 1331-1335. + https://doi.org/10.1016/0042-6989(85)90049-5 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) @@ -234,8 +242,10 @@ def wide_108phase(ppd=PPD): References ----------- - White, M. & White, T. (1985). Counterphase lightness induction. Vision research, - 25 (9), 1331-1335. https://doi.org/10.1016/0042-6989(85)90049-5 + White, M. & White, T. (1985). + Counterphase lightness induction. + Vision Research, 25 (9), 1331-1335. + https://doi.org/10.1016/0042-6989(85)90049-5 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) @@ -276,8 +286,10 @@ def wide_144phase(ppd=PPD): References ----------- - White, M. & White, T. (1985). Counterphase lightness induction. Vision research, - 25 (9), 1331-1335. https://doi.org/10.1016/0042-6989(85)90049-5 + White, M. & White, T. (1985). + Counterphase lightness induction. + Vision Research, 25 (9), 1331-1335. + https://doi.org/10.1016/0042-6989(85)90049-5 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) @@ -318,8 +330,10 @@ def wide_180phase(ppd=PPD): References ----------- - White, M. & White, T. (1985). Counterphase lightness induction. Vision research, - 25 (9), 1331-1335. https://doi.org/10.1016/0042-6989(85)90049-5 + White, M. & White, T. (1985). + Counterphase lightness induction. + Vision Research, 25 (9), 1331-1335. + https://doi.org/10.1016/0042-6989(85)90049-5 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) @@ -360,8 +374,10 @@ def square_0phase(ppd=PPD): References ----------- - White, M. & White, T. (1985). Counterphase lightness induction. Vision research, - 25 (9), 1331-1335. https://doi.org/10.1016/0042-6989(85)90049-5 + White, M. & White, T. (1985). + Counterphase lightness induction. + Vision Research, 25 (9), 1331-1335. + https://doi.org/10.1016/0042-6989(85)90049-5 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) @@ -402,8 +418,10 @@ def square_36phase(ppd=PPD): References ----------- - White, M. & White, T. (1985). Counterphase lightness induction. Vision research, - 25 (9), 1331-1335. https://doi.org/10.1016/0042-6989(85)90049-5 + White, M. & White, T. (1985). + Counterphase lightness induction. + Vision Research, 25 (9), 1331-1335. + https://doi.org/10.1016/0042-6989(85)90049-5 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) @@ -444,8 +462,10 @@ def square_72phase(ppd=PPD): References ----------- - White, M. & White, T. (1985). Counterphase lightness induction. Vision research, - 25 (9), 1331-1335. https://doi.org/10.1016/0042-6989(85)90049-5 + White, M. & White, T. (1985). + Counterphase lightness induction. + Vision Research, 25 (9), 1331-1335. + https://doi.org/10.1016/0042-6989(85)90049-5 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) @@ -486,8 +506,10 @@ def square_108phase(ppd=PPD): References ----------- - White, M. & White, T. (1985). Counterphase lightness induction. Vision research, - 25 (9), 1331-1335. https://doi.org/10.1016/0042-6989(85)90049-5 + White, M. & White, T. (1985). + Counterphase lightness induction. + Vision Research, 25 (9), 1331-1335. + https://doi.org/10.1016/0042-6989(85)90049-5 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) @@ -528,8 +550,10 @@ def square_144phase(ppd=PPD): References ----------- - White, M. & White, T. (1985). Counterphase lightness induction. Vision research, - 25 (9), 1331-1335. https://doi.org/10.1016/0042-6989(85)90049-5 + White, M. & White, T. (1985). + Counterphase lightness induction. + Vision Research, 25 (9), 1331-1335. + https://doi.org/10.1016/0042-6989(85)90049-5 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) @@ -570,8 +594,10 @@ def square_180phase(ppd=PPD): References ----------- - White, M. & White, T. (1985). Counterphase lightness induction. Vision research, - 25 (9), 1331-1335. https://doi.org/10.1016/0042-6989(85)90049-5 + White, M. & White, T. (1985). + Counterphase lightness induction. + Vision Research, 25 (9), 1331-1335. + https://doi.org/10.1016/0042-6989(85)90049-5 """ bar_width = resolve_bar_width(BAR_WIDTH, ppd) From ebf1cde1092ccdd17c1586f1bd3e8dbf115195c3 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Wed, 15 Mar 2023 13:52:36 +0100 Subject: [PATCH 37/43] Docs: bugfix RHS2007.todorovic_out docstring --- stimupy/papers/RHS2007.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stimupy/papers/RHS2007.py b/stimupy/papers/RHS2007.py index 359125ee..e2d7eea4 100644 --- a/stimupy/papers/RHS2007.py +++ b/stimupy/papers/RHS2007.py @@ -1247,8 +1247,9 @@ def todorovic_in_small(ppd=PPD, pad=True): def todorovic_out(ppd=PPD, pad=True): """Todorovic stimulus - out as shown in Robinson, Hammon, & de Sa (2007) Fig 1t. Stimulus size: 13x31 deg - Target size: 9.4x9.4 deg (note: in RHS2007, it says 8.7x8.7 deg, however that does not - match with Fig 1t) + Target size: 9.4x9.4 deg + + (note: in RHS2007, it says 8.7x8.7 deg, however that does not match with Fig 1t) Parameters ---------- From cdb7ebbd43aad64088842f6144b034e63363918a Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Wed, 15 Mar 2023 14:33:58 +0100 Subject: [PATCH 38/43] Docs: Fix and unify toplines in docstrings --- stimupy/components/edges.py | 3 +-- stimupy/components/gratings.py | 4 ++-- stimupy/components/lines.py | 6 +++--- stimupy/components/mondrians.py | 3 +-- stimupy/illusions/angulars.py | 3 +-- stimupy/illusions/benarys.py | 3 +-- stimupy/illusions/cornsweets.py | 4 ++-- stimupy/illusions/cubes.py | 7 ++----- stimupy/illusions/delboeufs.py | 6 ++---- stimupy/illusions/dungeons.py | 5 +---- stimupy/illusions/gratings.py | 6 ++---- stimupy/illusions/sbcs.py | 21 +++++++-------------- stimupy/illusions/todorovics.py | 28 +++++++--------------------- stimupy/illusions/wedding_cakes.py | 3 +-- stimupy/illusions/whites.py | 15 +++++---------- stimupy/noises/binaries.py | 3 +-- stimupy/noises/narrowbands.py | 3 +-- stimupy/noises/naturals.py | 9 +++------ stimupy/noises/utils.py | 10 ++++++---- stimupy/noises/whites.py | 3 +-- 20 files changed, 50 insertions(+), 95 deletions(-) diff --git a/stimupy/components/edges.py b/stimupy/components/edges.py index d31c5328..cce2856e 100644 --- a/stimupy/components/edges.py +++ b/stimupy/components/edges.py @@ -136,8 +136,7 @@ def cornsweet_edge( intensity_plateau=0.5, exponent=2.75, ): - """ - Create a matrix containing a rectangular Cornsweet edge stimulus. + """Draw rectangular Cornsweet edge stimulus. The 2D luminance profile of the stimulus is defined as Left side: v = vtarget + (1 - X / w) ** a * (intensity_max-vtarget) for the ramp and v = vtarget beyond. diff --git a/stimupy/components/gratings.py b/stimupy/components/gratings.py index 7f0f959f..9b708ab7 100644 --- a/stimupy/components/gratings.py +++ b/stimupy/components/gratings.py @@ -72,7 +72,7 @@ def shift_edges( intensity_bars=None, origin=None, ): - """Function to shift edges + """Shift edges Parameters ---------- @@ -675,7 +675,7 @@ def plaid( weight2=1, sigma=None, ): - """Create plaid consisting of two sine-wave gratings + """Draw plaid consisting of two sine-wave gratings Parameters ---------- diff --git a/stimupy/components/lines.py b/stimupy/components/lines.py index 5739d940..a4ca9709 100644 --- a/stimupy/components/lines.py +++ b/stimupy/components/lines.py @@ -26,7 +26,7 @@ def line( intensity_background=0, origin="corner", ): - """Draw a line given the input parameters + """Draw a line Parameters ---------- @@ -142,7 +142,7 @@ def dipole( rotation=0, intensity_lines=(0, 1), ): - """Draw a two centered parallel lines given the input parameters + """Draw a two centered parallel lines Parameters ---------- @@ -239,7 +239,7 @@ def circle( intensity_line=1, intensity_background=0, ): - """Draw a circle given the input parameters + """Draw a circle Parameters ---------- diff --git a/stimupy/components/mondrians.py b/stimupy/components/mondrians.py index 1ac5a40a..f5604698 100644 --- a/stimupy/components/mondrians.py +++ b/stimupy/components/mondrians.py @@ -17,8 +17,7 @@ def mondrians( mondrian_intensities=None, intensity_background=0.5, ): - """ - Draw Mondrians of given size and intensity at given position + """Draw Mondrians of given size and intensity at given position Parameters ---------- diff --git a/stimupy/illusions/angulars.py b/stimupy/illusions/angulars.py index 5690e64b..b21ce0e1 100644 --- a/stimupy/illusions/angulars.py +++ b/stimupy/illusions/angulars.py @@ -26,8 +26,7 @@ def pinwheel( intensity_target=0.5, origin="mean", ): - """ - Pinwheel or radial White stimulus + """Pinwheel / radial White stimulus Parameters ---------- diff --git a/stimupy/illusions/benarys.py b/stimupy/illusions/benarys.py index 626d54da..1737b2a3 100644 --- a/stimupy/illusions/benarys.py +++ b/stimupy/illusions/benarys.py @@ -30,8 +30,7 @@ def cross_generalized( intensity_cross=0.0, intensity_target=0.5, ): - """ - Benary's Cross Illusion + """Benary's Cross Illusion Parameters ---------- diff --git a/stimupy/illusions/cornsweets.py b/stimupy/illusions/cornsweets.py index 0b80a1cc..d73439e2 100644 --- a/stimupy/illusions/cornsweets.py +++ b/stimupy/illusions/cornsweets.py @@ -16,8 +16,8 @@ def cornsweet( intensity_plateau=0.5, exponent=2.75, ): - """ - Create a matrix containing a rectangular Cornsweet edge stimulus. + """Draw rectangular Cornsweet edge stimulus. + The 2D luminance profile of the stimulus is defined as Left side: v = vtarget + (1 - X / w) ** a * (intensity_max-vtarget) for the ramp and v = vtarget beyond. diff --git a/stimupy/illusions/cubes.py b/stimupy/illusions/cubes.py index 307665fe..3450bf2b 100644 --- a/stimupy/illusions/cubes.py +++ b/stimupy/illusions/cubes.py @@ -18,8 +18,7 @@ def varying_cells( intensity_grid=1.0, intensity_target=0.5, ): - """ - Cube stimulus (Agostini & Galmonte, 2002) with flexible cell sizes. + """Cube stimulus (Agostini & Galmonte, 2002) with flexible cell sizes. Parameters ---------- @@ -153,9 +152,7 @@ def cube( intensity_grid=1.0, intensity_target=0.5, ): - - """ - Cube illusion (Agostini & Galmonte, 2002) + """Cube illusion (Agostini & Galmonte, 2002) Parameters ---------- diff --git a/stimupy/illusions/delboeufs.py b/stimupy/illusions/delboeufs.py index 1f813bb8..7c58dccd 100644 --- a/stimupy/illusions/delboeufs.py +++ b/stimupy/illusions/delboeufs.py @@ -16,8 +16,7 @@ def delboeuf( intensity_target=0.0, intensity_background=1.0, ): - """ - Delboeuf stimulus + """Delboeuf's (1865) stimulus Parameters ---------- @@ -99,8 +98,7 @@ def two_sided( intensity_target=0.0, intensity_background=1.0, ): - """ - Two-sided Delboeuf stimulus + """Two-sided Delboeuf's (1865) stimulus Parameters ---------- diff --git a/stimupy/illusions/dungeons.py b/stimupy/illusions/dungeons.py index 86a5c236..58a9989e 100644 --- a/stimupy/illusions/dungeons.py +++ b/stimupy/illusions/dungeons.py @@ -18,8 +18,7 @@ def dungeon( intensity_grid=1.0, intensity_target=0.5, ): - """ - Dungeon stimulus (Bressan, 2001) with diamond target. + """Dungeon stimulus (Bressan, 2001) with diamond target. Parameters ---------- @@ -126,7 +125,6 @@ def resolve_dungeon_params( n_cells=None, cell_size=None, ): - # Try to resolve resolution try: shape, visual_size, ppd = resolution.resolve(shape=shape, visual_size=visual_size, ppd=ppd) @@ -161,7 +159,6 @@ def resolve_cells_1d( n_cells=None, cell_size=None, ): - # Try to resolve number and size of cells if cell_size is not None: cells_pd = 1 / cell_size / 2 diff --git a/stimupy/illusions/gratings.py b/stimupy/illusions/gratings.py index f7a5fb72..46b01325 100644 --- a/stimupy/illusions/gratings.py +++ b/stimupy/illusions/gratings.py @@ -462,8 +462,7 @@ def induction( intensity_target=0.5, origin="corner", ): - """ - Grating induction illusion using a sine-wave grating + """Grating induction illusion using a sine-wave grating Parameters ---------- @@ -567,8 +566,7 @@ def induction_blur( intensity_target=0.5, origin="corner", ): - """ - Grating induction illusion using a blurred square-wave grating + """Grating induction illusion using a blurred square-wave grating Parameters ---------- diff --git a/stimupy/illusions/sbcs.py b/stimupy/illusions/sbcs.py index 62c7c7d6..a19b4740 100644 --- a/stimupy/illusions/sbcs.py +++ b/stimupy/illusions/sbcs.py @@ -23,8 +23,7 @@ def generalized( intensity_background=0.0, intensity_target=0.5, ): - """ - Simultaneous contrast stimulus with free target placement. + """Simultaneous contrast stimulus with free target placement. Parameters ---------- @@ -90,8 +89,7 @@ def basic( intensity_background=0.0, intensity_target=0.5, ): - """ - Simultaneous contrast stimulus with central target. + """Simultaneous contrast stimulus with central target. Parameters ---------- @@ -142,8 +140,7 @@ def two_sided( intensity_backgrounds=(0.0, 1.0), intensity_target=0.5, ): - """ - Two-sided simultaneous contrast stimulus with central targets. + """Two-sided simultaneous contrast display with central targets. Parameters ---------- @@ -216,8 +213,7 @@ def with_dots( intensity_dots=1.0, intensity_target=0.5, ): - """ - Simultaneous contrast stimulus with dots + """Simultaneous contrast stimulus with dots Parameters ---------- @@ -354,8 +350,7 @@ def dotted( intensity_dots=1.0, intensity_target=0.5, ): - """ - Dotted simultaneous contrast + """Dotted simultaneous contrast Parameters ---------- @@ -491,8 +486,7 @@ def two_sided_with_dots( intensity_dots=(1.0, 0.0), intensity_target=0.5, ): - """ - Two-sided simultaneous contrast stimulus with dots + """Two-sided simultaneous contrast stimulus with dots Parameters ---------- @@ -584,8 +578,7 @@ def two_sided_dotted( intensity_dots=(1.0, 0.0), intensity_target=0.5, ): - """ - Two-sided dotted simultaneous contrast stimulus + """Two-sided dotted simultaneous contrast stimulus Parameters ---------- diff --git a/stimupy/illusions/todorovics.py b/stimupy/illusions/todorovics.py index cdeb3c83..992da737 100644 --- a/stimupy/illusions/todorovics.py +++ b/stimupy/illusions/todorovics.py @@ -29,9 +29,7 @@ def rectangle_generalized( intensity_target=0.5, intensity_covers=1.0, ): - """ - Todorovic's illusion with rectangular target and rectangular covers added with flexible - number of covers and flexible target and cover placement + """Rectangular target and rectangular covers added with flexible number of covers and flexible target and cover placement Parameters ---------- @@ -155,9 +153,7 @@ def rectangle( intensity_target=0.5, intensity_covers=1.0, ): - """ - Todorovic's illusion with rectangular target in the center and four rectangular - covers added symmetrically around target center + """Rectangular target in the center and four rectangular covers added symmetrically around target center Parameters ---------- @@ -252,9 +248,7 @@ def cross_generalized( intensity_target=0.5, intensity_covers=1.0, ): - """ - Todorovic's illusion with cross target and rectangular covers added with - flexible number of covers and flexible cover placement + """Cross target and rectangular covers added with flexible number of covers and flexible cover placement Parameters ---------- @@ -380,9 +374,7 @@ def cross( intensity_target=0.5, intensity_covers=1.0, ): - """ - Todorovic's illusion with cross target and four rectangular covers added - at inner cross corners + """Cross target and four rectangular covers added at inner cross corners Parameters ---------- @@ -477,9 +469,7 @@ def equal( intensity_target=0.5, intensity_covers=1.0, ): - """ - Todorovic's illusion with cross target and four rectangular covers added at - inner cross corners + """Cross target and four rectangular covers added at inner cross corners Parameters ---------- @@ -646,9 +636,7 @@ def two_sided_cross( intensity_target=0.5, intensity_covers=(1.0, 0.0), ): - """ - Two-sided Todorovic's illusion with cross target and four rectangular covers - added at inner cross corners + """Two-sided with cross target and four rectangular covers added at inner cross corners Parameters ---------- @@ -735,9 +723,7 @@ def two_sided_equal( intensity_target=0.5, intensity_covers=(1.0, 0.0), ): - """ - Two-sided Todorovic's illusion with cross target and four rectangular covers - added at inner cross corners + """Two-sided with cross target and four rectangular covers added at inner cross corners Parameters ---------- diff --git a/stimupy/illusions/wedding_cakes.py b/stimupy/illusions/wedding_cakes.py index 43cddb43..b47a3f23 100644 --- a/stimupy/illusions/wedding_cakes.py +++ b/stimupy/illusions/wedding_cakes.py @@ -21,8 +21,7 @@ def wedding_cake( intensity_grating=(1.0, 0.0), intensity_target=0.5, ): - """ - Wedding cake stimulus + """Wedding cake stimulus Parameters ---------- diff --git a/stimupy/illusions/whites.py b/stimupy/illusions/whites.py index 7ce21c0d..7e590f0a 100644 --- a/stimupy/illusions/whites.py +++ b/stimupy/illusions/whites.py @@ -188,8 +188,7 @@ def white( target_height=None, origin="corner", ): - """ - White's stimulus where all targets are vertically aligned at half the stimulus height + """White's stimulus where all targets are vertically aligned at half the stimulus height Parameters ---------- @@ -283,8 +282,7 @@ def white_two_rows( target_height=None, origin="corner", ): - """ - White's stimulus where targets are placed in two rows (top, bottom) that have the same + """White's stimulus where targets are placed in two rows (top, bottom) that have the same distance from the center. Parameters @@ -392,8 +390,7 @@ def anderson( stripe_center_offset=0, stripe_height=None, ): - """ - Anderson variation of White's stimulus + """Anderson variation of White's stimulus Parameters ---------- @@ -541,8 +538,7 @@ def howe( target_height=None, intensity_stripes=(1.0, 0.0), ): - """ - Howe variation of White's stimulus + """Howe variation of White's stimulus Parameters ---------- @@ -633,8 +629,7 @@ def yazdanbakhsh( intensity_stripes=(1.0, 0.0), gap_size=None, ): - """ - Yazsdanbakhsh variation of White's stimulus + """Yazsdanbakhsh variation of White's stimulus Parameters ---------- diff --git a/stimupy/noises/binaries.py b/stimupy/noises/binaries.py index cb12765a..c2104820 100644 --- a/stimupy/noises/binaries.py +++ b/stimupy/noises/binaries.py @@ -18,8 +18,7 @@ def binary( shape=None, intensity_range=(0, 1), ): - """ - Function to create white noise. + """Draw binary noise texture Parameters ---------- diff --git a/stimupy/noises/narrowbands.py b/stimupy/noises/narrowbands.py index 4b76e5bf..3693d842 100644 --- a/stimupy/noises/narrowbands.py +++ b/stimupy/noises/narrowbands.py @@ -22,8 +22,7 @@ def narrowband( intensity_range=(0, 1), pseudo_noise=False, ): - """ - Function to create narrowband noise. + """Draw narrowband noise texture Parameters ---------- diff --git a/stimupy/noises/naturals.py b/stimupy/noises/naturals.py index 6b76865e..62f266c3 100644 --- a/stimupy/noises/naturals.py +++ b/stimupy/noises/naturals.py @@ -23,8 +23,7 @@ def one_over_f( intensity_range=(0, 1), pseudo_noise=False, ): - """ - Function to create 1 / (f**exponent) noise. + """Draw 1 / (f**exponent) noise texture Parameters ---------- @@ -103,8 +102,7 @@ def pink( intensity_range=(0, 1), pseudo_noise=False, ): - """ - Function to create 1 / (f**exponent) noise. + """Draw pink (1 / f) noise texture Parameters ---------- @@ -141,8 +139,7 @@ def brown( intensity_range=(0, 1), pseudo_noise=False, ): - """ - Function to create 1 / (f**exponent) noise. + """Draw brown (1 / (f**2.0)) noise texture Parameters ---------- diff --git a/stimupy/noises/utils.py b/stimupy/noises/utils.py index f56e311d..955e59ff 100644 --- a/stimupy/noises/utils.py +++ b/stimupy/noises/utils.py @@ -10,7 +10,7 @@ def randomize_sign(array): - """Helper function that randomizes the sign of values in an array. + """Randomize the sign of values in an array Parameters ---------- @@ -34,7 +34,7 @@ def pseudo_white_helper( shape, amplitude, ): - """Helper function used to generate pseudorandom white noise patch. + """Generate pseudorandom white noise patch Parameters ---------- @@ -63,8 +63,10 @@ def pseudo_white_spectrum( shape=(100, 100), amplitude=2.0, ): - """Function to create pseudorandom white noise. Code translated and adapted - from Matlab scripts provided by T. Peromaa + """Create pseudorandom white noise spectrum + + Code translated and adapted from Matlab scripts + provided by T. Peromaa Parameters ---------- diff --git a/stimupy/noises/whites.py b/stimupy/noises/whites.py index 2a12090b..73910fc8 100644 --- a/stimupy/noises/whites.py +++ b/stimupy/noises/whites.py @@ -20,8 +20,7 @@ def white( intensity_range=(0, 1), pseudo_noise=False, ): - """ - Function to create white noise. + """Draw white noise texture Parameters ---------- From e78bb11f89ef93e28b9ce9f603f13dd29676b504 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Wed, 15 Mar 2023 13:58:04 +0100 Subject: [PATCH 39/43] Docs: cleanup module-level docstring noises --- stimupy/noises/binaries.py | 4 ---- stimupy/noises/narrowbands.py | 4 ---- stimupy/noises/naturals.py | 4 ---- stimupy/noises/whites.py | 4 ---- 4 files changed, 16 deletions(-) diff --git a/stimupy/noises/binaries.py b/stimupy/noises/binaries.py index c2104820..6f23a8ab 100644 --- a/stimupy/noises/binaries.py +++ b/stimupy/noises/binaries.py @@ -1,7 +1,3 @@ -""" -@author: lynnschmittwilken -""" - import numpy as np from stimupy.utils import resolution diff --git a/stimupy/noises/narrowbands.py b/stimupy/noises/narrowbands.py index 3693d842..a67ebc9b 100644 --- a/stimupy/noises/narrowbands.py +++ b/stimupy/noises/narrowbands.py @@ -1,7 +1,3 @@ -""" -@author: lynnschmittwilken -""" - import numpy as np from stimupy.noises.utils import pseudo_white_spectrum diff --git a/stimupy/noises/naturals.py b/stimupy/noises/naturals.py index 62f266c3..df63a752 100644 --- a/stimupy/noises/naturals.py +++ b/stimupy/noises/naturals.py @@ -1,7 +1,3 @@ -""" -@author: lynnschmittwilken -""" - import numpy as np from stimupy.noises.utils import pseudo_white_spectrum diff --git a/stimupy/noises/whites.py b/stimupy/noises/whites.py index 73910fc8..2f66fe8b 100644 --- a/stimupy/noises/whites.py +++ b/stimupy/noises/whites.py @@ -1,7 +1,3 @@ -""" -@author: lynnschmittwilken -""" - import numpy as np from stimupy.noises.utils import pseudo_white_spectrum From 398e492977e2f32897d348e59917a94eaf9ee988 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Wed, 15 Mar 2023 14:34:55 +0100 Subject: [PATCH 40/43] Docs: headings in docstrings --- stimupy/components/__init__.py | 2 +- stimupy/components/checkerboards.py | 2 +- stimupy/components/circulars.py | 12 ++-- stimupy/components/edges.py | 6 +- stimupy/components/frames.py | 6 +- stimupy/components/gratings.py | 14 ++--- stimupy/components/lines.py | 6 +- stimupy/components/mondrians.py | 2 +- stimupy/components/shapes.py | 10 ++-- stimupy/illusions/angulars.py | 2 +- stimupy/illusions/benarys.py | 26 ++++----- stimupy/illusions/checkerboards.py | 6 +- stimupy/illusions/circulars.py | 16 +++--- stimupy/illusions/cornsweets.py | 2 +- stimupy/illusions/cubes.py | 4 +- stimupy/illusions/dungeons.py | 2 +- stimupy/illusions/frames.py | 16 +++--- stimupy/illusions/gratings.py | 4 +- stimupy/illusions/mondrians.py | 2 +- stimupy/illusions/mueller_lyers.py | 4 +- stimupy/illusions/ponzos.py | 2 +- stimupy/illusions/sbcs.py | 8 +-- stimupy/illusions/wedding_cakes.py | 4 +- stimupy/illusions/whites.py | 12 ++-- stimupy/papers/RHS2007.py | 46 +++++++-------- stimupy/papers/carney1999.py | 88 ++++++++++++++--------------- stimupy/papers/murray2020.py | 24 ++++---- stimupy/papers/white1981.py | 24 ++++---- stimupy/papers/white1985.py | 24 ++++---- stimupy/utils/masks.py | 6 +- 30 files changed, 191 insertions(+), 191 deletions(-) diff --git a/stimupy/components/__init__.py b/stimupy/components/__init__.py index 4bee84de..ca6f219c 100644 --- a/stimupy/components/__init__.py +++ b/stimupy/components/__init__.py @@ -127,7 +127,7 @@ def mask_elements( If None, set to center of visual_size Returns - ---------- + ------- dict[str, Any] mask with integer index for each angular segment (key: "mask"), and additional keys containing stimulus parameters diff --git a/stimupy/components/checkerboards.py b/stimupy/components/checkerboards.py index a8bfbf17..c9ec1d82 100644 --- a/stimupy/components/checkerboards.py +++ b/stimupy/components/checkerboards.py @@ -49,7 +49,7 @@ def checkerboard( intensity values of checks, by default (1.0, 0.0) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each check (key: "checker_mask"), diff --git a/stimupy/components/circulars.py b/stimupy/components/circulars.py index 59187e1c..094c705c 100644 --- a/stimupy/components/circulars.py +++ b/stimupy/components/circulars.py @@ -119,7 +119,7 @@ def mask_rings( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each ring (key: "ring_mask"), @@ -184,7 +184,7 @@ def disc_and_rings( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each ring (key: "ring_mask"), @@ -259,7 +259,7 @@ def disc( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each ring (key: "ring_mask"), @@ -320,7 +320,7 @@ def ring( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each ring (key: "ring_mask"), @@ -397,7 +397,7 @@ def grating( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each ring (key: "ring_mask"), @@ -480,7 +480,7 @@ def bessel( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), empty mask (key: "ring_mask"), diff --git a/stimupy/components/edges.py b/stimupy/components/edges.py index cce2856e..e53c2dae 100644 --- a/stimupy/components/edges.py +++ b/stimupy/components/edges.py @@ -33,7 +33,7 @@ def step_edge( intensity values of edges (default: (0., 1.)) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the each lobes (key: "edge_mask"), @@ -95,7 +95,7 @@ def gaussian_edge( intensity value of background, by default 0.5 Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the each lobes (key: "edge_mask"), @@ -164,7 +164,7 @@ def cornsweet_edge( determines steepness of ramp (default is 2.75. 1 would be linear) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the each lobes (key: "edge_mask"), diff --git a/stimupy/components/frames.py b/stimupy/components/frames.py index 5755d4fb..ff327a53 100644 --- a/stimupy/components/frames.py +++ b/stimupy/components/frames.py @@ -34,7 +34,7 @@ def mask_frames( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] mask with integer index for each frame (key: "frame_mask"), and additional keys containing stimulus parameters @@ -86,7 +86,7 @@ def frames( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each frame (key: "frame_mask"), @@ -154,7 +154,7 @@ def grating( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each frame (key: "frame_mask"), diff --git a/stimupy/components/gratings.py b/stimupy/components/gratings.py index 9b708ab7..048064af 100644 --- a/stimupy/components/gratings.py +++ b/stimupy/components/gratings.py @@ -44,7 +44,7 @@ def mask_bars( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] mask with integer index for each bar (key: "grating_mask"), and additional keys containing stimulus parameters @@ -92,7 +92,7 @@ def shift_edges( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- Updated edges and intensity_bars """ @@ -179,7 +179,7 @@ def square_wave( if True, round width of bars Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each bar (key: "grating_mask"), @@ -330,7 +330,7 @@ def sine_wave( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each bar (key: "grating_mask"), @@ -485,7 +485,7 @@ def gabor( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each bar (key: "grating_mask"), @@ -562,7 +562,7 @@ def staircase( If fewer intensities are passed than n_bars, cycles through intensities Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each bar (key: "grating_mask"), @@ -691,7 +691,7 @@ def plaid( sigma of Gaussian window in degree visual angle (y, x) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each bar (key: "grating_mask"), diff --git a/stimupy/components/lines.py b/stimupy/components/lines.py index a4ca9709..bbd125d1 100644 --- a/stimupy/components/lines.py +++ b/stimupy/components/lines.py @@ -55,7 +55,7 @@ def line( if "mean" or "center": set origin to center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each line (key: "line_mask"), @@ -166,7 +166,7 @@ def dipole( background intensity is the mean of these two values Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each line (key: "line_mask"), @@ -260,7 +260,7 @@ def circle( intensity value of the background (default: 0) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each line (key: "line_mask"), diff --git a/stimupy/components/mondrians.py b/stimupy/components/mondrians.py index f5604698..e02ae51f 100644 --- a/stimupy/components/mondrians.py +++ b/stimupy/components/mondrians.py @@ -39,7 +39,7 @@ def mondrians( intensity value of background Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each Mondrian (key: "mondrian_mask"), diff --git a/stimupy/components/shapes.py b/stimupy/components/shapes.py index 24722d17..fd566037 100644 --- a/stimupy/components/shapes.py +++ b/stimupy/components/shapes.py @@ -51,7 +51,7 @@ def rectangle( orientation of rectangle in degrees visual angle (default 0) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the shape (key: "shape_mask"), @@ -164,7 +164,7 @@ def triangle( orientation of triangle in degrees visual angle (default 0) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the shape (key: "shape_mask"), @@ -256,7 +256,7 @@ def cross( orientation of triangle in degrees visual angle (default 0) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the shape (key: "shape_mask"), @@ -358,7 +358,7 @@ def parallelogram( orientation of triangle in degrees visual angle (default 0) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the shape (key: "shape_mask"), @@ -475,7 +475,7 @@ def ellipse( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the shape (key: "shape_mask"), diff --git a/stimupy/illusions/angulars.py b/stimupy/illusions/angulars.py index b21ce0e1..5139939a 100644 --- a/stimupy/illusions/angulars.py +++ b/stimupy/illusions/angulars.py @@ -72,7 +72,7 @@ def pinwheel( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), diff --git a/stimupy/illusions/benarys.py b/stimupy/illusions/benarys.py index 1737b2a3..2631f4ee 100644 --- a/stimupy/illusions/benarys.py +++ b/stimupy/illusions/benarys.py @@ -60,14 +60,14 @@ def cross_generalized( intensity value for target Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), and additional keys containing stimulus parameters References - ----------- + ---------- Benary, W. (1924). Beobachtungen zu einem Experiment über Helligkeitskontrast. Psychologische Forschung, 5, 131-142. @@ -139,14 +139,14 @@ def cross_rectangles( intensity value for target Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), and additional keys containing stimulus parameters References - ----------- + ---------- Benary, W. (1924). Beobachtungen zu einem Experiment über Helligkeitskontrast. Psychologische Forschung, 5, 131-142. @@ -230,14 +230,14 @@ def cross_triangles( intensity value for target Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), and additional keys containing stimulus parameters References - ----------- + ---------- Benary, W. (1924). Beobachtungen zu einem Experiment über Helligkeitskontrast. Psychologische Forschung, 5, 131-142. @@ -333,14 +333,14 @@ def todorovic_generalized( intensity value for target Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), and additional keys containing stimulus parameters References - ----------- + ---------- Benary, W. (1924). Beobachtungen zu einem Experiment über Helligkeitskontrast. Psychologische Forschung, 5, 131-142. @@ -421,14 +421,14 @@ def todorovic_rectangles( intensity value for target Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), and additional keys containing stimulus parameters References - ----------- + ---------- Benary, W. (1924). Beobachtungen zu einem Experiment über Helligkeitskontrast. Psychologische Forschung, 5, 131-142. @@ -501,14 +501,14 @@ def todorovic_triangles( intensity value for target Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), and additional keys containing stimulus parameters References - ----------- + ---------- Benary, W. (1924). Beobachtungen zu einem Experiment über Helligkeitskontrast. Psychologische Forschung, 5, 131-142. @@ -581,7 +581,7 @@ def add_targets( intensity value for target Returns - ---------- + ------- dict[str, Any] dict with the updated stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), diff --git a/stimupy/illusions/checkerboards.py b/stimupy/illusions/checkerboards.py index caf9446e..b8597bb6 100644 --- a/stimupy/illusions/checkerboards.py +++ b/stimupy/illusions/checkerboards.py @@ -95,7 +95,7 @@ def add_targets(checkerboard_stim, target_indices, extend_targets=False, intensi intensity value of the target checks, by default 0.5 Returns - ---------- + ------- dict[str, Any] dict with the updated stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), @@ -170,7 +170,7 @@ def checkerboard( intensity values of checks, by default (0.0, 1.0) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), @@ -260,7 +260,7 @@ def contrast_contrast( alpha of transparency (i.e. how transparant the medium is), default 0.2 Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), diff --git a/stimupy/illusions/circulars.py b/stimupy/illusions/circulars.py index 7da04181..aa3a9f55 100644 --- a/stimupy/illusions/circulars.py +++ b/stimupy/illusions/circulars.py @@ -66,14 +66,14 @@ def rings( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), and additional keys containing stimulus parameters References - ----------- + ---------- Hong, S. W., and Shevell, S. K. (2004). Brightness contrast and assimilation from patterned inducing backgrounds. Vision Research, 44, 35-43. @@ -191,14 +191,14 @@ def two_sided_rings( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), and additional keys containing stimulus parameters References - ----------- + ---------- Hong, S. W., and Shevell, S. K. (2004). Brightness contrast and assimilation from patterned inducing backgrounds. Vision Research, 44, 35-43. @@ -302,14 +302,14 @@ def bullseye( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), and additional keys containing stimulus parameters References - ----------- + ---------- Bindman, D., & Chubb, C. (2004). Brightness assimilation in bullseye displays. Vision Research, 44, 309-319. @@ -397,14 +397,14 @@ def two_sided_bullseye( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), and additional keys containing stimulus parameters References - ----------- + ---------- Bindman, D., & Chubb, C. (2004). Brightness assimilation in bullseye displays. Vision Research, 44, 309-319. diff --git a/stimupy/illusions/cornsweets.py b/stimupy/illusions/cornsweets.py index d73439e2..9a80b8cf 100644 --- a/stimupy/illusions/cornsweets.py +++ b/stimupy/illusions/cornsweets.py @@ -45,7 +45,7 @@ def cornsweet( determines steepness of ramp (default is 2.75. 1 would be linear) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), diff --git a/stimupy/illusions/cubes.py b/stimupy/illusions/cubes.py index 3450bf2b..8ae47a63 100644 --- a/stimupy/illusions/cubes.py +++ b/stimupy/illusions/cubes.py @@ -40,7 +40,7 @@ def varying_cells( intensity value for target Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), @@ -178,7 +178,7 @@ def cube( intensity value for target Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), diff --git a/stimupy/illusions/dungeons.py b/stimupy/illusions/dungeons.py index 58a9989e..ae1557a8 100644 --- a/stimupy/illusions/dungeons.py +++ b/stimupy/illusions/dungeons.py @@ -49,7 +49,7 @@ def dungeon( and additional keys containing stimulus parameters References - ----------- + ---------- Bressan, P. (2001). Explaining lightness illusions. Perception, 30(9), 1031-1046. diff --git a/stimupy/illusions/frames.py b/stimupy/illusions/frames.py index 08556af1..24a20cce 100644 --- a/stimupy/illusions/frames.py +++ b/stimupy/illusions/frames.py @@ -58,7 +58,7 @@ def rings( If fewer intensities are passed than target_indices, cycles through intensities Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), @@ -150,7 +150,7 @@ def two_sided_rings( If fewer intensities are passed than target_indices, cycles through intensities Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), @@ -237,7 +237,7 @@ def rings_generalized( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each frame (key: "target_mask"), @@ -320,14 +320,14 @@ def bullseye( If fewer intensities are passed than target_indices, cycles through intensities Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), and additional keys containing stimulus parameters References - ----------- + ---------- Bindman, D., & Chubb, C. (2004). Brightness assimilation in bullseye displays. Vision Research, 44, 309-319. @@ -387,7 +387,7 @@ def bullseye_generalized( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each frame (key: "target_mask"), @@ -450,14 +450,14 @@ def two_sided_bullseye( If fewer intensities are passed than target_indices, cycles through intensities Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), and additional keys containing stimulus parameters References - ----------- + ---------- Bindman, D., & Chubb, C. (2004). Brightness assimilation in bullseye displays. Vision Research, 44, 309-319. diff --git a/stimupy/illusions/gratings.py b/stimupy/illusions/gratings.py index 46b01325..d327562f 100644 --- a/stimupy/illusions/gratings.py +++ b/stimupy/illusions/gratings.py @@ -75,7 +75,7 @@ def square_wave( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), @@ -181,7 +181,7 @@ def uniform( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), diff --git a/stimupy/illusions/mondrians.py b/stimupy/illusions/mondrians.py index 7aff64c6..f83abb2a 100644 --- a/stimupy/illusions/mondrians.py +++ b/stimupy/illusions/mondrians.py @@ -38,7 +38,7 @@ def corrugated_mondrians( intensity value for background Returns - ---------- + ------ dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), diff --git a/stimupy/illusions/mueller_lyers.py b/stimupy/illusions/mueller_lyers.py index 6b3ba119..d48cf274 100644 --- a/stimupy/illusions/mueller_lyers.py +++ b/stimupy/illusions/mueller_lyers.py @@ -49,7 +49,7 @@ def mueller_lyer( intensity value of background Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), @@ -202,7 +202,7 @@ def two_sided( intensity value of background Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), diff --git a/stimupy/illusions/ponzos.py b/stimupy/illusions/ponzos.py index 4b3f74d1..85f3e211 100644 --- a/stimupy/illusions/ponzos.py +++ b/stimupy/illusions/ponzos.py @@ -52,7 +52,7 @@ def ponzo( intensity value of background Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "target_mask"), diff --git a/stimupy/illusions/sbcs.py b/stimupy/illusions/sbcs.py index a19b4740..b516af40 100644 --- a/stimupy/illusions/sbcs.py +++ b/stimupy/illusions/sbcs.py @@ -44,7 +44,7 @@ def generalized( intensity value for target Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the target (key: "target_mask"), @@ -376,7 +376,7 @@ def dotted( intensity value for target Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the targets (key: "target_mask"), @@ -512,7 +512,7 @@ def two_sided_with_dots( intensity value for target Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the target (key: "target_mask"), @@ -604,7 +604,7 @@ def two_sided_dotted( intensity value for target Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the targets (key: "target_mask"), diff --git a/stimupy/illusions/wedding_cakes.py b/stimupy/illusions/wedding_cakes.py index b47a3f23..1ff21f83 100644 --- a/stimupy/illusions/wedding_cakes.py +++ b/stimupy/illusions/wedding_cakes.py @@ -47,14 +47,14 @@ def wedding_cake( intensity value of targets Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for the target (key: "target_mask"), and additional keys containing stimulus parameters References - ----------- + ---------- Clifford, C. W. G., & Spehar, B. (2003). Using colour to disambiguate contrast and assimilation in White's effect. Journal of Vision, 3, 294a. diff --git a/stimupy/illusions/whites.py b/stimupy/illusions/whites.py index 7e590f0a..6391f3fb 100644 --- a/stimupy/illusions/whites.py +++ b/stimupy/illusions/whites.py @@ -84,7 +84,7 @@ def generalized( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "mask"), @@ -230,7 +230,7 @@ def white( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "mask"), @@ -327,7 +327,7 @@ def white_two_rows( if "center": set origin to real center (closest existing value to mean) Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "mask"), @@ -574,14 +574,14 @@ def howe( intensity values of horizontal stripes Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "mask"), and additional keys containing stimulus parameters References - ----------- + ---------- Blakeslee, B., Pasieka, W., & McCourt, M. E. (2005). Oriented multiscale spatial filtering and contrast normalization: a parsimonious model of brightness induction in a continuum @@ -667,7 +667,7 @@ def yazdanbakhsh( size of gap between target and grating bar Returns - ---------- + ------- dict[str, Any] dict with the stimulus (key: "img"), mask with integer index for each target (key: "mask"), diff --git a/stimupy/papers/RHS2007.py b/stimupy/papers/RHS2007.py index e2d7eea4..c50f8571 100644 --- a/stimupy/papers/RHS2007.py +++ b/stimupy/papers/RHS2007.py @@ -306,7 +306,7 @@ def WE_anderson(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Anderson, B. L. (2001). Contrasting theories of White's illusion. Perception, 30, 1499-1501 Blakeslee, B., Pasieka, W., & McCourt, M. E. (2005). @@ -373,7 +373,7 @@ def WE_howe(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Blakeslee, B., Pasieka, W., & McCourt, M. E. (2005). Oriented multiscale spatial filtering and contrast normalization: a parsimonious model of brightness induction in a continuum @@ -437,7 +437,7 @@ def WE_zigzag(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Clifford, C. W. G., & Spehar, B. (2003). Using colour to disambiguate contrast and assimilation in White's effect. Journal of Vision, 3, 294a. @@ -481,7 +481,7 @@ def WE_radial_thick_small(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Anstis, S. (2003). White's effect in brightness & color. Online Demonstration @@ -761,7 +761,7 @@ def WE_circular05(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Howe, P. D. L. (2005). White's effect: removing the junctions but preserving the strength of the illusion. @@ -821,7 +821,7 @@ def WE_circular025(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Howe, P. D. L. (2005). White's effect: removing the junctions but preserving the strength of the illusion. @@ -881,7 +881,7 @@ def grating_induction(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the White effect, simultaneous brightness contrast and grating induction. @@ -945,7 +945,7 @@ def sbc_large(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the White effect, simultaneous brightness contrast and grating induction. @@ -1005,7 +1005,7 @@ def sbc_small(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the White effect, simultaneous brightness contrast and grating induction. @@ -1065,7 +1065,7 @@ def todorovic_equal(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the White effect, simultaneous brightness contrast and grating induction. @@ -1131,7 +1131,7 @@ def todorovic_in_large(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the White effect, simultaneous brightness contrast and grating induction. @@ -1197,7 +1197,7 @@ def todorovic_in_small(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the White effect, simultaneous brightness contrast and grating induction. @@ -1265,7 +1265,7 @@ def todorovic_out(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Blakeslee, B., & McCourt, M. E. (1999). A multiscale spatial filtering account of the White effect, simultaneous brightness contrast and grating induction. @@ -1331,7 +1331,7 @@ def checkerboard_016(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Blakeslee, B., & McCourt, M. E. (2004). A unified theory of brightness contrast and assimilation incorporating oriented multi-scale spatial filtering and contrast normalization. @@ -1389,7 +1389,7 @@ def checkerboard_094(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Blakeslee, B., & McCourt, M. E. (2004). A unified theory of brightness contrast and assimilation incorporating oriented multi-scale spatial filtering and contrast normalization. @@ -1447,7 +1447,7 @@ def checkerboard_21(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Blakeslee, B., & McCourt, M. E. (2004). A unified theory of brightness contrast and assimilation incorporating oriented multi-scale spatial filtering and contrast normalization. @@ -1503,7 +1503,7 @@ def corrugated_mondrian(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Blakeslee, B., & McCourt, M. E. (2001). A multiscale spatial filtering account of the Wertheimer-Benary effect and the corrugated Mondrian. @@ -1566,7 +1566,7 @@ def benary_cross(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Blakeslee, B., & McCourt, M. E. (2001). A multiscale spatial filtering account of the Wertheimer-Benary effect and the corrugated Mondrian. @@ -1632,7 +1632,7 @@ def todorovic_benary1_2(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Blakeslee, B., & McCourt, M. E. (2001). A multiscale spatial filtering account of the Wertheimer-Benary effect and the corrugated Mondrian. @@ -1694,7 +1694,7 @@ def todorovic_benary3_4(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Blakeslee, B., & McCourt, M. E. (2001). A multiscale spatial filtering account of the Wertheimer-Benary effect and the corrugated Mondrian. @@ -1756,7 +1756,7 @@ def todorovic_benary1_2_3_4(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Blakeslee, B., & McCourt, M. E. (2001). A multiscale spatial filtering account of the Wertheimer-Benary effect and the corrugated Mondrian. @@ -1814,7 +1814,7 @@ def bullseye_thin(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Bindman, D., & Chubb, C. (2004). Brightness assimilation in bullseye displays. Vision Research, 44, 309-319. @@ -1875,7 +1875,7 @@ def bullseye_thick(ppd=PPD, pad=True): and additional keys containing stimulus parameters References - ----------- + ---------- Bindman, D., & Chubb, C. (2004). Brightness assimilation in bullseye displays. Vision Research, 44, 309-319. diff --git a/stimupy/papers/carney1999.py b/stimupy/papers/carney1999.py index e8f69d2a..257df324 100644 --- a/stimupy/papers/carney1999.py +++ b/stimupy/papers/carney1999.py @@ -138,7 +138,7 @@ def GaborPatch1(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -187,7 +187,7 @@ def GaborPatch2(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -236,7 +236,7 @@ def GaborPatch3(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -285,7 +285,7 @@ def GaborPatch4(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -334,7 +334,7 @@ def GaborPatch5(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -383,7 +383,7 @@ def GaborPatch6(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -432,7 +432,7 @@ def GaborPatch7(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -481,7 +481,7 @@ def GaborPatch8(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -530,7 +530,7 @@ def GaborPatch9(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -579,7 +579,7 @@ def GaborPatch10(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -628,7 +628,7 @@ def GaborPatch11(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -677,7 +677,7 @@ def GaborPatch12(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -726,7 +726,7 @@ def GaborPatch13(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -775,7 +775,7 @@ def GaborPatch14(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -824,7 +824,7 @@ def ElongatedGabor15(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -873,7 +873,7 @@ def ElongatedGabor16(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -922,7 +922,7 @@ def ElongatedGabor17(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -971,7 +971,7 @@ def Baguette18(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -1020,7 +1020,7 @@ def Baguette19(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -1069,7 +1069,7 @@ def Baguette20(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -1118,7 +1118,7 @@ def Baguette21(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -1167,7 +1167,7 @@ def Subthreshold22(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -1223,7 +1223,7 @@ def Subthreshold23(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -1279,7 +1279,7 @@ def Subthreshold24(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -1335,7 +1335,7 @@ def Subthreshold25(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -1390,7 +1390,7 @@ def Gaussians26(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -1436,7 +1436,7 @@ def Gaussians27(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -1482,7 +1482,7 @@ def Gaussians28(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -1528,7 +1528,7 @@ def Gaussians29(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -1574,7 +1574,7 @@ def Edge30(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -1613,7 +1613,7 @@ def Line31(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -1665,7 +1665,7 @@ def Dipole32(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -1718,7 +1718,7 @@ def GaborString33(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -1778,7 +1778,7 @@ def GaborString34(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -1839,7 +1839,7 @@ def Noise35_random(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -1874,7 +1874,7 @@ def Noise35(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -1924,7 +1924,7 @@ def Orientation36(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -1974,7 +1974,7 @@ def Orientation37(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -2024,7 +2024,7 @@ def Plaids38(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -2079,7 +2079,7 @@ def Plaids39(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -2132,7 +2132,7 @@ def Disk40(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -2172,7 +2172,7 @@ def Bessel41(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -2219,7 +2219,7 @@ def Checkerboard42(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database @@ -2269,7 +2269,7 @@ def NaturalScene43(ppd=PPD): stimulus parameters References - ----------- + ---------- Carney, T., Klein, S. A., Tyler, C. W., Silverstein, A. D., Beutter, B., Levi, D., ... & Eckstein, M. P. (1999). Development of an image/threshold database diff --git a/stimupy/papers/murray2020.py b/stimupy/papers/murray2020.py index 89103b00..a3419d43 100644 --- a/stimupy/papers/murray2020.py +++ b/stimupy/papers/murray2020.py @@ -121,7 +121,7 @@ def argyle(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- Murray, R. F. (2020). A model of lightness perception guided by probabilistic assumptions about lighting and reflectance. @@ -173,7 +173,7 @@ def argyle_control(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- Murray, R. F. (2020). A model of lightness perception guided by probabilistic assumptions about lighting and reflectance. @@ -227,7 +227,7 @@ def argyle_long(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- Murray, R. F. (2020). A model of lightness perception guided by probabilistic assumptions about lighting and reflectance. @@ -281,7 +281,7 @@ def snake(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- Murray, R. F. (2020). A model of lightness perception guided by probabilistic assumptions about lighting and reflectance. @@ -335,7 +335,7 @@ def snake_control(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- Murray, R. F. (2020). A model of lightness perception guided by probabilistic assumptions about lighting and reflectance. @@ -389,7 +389,7 @@ def koffka_adelson(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- Murray, R. F. (2020). A model of lightness perception guided by probabilistic assumptions about lighting and reflectance. @@ -443,7 +443,7 @@ def koffka_broken(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- Murray, R. F. (2020). A model of lightness perception guided by probabilistic assumptions about lighting and reflectance. @@ -497,7 +497,7 @@ def koffka_connected(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- Murray, R. F. (2020). A model of lightness perception guided by probabilistic assumptions about lighting and reflectance. @@ -551,7 +551,7 @@ def checkassim(ppd=PPD, pad=PAD): and additional keys containing stimulus parameters References - ----------- + ---------- Murray, R. F. (2020). A model of lightness perception guided by probabilistic assumptions about lighting and reflectance. @@ -611,7 +611,7 @@ def simcon(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- Murray, R. F. (2020). A model of lightness perception guided by probabilistic assumptions about lighting and reflectance. @@ -665,7 +665,7 @@ def simcon_articulated(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- Murray, R. F. (2020). A model of lightness perception guided by probabilistic assumptions about lighting and reflectance. @@ -719,7 +719,7 @@ def white(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- Murray, R. F. (2020). A model of lightness perception guided by probabilistic assumptions about lighting and reflectance. diff --git a/stimupy/papers/white1981.py b/stimupy/papers/white1981.py index 76ebffd6..36ef4429 100644 --- a/stimupy/papers/white1981.py +++ b/stimupy/papers/white1981.py @@ -111,7 +111,7 @@ def square_white(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. (1981). The effect of the nature of the surround on the perceived lightness of grey bars within square-wave test grating. @@ -148,7 +148,7 @@ def square_black(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. (1981). The effect of the nature of the surround on the perceived lightness of grey bars within square-wave test grating. @@ -186,7 +186,7 @@ def grating_white_white(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. (1981). The effect of the nature of the surround on the perceived lightness of grey bars within square-wave test grating. @@ -229,7 +229,7 @@ def grating_white_black(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. (1981). The effect of the nature of the surround on the perceived lightness of grey bars within square-wave test grating. @@ -272,7 +272,7 @@ def grating_black_white(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. (1981). The effect of the nature of the surround on the perceived lightness of grey bars within square-wave test grating. @@ -315,7 +315,7 @@ def grating_black_black(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. (1981). The effect of the nature of the surround on the perceived lightness of grey bars within square-wave test grating. @@ -358,7 +358,7 @@ def grating_white_in(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. (1981). The effect of the nature of the surround on the perceived lightness of grey bars within square-wave test grating. @@ -410,7 +410,7 @@ def grating_black_in(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. (1981). The effect of the nature of the surround on the perceived lightness of grey bars within square-wave test grating. @@ -462,7 +462,7 @@ def grating_white_out(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. (1981). The effect of the nature of the surround on the perceived lightness of grey bars within square-wave test grating. @@ -514,7 +514,7 @@ def grating_black_out(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. (1981). The effect of the nature of the surround on the perceived lightness of grey bars within square-wave test grating. @@ -566,7 +566,7 @@ def grating_white_orthogonal(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. (1981). The effect of the nature of the surround on the perceived lightness of grey bars within square-wave test grating. @@ -620,7 +620,7 @@ def grating_black_orthogonal(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. (1981). The effect of the nature of the surround on the perceived lightness of grey bars within square-wave test grating. diff --git a/stimupy/papers/white1985.py b/stimupy/papers/white1985.py index 8b624672..15bd9942 100644 --- a/stimupy/papers/white1985.py +++ b/stimupy/papers/white1985.py @@ -110,7 +110,7 @@ def wide_0phase(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. & White, T. (1985). Counterphase lightness induction. Vision Research, 25 (9), 1331-1335. @@ -154,7 +154,7 @@ def wide_36phase(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. & White, T. (1985). Counterphase lightness induction. Vision Research, 25 (9), 1331-1335. @@ -197,7 +197,7 @@ def wide_72phase(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. & White, T. (1985). Counterphase lightness induction. Vision Research, 25 (9), 1331-1335. @@ -241,7 +241,7 @@ def wide_108phase(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. & White, T. (1985). Counterphase lightness induction. Vision Research, 25 (9), 1331-1335. @@ -285,7 +285,7 @@ def wide_144phase(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. & White, T. (1985). Counterphase lightness induction. Vision Research, 25 (9), 1331-1335. @@ -329,7 +329,7 @@ def wide_180phase(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. & White, T. (1985). Counterphase lightness induction. Vision Research, 25 (9), 1331-1335. @@ -373,7 +373,7 @@ def square_0phase(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. & White, T. (1985). Counterphase lightness induction. Vision Research, 25 (9), 1331-1335. @@ -417,7 +417,7 @@ def square_36phase(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. & White, T. (1985). Counterphase lightness induction. Vision Research, 25 (9), 1331-1335. @@ -461,7 +461,7 @@ def square_72phase(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. & White, T. (1985). Counterphase lightness induction. Vision Research, 25 (9), 1331-1335. @@ -505,7 +505,7 @@ def square_108phase(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. & White, T. (1985). Counterphase lightness induction. Vision Research, 25 (9), 1331-1335. @@ -549,7 +549,7 @@ def square_144phase(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. & White, T. (1985). Counterphase lightness induction. Vision Research, 25 (9), 1331-1335. @@ -593,7 +593,7 @@ def square_180phase(ppd=PPD): and additional keys containing stimulus parameters References - ----------- + ---------- White, M. & White, T. (1985). Counterphase lightness induction. Vision Research, 25 (9), 1331-1335. diff --git a/stimupy/utils/masks.py b/stimupy/utils/masks.py index 0c37aa9c..919f7959 100644 --- a/stimupy/utils/masks.py +++ b/stimupy/utils/masks.py @@ -13,7 +13,7 @@ def avg_target_values(stim, f_average=np.median): How to average/summarise the pixels in each target region Returns - ---------- + ------- list[float] each entry in the list is the average value of pixels in target region, index in the list is the integer index in the mask @@ -42,7 +42,7 @@ def avg_img_values(image, mask, f_average=np.median): How to average/summarise the pixels in each target region Returns - ---------- + ------- list[float] each entry in the list is the average value of pixels in target region, index in the list is the integer index in the mask @@ -100,7 +100,7 @@ def img_values(img, mask): All non-zero pixels/values are treated as ones in a binary bit mask. Returns - ---------- + ------- numpy.ndarray numpy.ndarray of same size as img. All bits corresponding to zero bits in the mask are set to NaN. From fbf19b439f986f5ed5def9f7839cc45d32b260b3 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Wed, 15 Mar 2023 14:48:42 +0100 Subject: [PATCH 41/43] Docs: define public API for components Export only the entries in __all__ --- stimupy/components/__init__.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/stimupy/components/__init__.py b/stimupy/components/__init__.py index ca6f219c..7ae8997a 100644 --- a/stimupy/components/__init__.py +++ b/stimupy/components/__init__.py @@ -512,3 +512,21 @@ def overview(mask=False, save=None): # Plotting plot_stimuli(stims, mask=mask, save=save) + + +__all__ = [ + image_base, + draw_regions, + mask_elements, + angulars, + checkerboards, + circulars, + edges, + frames, + gaussians, + gratings, + lines, + mondrians, + shapes, + overview, +] From b25395410a335902e1bb38bcf14cd7a770893696 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Wed, 15 Mar 2023 15:04:02 +0100 Subject: [PATCH 42/43] Bugfix: __all__ in stimupy.components should be list of str --- stimupy/components/__init__.py | 37 +++++++++++++++++----------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/stimupy/components/__init__.py b/stimupy/components/__init__.py index 50bc86fe..ad91ba0d 100644 --- a/stimupy/components/__init__.py +++ b/stimupy/components/__init__.py @@ -7,6 +7,23 @@ from stimupy.utils.contrast_conversions import adapt_intensity_range from stimupy.utils.utils import round_to_vals +__all__ = [ + "image_base", + "draw_regions", + "mask_elements", + "overview", + "angulars", + "checkerboards", + "circulars", + "edges", + "frames", + "gaussians", + "gratings", + "lines", + "mondrians", + "shapes", +] + def image_base(visual_size=None, shape=None, ppd=None, rotation=0.0, origin="mean"): """Create coordinate-arrays to serve as image base for drawing @@ -752,22 +769,4 @@ def overview(mask=False, save=None, extent_key="shape"): stims = create_overview() # Plotting - plot_stimuli(stims, mask=mask, save=save, extent_key=extent_key) - - -__all__ = [ - image_base, - draw_regions, - mask_elements, - angulars, - checkerboards, - circulars, - edges, - frames, - gaussians, - gratings, - lines, - mondrians, - shapes, - overview, -] + plot_stimuli(stims, mask=mask, save=save, extent_key=extent_key) \ No newline at end of file From 006abd0cae4db6159c1f488f935e0a459a9aaa12 Mon Sep 17 00:00:00 2001 From: Joris Vincent Date: Thu, 16 Mar 2023 21:17:03 +0100 Subject: [PATCH 43/43] Autoformat --- stimupy/components/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stimupy/components/__init__.py b/stimupy/components/__init__.py index ad91ba0d..60fa12f5 100644 --- a/stimupy/components/__init__.py +++ b/stimupy/components/__init__.py @@ -769,4 +769,4 @@ def overview(mask=False, save=None, extent_key="shape"): stims = create_overview() # Plotting - plot_stimuli(stims, mask=mask, save=save, extent_key=extent_key) \ No newline at end of file + plot_stimuli(stims, mask=mask, save=save, extent_key=extent_key)