Skip to content

Commit

Permalink
gets lack of physio bars working
Browse files Browse the repository at this point in the history
  • Loading branch information
billbrod committed Oct 21, 2024
1 parent 8734716 commit 316bfb3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
17 changes: 8 additions & 9 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ wildcard_constraints:
save_all='|_saveall',
gammacorrected='|_gamma-corrected',
plot_focus='|_focus-subject|_focus-image',
physio='|_physio-bars',
ecc_mask="|_eccmask-[0-9]+",
logscale="log|linear",
mcmc_model="partially-pooled|unpooled|partially-pooled-interactions-[.0-9]+|partially-pooled-interactions",
Expand Down Expand Up @@ -2436,13 +2435,13 @@ rule mcmc_performance_comparison_figure:
op.join(config['DATA_DIR'], 'dacey_data',
'Dacey1992_mcmc_line-nooffset_step-.1_prob-.8_depth-10_c-4_d-1000_w-1000_s-10.nc'),
output:
op.join(config['DATA_DIR'], 'figures', '{context}', 'mcmc{scaling_extended}_{mcmc_model}_{mcmc_plot_type}_{focus}{physio}.{ext}'),
op.join(config['DATA_DIR'], 'figures', '{context}', 'mcmc{scaling_extended}_{mcmc_model}_{mcmc_plot_type}_{focus}.{ext}'),
log:
op.join(config['DATA_DIR'], 'logs', 'figures', '{context}',
'mcmc{scaling_extended}_{mcmc_model}_{mcmc_plot_type}_{focus}{physio}_{ext}.log')
'mcmc{scaling_extended}_{mcmc_model}_{mcmc_plot_type}_{focus}_{ext}.log')
benchmark:
op.join(config['DATA_DIR'], 'logs', 'figures', '{context}',
'mcmc{scaling_extended}_{mcmc_model}_{mcmc_plot_type}_{focus}{physio}_{ext}_benchmark.txt')
'mcmc{scaling_extended}_{mcmc_model}_{mcmc_plot_type}_{focus}_{ext}_benchmark.txt')
run:
import foveated_metamers as fov
import contextlib
Expand Down Expand Up @@ -2539,7 +2538,7 @@ rule mcmc_performance_comparison_figure:
logscale_xaxis=True,
increase_size=False)
g.fig.canvas.draw()
if 'bars' in wildcards.physio:
if 'physio-bars' in wildcards.focus:
fov.plotting.add_physiological_scaling_bars(g.ax, az.from_netcdf(input[-1]))
fig = g.fig
if 'line' in wildcards.focus:
Expand Down Expand Up @@ -2660,11 +2659,11 @@ rule performance_comparison_figure:
op.join(config['DATA_DIR'], 'dacey_data',
'Dacey1992_mcmc_line-offset_step-.1_prob-.8_depth-10_c-4_d-1000_w-1000_s-10.nc'),
output:
op.join(config['DATA_DIR'], 'figures', '{context}', 'performance_{focus}{physio}.svg')
op.join(config['DATA_DIR'], 'figures', '{context}', 'performance_{focus}.svg')
log:
op.join(config['DATA_DIR'], 'logs', 'figures', '{context}', 'performance_{focus}{physio}.log')
op.join(config['DATA_DIR'], 'logs', 'figures', '{context}', 'performance_{focus}.log')
benchmark:
op.join(config['DATA_DIR'], 'logs', 'figures', '{context}', 'performance_{focus}{physio}_benchmark.txt')
op.join(config['DATA_DIR'], 'logs', 'figures', '{context}', 'performance_{focus}_benchmark.txt')
run:
import foveated_metamers as fov
import pandas as pd
Expand Down Expand Up @@ -2718,7 +2717,7 @@ rule performance_comparison_figure:
style='trial_type',
aspect=2 if col is None else 1,
logscale_xaxis=logscale_xaxis)
if col is None and 'bars' in wildcards.physio:
if col is None and 'physio-bars' in wildcards.focus:
# need to draw so that the following code can check text size
g.fig.canvas.draw()
fov.plotting.add_physiological_scaling_bars(g.ax, az.from_netcdf(input[-1]))
Expand Down
4 changes: 3 additions & 1 deletion foveated_metamers/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,9 @@ def lineplot_like_pointplot(data, x, y, col=None, row=None, hue=None, ci=95,
# used in pointplot (which uses scatter). I also added an extra factor of
# sqrt(2) (by changing the 2 to a 4 in the sqrt below), which looks
# necessary
ms = kwargs.pop('markersize', np.sqrt(np.pi * np.square(lw) * 4))
ms = kwargs.pop('markersize', None)
if ms is None:
ms = np.sqrt(np.pi * np.square(lw) * 4)
if ax is None:
if col is not None:
col_order = kwargs.pop('col_order', sorted(data[col].unique()))
Expand Down

0 comments on commit 316bfb3

Please sign in to comment.