# Parametric shape crash

**URL:** <https://mworks.discourse.group/t/parametric-shape-crash/80>\
**Category:** Support\
**Created:** [February 17, 2022, 2:26pm UTC](https://mworks.discourse.group/t/parametric-shape-crash/80 "2022-02-17T14:26:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [February 17, 2022, 2:26pm UTC](https://mworks.discourse.group/t/parametric-shape-crash/80/1 "2022-02-17T14:26:18Z")

</div>

Hi Chris,

As promised, I’ve attached the report from the crash that occurred yesterday while changing the RF finder stimulus’ center y coordinate. I hope this helps, and let me know if you’d like me to send the code that we were running.

Thank you!

Jack

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [February 17, 2022, 2:46pm UTC](https://mworks.discourse.group/t/parametric-shape-crash/80/2 "2022-02-17T14:46:07Z")

</div>

Hi Jack,

This is another instance of a legitimate error in the experiment not being handled properly by MWorks.

The error is in the crash log:

```
Vertex coordinate grid does not contain all points in the shape: coordinate grid covers (-1.85, -1.85) to (1.85, 1.85), but shape points range from (-1.67976, -1.6914) to (1.67976, 1.99863)

```

In other words, the grid you’ve defined via vertex\_coord\_center\_x/y and vertex\_coord\_range doesn’t cover all the points in the shape. I thought refusing to load the stimulus was the right call in this situation, since I couldn’t think of why you wouldn’t want the full shape to be visible. However, if you think a warning would be more appropriate, we can do that instead. (FYI, it might be easier just to set vertex\_coord\_center\_x/y and omit vertex\_coord\_range, in which case MWorks will compute the appropriate range that fits all the shape’s points with the given center.)

Unfortunately, MWorks isn’t handling the error properly, which leads to the crash. I will fix that ASAP.

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [February 17, 2022, 7:59pm UTC](https://mworks.discourse.group/t/parametric-shape-crash/80/3 "2022-02-17T19:59:13Z")

</div>

Hi Chris,

Thank you for looking into this! It’s strange that the range was the issue,  
considering that I’d been able to easily change the ranges in response to  
previous errors, so I’d originally thought it was specifically related to  
the central coordinates alone. Maybe you’re right that a warning would be  
better, and having an automatically computed range also seems fine to me,  
as long as none of the shape is cut off.

Thanks again,

Jack

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [February 18, 2022, 3:37pm UTC](https://mworks.discourse.group/t/parametric-shape-crash/80/4 "2022-02-18T15:37:54Z")

</div>

Hi Jack,

> It’s strange that the range was the issue, considering that I’d been able to easily change the ranges in response to previous errors

Yeah, the specific situation was that the stimulus was being loaded via a variable-attached action, the variable was being assigned as the result of a keyboard input, and the thread where all that happened wasn’t catching the exception that the error raised. In other places (e.g. in a task state), the load failure would raise an error and stop the experiment, but it wouldn’t cause a crash. Like I said, I’ll add some code to guard against such crashes.

Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [February 28, 2022, 3:32pm UTC](https://mworks.discourse.group/t/parametric-shape-crash/80/5 "2022-02-28T15:32:18Z")

</div>

Hi Jack,

There are a few changes of interest to you in the current nightly build:

1. The parametric shape stimulus now warns (instead of raising an error) if the user-specified vertex coordinate grid doesn’t cover all the shape’s points.

2. The load\_stimulus action now catches exceptions caused by loading failure and converts them in to error messages, which prevents them from causing MWServer crashes in places that aren’t expecting exceptions.

3. Unrelatedly, MWorks now embeds Python 3.10 (instead of 3.9). This means, e.g., that you’ll need to install a Python 3.10 build of pyserial whenever you upgrade to a new nightly.

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [February 28, 2022, 9:04pm UTC](https://mworks.discourse.group/t/parametric-shape-crash/80/6 "2022-02-28T21:04:57Z")

</div>

Hi Chris,

Thank you for taking care of these issues! I’ve been testing everything out  
today, and it all seems to be working, but I’ll notify you if we run into  
any issues.

Best,

Jack

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [July 19, 2022, 6:17pm UTC](https://mworks.discourse.group/t/parametric-shape-crash/80/7 "2022-07-19T18:17:34Z")

</div>


