Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime error not reported in PB; instead rv=None is shown #54

Closed
rlisahuang opened this issue Mar 14, 2023 · 2 comments
Closed

runtime error not reported in PB; instead rv=None is shown #54

rlisahuang opened this issue Mar 14, 2023 · 2 comments
Labels
bug Something isn't working PB

Comments

@rlisahuang
Copy link

To replicate:

import matplotlib.pyplot as plt
import pandas as pd
import io


csv = '''
ID,group,time,success
P1,control,18.6,1
P2,control,15.42,1
P3,control,25.55,0
P4,control,12.56,0
P5,control,8.67,1
P6,experiment,7.31,0
P7,experiment,9.66,0
P8,experiment,13.64,1
P9,experiment,14.92,1
P10,experiment,18.47,1
'''


df = pd.read_csv(io.StringIO(csv))

# create a box plot where each box refers to a group
df.boxplot(column='time', by='group')

# remove the grid and increase the limit of y axis to 30
plt.grid(False)
plt.ylim(0, 30)

# add a dashed horizontal line at y=25
plt.axhline(y=25, linestyle='--')

# add a label "limit" next to the horizontal line
plt.text(x=2.45, y=25.5, s='limit')

# for each group, add scatter dots on top of the box using the time data, and mark the dots with blue if success=1, otherwise red
markers = ['o', 'x']
colors = ['blue', 'red']
for i, group in df.groupby('group'):
    for j, (marker, color) in enumerate(zip(markers, colors)):
        x = j + 1
        y = group ['time'][group ['success'] == j]
        plt.scatter(x, y, marker=marker, color=co

Screenshot 2023-03-13 at 10 36 36 PM
lor)

There is a runtime error according to the output panel. However, instead of being displayed inside PB, the runtime error is not reported, and we have rv=None instead.

Can replicate both locally and in the web version.

@rlisahuang rlisahuang added bug Something isn't working PB labels Mar 14, 2023
@rlisahuang
Copy link
Author

Related to #52 ?

@KasraF
Copy link

KasraF commented Mar 15, 2023

Related to #52 ?

Yes! See d379b04 for fix.

@KasraF KasraF closed this as completed Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PB
Projects
None yet
Development

No branches or pull requests

2 participants