Skip to content

Commit

Permalink
improved error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
cliffckerr committed Sep 15, 2023
1 parent 057b4a2 commit 236d4fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion binomialbias/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def make_globaldict():
else:
slider_keys = []
text_keys = ['ntt', 'fe', 'nat']
round_keys = ['nt', 'ne', 'na', 'ntt'] # These quantities need to be rounded
ui_keys = slider_keys + text_keys

# Define the app defaults
Expand Down Expand Up @@ -245,7 +246,7 @@ def reconcile_inputs():
gv = g[k]
uv = bbm.to_num(u[k])
if not np.isnan(uv):
if k in slider_keys:
if k in round_keys:
uv = round(uv)
match = sc.approx(gv, uv)
if not match: # Avoid floating point errors
Expand Down
4 changes: 1 addition & 3 deletions binomialbias/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,7 @@ def plot(self, dist_color='cornflowerblue', cdf_color='darkblue', ci_color='k',
if gap or i == 1:
ax.text(ira, dy+pmf[ira],'$n_a$', **textkw)

print('TEMP HI I AM', d.n, vmax, type(d.n), type(vmax), d.n/vmax*0.3)

# ax.set_aspect(d.n/vmax*0.3)
ax.set_aspect(d.n/vmax*0.3)

# Add frame labels
if letters:
Expand Down

0 comments on commit 236d4fc

Please sign in to comment.