You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These seems really fragile. If I'm not mistaken, it relies on the user specifying the arguments to --wc-vals as NAME=VAL, (note the trailing ,).
I suggest that either force the argument to --wc-vals be a single long string, ala NAME1=VAL1,NAME2=VAL2,... or change the action to 'extend' and indicate that each entry should be of the form NAME=VAL. To make the above code work with this latter case, you can do:
wc_vals = [x.split('=') for x in wc_vals]
wcs_dict = {k: float(x) for k,v in wc_vals}
I personally prefer the 2nd option as it only relies on the user needing to know to use the = as delimiter and this is made obvious if they look at the code, i.e. the x.split('=') line.
topeft/analysis/topeft_run2/make_cards.py
Lines 227 to 229 in e96fedb
These seems really fragile. If I'm not mistaken, it relies on the user specifying the arguments to
--wc-vals
asNAME=VAL,
(note the trailing,
).I suggest that either force the argument to
--wc-vals
be a single long string, alaNAME1=VAL1,NAME2=VAL2,...
or change theaction
to'extend'
and indicate that each entry should be of the formNAME=VAL
. To make the above code work with this latter case, you can do:I personally prefer the 2nd option as it only relies on the user needing to know to use the
=
as delimiter and this is made obvious if they look at the code, i.e. thex.split('=')
line.Originally posted by @Andrew42 in #406 (comment)
The text was updated successfully, but these errors were encountered: