Skip to content

Commit

Permalink
If None, set largest radius of ring to visual_size max
Browse files Browse the repository at this point in the history
  • Loading branch information
JorisVincent committed Dec 13, 2022
1 parent 8359723 commit 7402a14
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions stimuli/components/circular.py
Expand Up @@ -331,12 +331,16 @@ def ring(
ValueError
if passed in less/more than 1 intensity
"""
intensity = [intensity]

# Try to resolve resolution
shape, visual_size, ppd = resolution.resolve(shape=shape, visual_size=visual_size, ppd=ppd)

if len(radii) != 2:
raise ValueError("Can only pass exactly 2 radii")
if len(intensity) != 1:
if len([intensity]) != 1:
raise ValueError("Can only pass 1 intensity")
if radii[1] is None:
radii[1] = np.max(visual_size) / 2

stim = disc_and_rings(
radii=radii,
Expand Down

0 comments on commit 7402a14

Please sign in to comment.