Skip to content

Commit

Permalink
Merge pull request #120 from computational-psychology/build
Browse files Browse the repository at this point in the history
Update build-system
  • Loading branch information
JorisVincent authored Jan 31, 2024
2 parents 7883ef4 + de8efb4 commit d56e528
Show file tree
Hide file tree
Showing 37 changed files with 225 additions and 214 deletions.
2 changes: 2 additions & 0 deletions .codespell.ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**F**indable, **A**ccessible, **I**nteroperable, and **R**eusable
Pflügers Archiv für die gesamte Physiologie. 3: 13-15.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Release to PyPI

on:
release:
types: [released]
workflow_dispatch:

jobs:
Expand Down
7 changes: 6 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,9 @@ repos:
hooks:
- id: flake8
# Ignore all format-related checks as Black takes care of those.
args: ["--ignore", "E203,E501,W503,F403", "--select", "E,W,F", '--per-file-ignores=__init__.py:F401,F405,E402', '--exclude','tests/*']
args: ["--ignore", "E203,E501,W503,F403", "--select", "E,W,F", '--per-file-ignores=__init__.py:F401,F405,E402', '--exclude','tests/*']

- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
250 changes: 125 additions & 125 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ so that they are reproducible, flexible, and easy.
(e.g. Simultaneous Brightness Contrast, White's illusion, Hermann grid, Ponzo illusion), and many more

- exact replications of stimuli previously published (e.g. ModelFest)
as described in their respecive [papers](stimupy/papers/)
as described in their respective [papers](stimupy/papers/)

- all stimuli are fully parameterizable
- with interpretable parameters that are familiar and relevant to vision scientists
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/dev_environ.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- `".[dev,docs]"` to also edit and build the documentation

The `stimupy` project uses a couple of development tools
to work towards more consisten code quality:
to work towards more consistent code quality:

- `pytest` for unit and integration tests
- `pyupgrade` for possible syntax improvements using newer language features
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/sets.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
that can generate many parameterizated stimulus images,
and several complete sets of stimuli
that all come from the same {py:mod}`source <stimupy.papers>`.
Development, organization and maintanance of these sets can be arduous,
Development, organization and maintenance of these sets can be arduous,
and we are committed to providing a high-quality and well-tested suite of functions.
Thus, `stimupy` is a curated and maintained _library_ of stimuli
(stimulus-functions, to be precise),
Expand Down
2 changes: 1 addition & 1 deletion docs/getting_started/composition.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ This has created the bullseye stimulus that we want,
and included with this is a `mask` that can separately indicate
each of the three regions (and background).
We can easily visualize this mask as well,
overlayed as colorcoding on top of the stimulus:
overlaid as colorcoding on top of the stimulus:

```
plt.subplot(1,2,1)
Expand Down
2 changes: 1 addition & 1 deletion docs/getting_started/first_stim.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Thus, this output is self-documenting:
all the necessary information to produce this stimulus are in the stimulus-`dict`.

A nice feature of these {py:class}`dict`s is that you, the user,
can add any arbitray (meta)data to them, after creating the stimulus.
can add any arbitrary (meta)data to them, after creating the stimulus.
For instance, we can add some label,
or a creation date:
```{code-cell}
Expand Down
2 changes: 1 addition & 1 deletion docs/howtos/export.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ or [OpenCV](https://github.com/opencv/opencv-python)
## Exporting only parameters
In some cases, you may wish to save/export only the stimulus parameters
-- for a given version of `stimupy`,
these parameters should reproduce the exact same stimulus everytime.
these parameters should reproduce the exact same stimulus every time.
For stimuli created using just `stimupy` functions,
the output stimulus-`dict` contains not just the `img`-array
but also all parameters for creating that stimulus.
Expand Down
2 changes: 1 addition & 1 deletion docs/howtos/share.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ that all come from the same {py:mod}`paper <stimupy.papers>` (/ source).
The ones currently included span wide range of the stimuli implemented in `stimupy`
and have formed both the inspiration and a testing benchmark for development.

Development, organization and maintanance of these sets can be arduous,
Development, organization and maintenance of these sets can be arduous,
and we are committed to providing a high-quality and well-tested suite of functions.
Thus, `stimupy` is a curated and maintained _library_ of stimuli
(stimulus-functions, to be precise),
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/demos/stimuli/sbcs.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ w_tint_l = iw.FloatSlider(value=0.5, min=0, max=1, description="intensity target
w_tint_r = iw.FloatSlider(value=0.5, min=0, max=1, description="intensity target right")
w_int_surround_l = iw.FloatSlider(value=0., min=0, max=1, description="intensity left surround")
w_int_surround_r = iw.FloatSlider(value=1., min=0, max=1, description="intensity right surround")
w_int_background = iw.FloatSlider(value=.5, min=0, max=1, description="intenisty background")
w_int_background = iw.FloatSlider(value=.5, min=0, max=1, description="intensity background")
w_rot_l = iw.FloatSlider(value=0, min=0, max=360, description="rotation left [deg]")
w_rot_r = iw.FloatSlider(value=0, min=0, max=360, description="rotation right [deg]")
Expand Down Expand Up @@ -651,7 +651,7 @@ w_tint_l = iw.FloatSlider(value=0.5, min=0, max=1, description="intensity target
w_tint_r = iw.FloatSlider(value=0.5, min=0, max=1, description="intensity target right")
w_int_surround_l = iw.FloatSlider(value=0., min=0, max=1, description="intensity left surround")
w_int_surround_r = iw.FloatSlider(value=1., min=0, max=1, description="intensity right surround")
w_int_background = iw.FloatSlider(value=.5, min=0, max=1, description="intenisty background")
w_int_background = iw.FloatSlider(value=.5, min=0, max=1, description="intensity background")
w_mask = iw.ToggleButton(value=False, disabled=False, description="add mask")
Expand Down
4 changes: 2 additions & 2 deletions docs/topic_guides/organization.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Broadly, `stimupy` functions currently fall into the following categories, which
- a variety of so-called illusions
(e.g. Simultaneous Brightness Contrast, White's illusion, Hermann grid, Ponzo illusion), and many more
- exact replications of stimuli previously published (e.g. ModelFest)
as described in their respecive [papers](../reference/_api/stimupy.papers)
as described in their respective [papers](../reference/_api/stimupy.papers)
- [utility functions](https://stimupy.readthedocs.io/en/latest/reference/_api/stimupy.utils.html)
for stimulus import, export, manipulation (e.g. contrast, size), or plotting

Expand Down Expand Up @@ -76,7 +76,7 @@ OR as having a [cross-shaped target](todorovics.cross) with adjoining squares.
For a single stimulus parameterization,
these two conceptions may produce perfectly identical images ([see fig, top](fig_todorovics)).
However, when changing parameters,
you would expect different *behavior* from the stimulus fuction
you would expect different *behavior* from the stimulus function
dependent on your conception/interpretation of the stimulus ([see fig, bottom](fig_todorovics)).

```{code-cell}
Expand Down
4 changes: 2 additions & 2 deletions docs/topic_guides/waves.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ kernelspec:
```{tip}
This guide explains the principles behind, behavior of, and relations between
the parameters of periodic stimuli in `stimupy`.
For a more hands-on demonstration of how those paramaters affect a specific stimulus,
For a more hands-on demonstration of how those parameters affect a specific stimulus,
see, e.g., [](../reference/demos/stimuli/waves.md)
```

Expand Down Expand Up @@ -48,7 +48,7 @@ namely that there are repeated _cycles_ (here of 2 phases/elements per cycle),
where each cycle is identical to each other cycle.
This regularity can be expressed in several different ways,
with several different parameters
-- and these parameters have some interdependence on eachother.
-- and these parameters have some interdependence on each other.

```{tip}
In the examples in this section,
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,8 @@ type = "github"

[tool.semantic_release.publish]
upload_to_vcs_release = true # upload sdist, wheel to release-tag


[tool.codespell]
skip = "./docs/_build/*"
exclude-file = ".codespell.ignore"
4 changes: 2 additions & 2 deletions stimupy/components/frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def mask_frames(
if "mean": set origin to hypothetical image center (default)
if "center": set origin to real center (closest existing value to mean)
rotation : float, optional
rotation (in degrees), counterclockwise, by default 0.0 (horizonal)
rotation (in degrees), counterclockwise, by default 0.0 (horizontal)
Returns
-------
Expand Down Expand Up @@ -77,7 +77,7 @@ def frames(
radii : Sequence[Number]
radii of each frame, in degrees visual angle
rotation : float, optional
rotation (in degrees), counterclockwise, by default 0.0 (horizonal)
rotation (in degrees), counterclockwise, by default 0.0 (horizontal)
intensity_frames : Sequence[float, ...], optional
intensity value for each frame, by default (1.0, 0.0).
Can specify as many intensities as number of frame_widths;
Expand Down
2 changes: 1 addition & 1 deletion stimupy/components/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def dipole(
line_gap : Number
distance between line centers, in degrees visual angle
rotation : float, optional
rotation (in degrees), counterclockwise, by default 0.0 (horizonal)
rotation (in degrees), counterclockwise, by default 0.0 (horizontal)
intensity_lines : (Number, Number)
intensity value of the line (default: (0, 1));
background intensity is the mean of these two values
Expand Down
2 changes: 1 addition & 1 deletion stimupy/components/radials.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def rings(
visual_size = resolution.validate_visual_size(visual_size)

if visual_size is None or visual_size == (None, None):
# Two axes are None; make image large enought to fit
# Two axes are None; make image large enough to fit
visual_size = resolution.validate_visual_size(np.max(radii) * 2)
elif None in visual_size:
# one axis is None; make square
Expand Down
2 changes: 1 addition & 1 deletion stimupy/components/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def rectangle(
intensity_background : float, optional
intensity value of background, by default 0.0
rotation : float, optional
rotation (in degrees), counterclockwise, by default 0.0 (horizonal)
rotation (in degrees), counterclockwise, by default 0.0 (horizontal)
Returns
-------
Expand Down
10 changes: 5 additions & 5 deletions stimupy/components/waves.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def resolve_grating_params(
Parameters
----------
length : Number, or None (default)
lenght of grating, in pixels
length of grating, in pixels
visual_angle :Number, or None (default)
visual angle of grating, in degrees
ppd : Number, or None (default)
Expand Down Expand Up @@ -214,7 +214,7 @@ def round_n_phases(n_phases, length, period="either"):
n_phases : int
number of phases (e.g., bars), i.e., half the number of full periods
length : Number
lenght of grating, in pixels
length of grating, in pixels
period : "even", "odd", "either" (default)
whether to ensure the grating has "even" number of phases,
"odd" number of phases, or "either" even/odd
Expand Down Expand Up @@ -281,7 +281,7 @@ def sine(
number of phases, either or whether not to round the number of
phases ("ignore")
rotation : float, optional
rotation (in degrees), counterclockwise, by default 0.0 (horizonal)
rotation (in degrees), counterclockwise, by default 0.0 (horizontal)
phase_shift : float
phase shift of grating in degrees, by default 0.0
intensities : Sequence[float, float]
Expand Down Expand Up @@ -512,7 +512,7 @@ def square(
number of phases, either or whether not to round the number of
phases ("ignore")
rotation : float, optional
rotation (in degrees), counterclockwise, by default 0.0 (horizonal)
rotation (in degrees), counterclockwise, by default 0.0 (horizontal)
phase_shift : float
phase shift of grating in degrees, by default 0.0
intensities : Sequence[float, float]
Expand Down Expand Up @@ -596,7 +596,7 @@ def staircase(
number of phases, either or whether not to round the number of
phases ("ignore")
rotation : float, optional
rotation (in degrees), counterclockwise, by default 0.0 (horizonal)
rotation (in degrees), counterclockwise, by default 0.0 (horizontal)
phase_shift : float
phase shift of grating in degrees, by default 0.o
origin : "corner", "mean", or "center" (default)
Expand Down
2 changes: 1 addition & 1 deletion stimupy/papers/domijan2015.py
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ def white_howe(visual_size=VSIZES["white_howe"], ppd=PPD, shape=SHAPES["white_ho
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.
and the Ross and Pessoa (2000) explanations of White's effect.
Perception, 30, 1023-1026
"""

Expand Down
6 changes: 3 additions & 3 deletions stimupy/papers/modelfest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1654,7 +1654,7 @@ def Line31(ppd=PPD):
def Dipole32(ppd=PPD):
"""Dipole32: lines x Gaussian, Carney et al (1999)
Line width: 3 px =
Seperation: 1 px =
Separation: 1 px =
Gaussian window: sy=sx=0.5 deg
Parameters
Expand Down Expand Up @@ -1708,7 +1708,7 @@ def GaborString33(ppd=PPD):
"""GaborString33 - 5 collinear in-phase Gabors, Carney et al (1999)
Frequency: 8 cpd
Gaussian window of individual Gabors: sx=sy=0.07 deg (~1octave)
Seperation: 5sx
Separation: 5sx
Parameters
----------
Expand Down Expand Up @@ -1770,7 +1770,7 @@ def GaborString34(ppd=PPD):
"""GaborString33 - 5 collinear out-of-phase Gabors, Carney et al (1999)
Frequency: 8 cpd
Gaussian window of individual Gabors: sx=sy= deg (~1octave)
Seperation: 5sx
Separation: 5sx
Parameters
----------
Expand Down
6 changes: 3 additions & 3 deletions stimupy/stimuli/bullseyes.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def circular_generalized(
radii : Sequence[Number] or None (default)
radii of each ring, in degrees visual angle
rotation : float, optional
rotation (in degrees), counterclockwise, by default 0.0 (horizonal)
rotation (in degrees), counterclockwise, by default 0.0 (horizontal)
intensity_rings : Sequence[float, float]
intensities of rings, by default (1.0, 0.0)
intensity_background : float (optional)
Expand Down Expand Up @@ -212,7 +212,7 @@ def rectangular(
frame_width : Number, or None (default)
width of a single frame, in degrees visual angle
rotation : float, optional
rotation (in degrees), counterclockwise, by default 0.0 (horizonal)
rotation (in degrees), counterclockwise, by default 0.0 (horizontal)
phase_shift : float
phase shift of grating in degrees
intensity_frames : Sequence[float, float]
Expand Down Expand Up @@ -290,7 +290,7 @@ def rectangular_generalized(
radii : Sequence[Number] or None (default)
radii of each frame, in degrees visual angle
rotation : float, optional
rotation (in degrees), counterclockwise, by default 0.0 (horizonal)
rotation (in degrees), counterclockwise, by default 0.0 (horizontal)
intensity_frames : Sequence[float, float]
min and max intensity of square-wave, by default (0.0, 1.0)
intensity_background : float (optional)
Expand Down
6 changes: 3 additions & 3 deletions stimupy/stimuli/checkerboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def mask_from_idx(checkerboard_stim, check_idc):
Returns
-------
numpy.ndarray
mask, as binary 2D numpy.ndarray with 1 for all pixels beloning to
mask, as binary 2D numpy.ndarray with 1 for all pixels belonging to
specified check(s), and 0 everywhere else
Raises
Expand Down Expand Up @@ -158,7 +158,7 @@ def checkerboard(
number of phases, either or whether not to round the number of
phases ("ignore")
rotation : float, optional
rotation (in degrees), counterclockwise, by default 0.0 (horizonal)
rotation (in degrees), counterclockwise, by default 0.0 (horizontal)
intensity_checks : Sequence[float, float]
intensity values of checks, by default (0.0, 1.0)
round_phase_width : Bool
Expand Down Expand Up @@ -352,7 +352,7 @@ def contrast_contrast(
tau : Number
tau of transparency (i.e. value of transparent medium), default 0.5
alpha : Number or None (default)
alpha of transparency (i.e. how transparant the medium is)
alpha of transparency (i.e. how transparent the medium is)
round_phase_width : Bool
if True, round width of bars given resolution (default: True)
Expand Down
2 changes: 1 addition & 1 deletion stimupy/stimuli/cornsweets.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def cornsweet(
ramp_width : float
width of luminance ramp in degrees of visual angle
rotation : float, optional
rotation (in degrees), counterclockwise, by default 0.0 (horizonal)
rotation (in degrees), counterclockwise, by default 0.0 (horizontal)
intensity_edges : (float, float)
intensity of edges
intensity_plateau : float
Expand Down
2 changes: 1 addition & 1 deletion stimupy/stimuli/gabors.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def gabor(
number of phases, either or whether not to round the number of
phases ("ignore")
rotation : float, optional
rotation (in degrees), counterclockwise, by default 0.0 (horizonal)
rotation (in degrees), counterclockwise, by default 0.0 (horizontal)
phase_shift : float
phase shift of grating in degrees
intensities : Sequence[float, ...]
Expand Down
6 changes: 3 additions & 3 deletions stimupy/stimuli/gratings.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def on_uniform(
number of phases, either or whether not to round the number of
phases ("ignore")
rotation : float, optional
rotation (in degrees), counterclockwise, by default 0.0 (horizonal)
rotation (in degrees), counterclockwise, by default 0.0 (horizontal)
phase_shift : float
phase shift of grating in degrees
intensity_bars : Sequence[float, ...]
Expand Down Expand Up @@ -398,7 +398,7 @@ def grating_induction(
number of phases, either or whether not to round the number of
phases ("ignore")
rotation : float, optional
rotation (in degrees), counterclockwise, by default 0.0 (horizonal)
rotation (in degrees), counterclockwise, by default 0.0 (horizontal)
phase_shift : float
phase shift of grating in degrees
intensity_bars : Sequence[float, ...]
Expand Down Expand Up @@ -500,7 +500,7 @@ def grating_induction_blur(
number of phases, either or whether not to round the number of
phases ("ignore")
rotation : float, optional
rotation (in degrees), counterclockwise, by default 0.0 (horizonal)
rotation (in degrees), counterclockwise, by default 0.0 (horizontal)
phase_shift : float
phase shift of grating in degrees
intensity_bars : Sequence[float, ...]
Expand Down
2 changes: 1 addition & 1 deletion stimupy/stimuli/rings.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def rectangular_generalized(
if "mean": set origin to hypothetical image center (default)
if "center": set origin to real center (closest existing value to mean)
rotation : float, optional
rotation (in degrees), counterclockwise, by default 0.0 (horizonal)
rotation (in degrees), counterclockwise, by default 0.0 (horizontal)
Returns
Expand Down
Loading

0 comments on commit d56e528

Please sign in to comment.