On Wed, May 8, 2013 at 5:40 PM, Peter Cock p.j.a.cock@googlemail.com wrote:
Hi Cory,
Do you remember if you could solve this? I've used <repeat> a few times even with a min value, but just hit the same issue as you:
AttributeError: 'ExpressionContext' object has no attribute 'keys' ... Module galaxy.tools.parameters.grouping:104 in get_initial_value view
rval_dict[ input.name ] = input.get_initial_value( trans, context )
Module galaxy.tools.parameters.basic:1042 in get_initial_value view
return SelectToolParameter.get_initial_value( self, trans, context )
Module galaxy.tools.parameters.basic:808 in get_initial_value view
if self.need_late_validation( trans, context ):
Module galaxy.tools.parameters.basic:1048 in need_late_validation view
if super( ColumnListParameter, self ).need_late_validation( trans, context ):
Module galaxy.tools.parameters.basic:789 in need_late_validation view
for layer in context.itervalues():
Module UserDict:116 in itervalues view
for _, v in self.iteritems():
Module UserDict:109 in iteritems view
for k in self:
Module UserDict:96 in __iter__ view
for k in self.keys():
AttributeError: 'ExpressionContext' object has no attribute 'keys'
I see this when trying to access the tool via the normal Galaxy web interface, and when running the tool's unit tests. Removing the min="1" value 'fixes' this, but I do want at least one entry.
The tool in question is here: https://bitbucket.org/peterjc/galaxy-central/commits/806d9526d5e846933bb02c9...
On the off chance I was using a special value as the repeat name, I tried changing that - no difference.
Progress, this works (no min value):
<repeat name="identifiers" title="Tabular file(s) with sequence identifiers"> <param name="input_tabular" type="data" format="tabular" label="Tabular file containing sequence identifiers"/> <param name="columns" type="data_column" data_ref="input_tabular" multiple="True" numerical="False" label="Column(s) containing sequence identifiers" help="Multi-select list - hold the appropriate key while clicking to select multiple columns"> <validator type="no_options" message="Pick at least one column"/> </param> </repeat>
This also work - using a min value for the repeat, but removing the data_column parameter,
<repeat name="identifiers" title="Tabular file(s) with sequence identifiers"> <param name="input_tabular" type="data" format="tabular" label="Tabular file containing sequence identifiers"/> </repeat>
However what I want to use fails:
<repeat name="identifiers" title="Tabular file(s) with sequence identifiers" min="1"> <param name="input_tabular" type="data" format="tabular" label="Tabular file containing sequence identifiers"/> <param name="columns" type="data_column" data_ref="input_tabular" multiple="True" numerical="False" label="Column(s) containing sequence identifiers" help="Multi-select list - hold the appropriate key while clicking to select multiple columns"> <validator type="no_options" message="Pick at least one column"/> </param> </repeat>
So something bad is happening with the initial population of the first repeat value (triggered by using min="1") from the "data_column" parameter.
I would guess Cory's example also used a non-trivial parameter type.
Peter