Re: [galaxy-dev] workflow input param issue

2012-12-04 Thread Dannon Baker
This should be resolved in changeset 1ac27213bafb in galaxy-central.  Thanks 
for pointing this out!

-Dannon


On Dec 3, 2012, at 11:37 AM, Marc Logghe marc.log...@ablynx.com wrote:

 Hi,
 The conf of the parameters in question looks like this:
param name=project1 type=select label=Project
  options from_data_table=my_projects
filter type=unique_value name=unique column=0/
  /options
/param
param name=target1 type=select label=Target multiple=true
  options from_data_table=my_projects
column name=value index=2/
column name=name index=2/
filter type=param_value ref=project1 name=target column=0/
  /options
  help
Select 1 or more targets if you would like to restrict your data set
  /help
/param
  
 The idea is that if a project is chosen from the project1 dropdown list, the 
 target1 parameter is updated.
 This seems to work fine as a standalone tool.
 As soon as the tool is wrapped into a workflow, this gets broken: if project1 
 is chosen from the list, a server call is made but the response seems to 
 reset the form fields. Both project1 and target1.
  
 Thanks,
 Marc
  
  
  
 From: galaxy-dev-boun...@lists.bx.psu.edu 
 [mailto:galaxy-dev-boun...@lists.bx.psu.edu] On Behalf Of Marc Logghe
 Sent: Monday, December 03, 2012 11:46 AM
 To: galaxy-dev@lists.bx.psu.edu
 Subject: [galaxy-dev] workflow input param issue
  
 Hi,
 I have a workflow that basically needs a select parameter as input. 2 steps 
 in the workflow actually need the very same input. I don’t think there is a 
 (easy) way to let the user only input the parameter once and that it is 
 passed to both steps.
 Anyhow, currently - as a workaround and not very user friendly - the user 
 needs to input the very same parameter twice, for each step where that 
 parameter is required.
 The first issue however, is that as soon as the first parameter is set, the 
 second is set as well apparently (they have the same name, that could 
 explain) which is fine, but not to the chosen one, eg. both are kind of reset 
 to default. No errors or something, simply reset, which makes it impossible 
 to enter the parameter.
  
 
 THIS E-MAIL MESSAGE IS INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR ENTITY 
 TO WHICH IT IS ADDRESSED AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED, 
 CONFIDENTIAL AND EXEMPT FROM DISCLOSURE. 
 If the reader of this E-mail message is not the intended recipient, you are 
 hereby notified that any dissemination, distribution or copying of this 
 communication is strictly prohibited. If you have received this communication 
 in error, please notify us immediately at abl...@ablynx.com. Thank you for 
 your co-operation. 
 NANOBODY and NANOCLONE are registered trademarks of Ablynx N.V. 
  
 ___
 Please keep all replies on the list by using reply all
 in your mail client.  To manage your subscriptions to this
 and other Galaxy lists, please use the interface at:
 
  http://lists.bx.psu.edu/


___
Please keep all replies on the list by using reply all
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

  http://lists.bx.psu.edu/


Re: [galaxy-dev] workflow input param issue

2012-12-03 Thread John Chilton
I am really very sorry about that. It seems this must be related to my
pull request fixing multiple input tool parameters. I have spent
some time this morning trying to reproduce your error, but I cannot.
That said I think I can fix it, this patch should work:

diff --git a/templates/workflow/run.mako b/templates/workflow/run.mako
index c7cd138..175f148 100644
--- a/templates/workflow/run.mako
+++ b/templates/workflow/run.mako
@@ -243,9 +243,12 @@ if wf_parms:
 %if isinstance( param, DataToolParameter ):
 %if ( prefix + param.name ) in step.input_connections_by_name:
 %
-conn = step.input_connections_by_name[ prefix
+ param.name ]
+conns = step.input_connections_by_name[
prefix + param.name ]
+if not isinstance(conns, list):
+conns = [conns]
+vals = [Output dataset '%s' from step %d %
(conn.output_name, int(conn.output_step.order_index)+1
 %
-Output dataset '${conn.output_name}' from step
${int(conn.output_step.order_index)+1}
+${,.join(vals)}
 %else:
 ## FIXME: Initialize in the controller
 %

Can you apply the patch and tell me if it works? Probably a similar
fix needs to be applied to display.mako also, but I want to be able to
recreate the problem first or at least verify this fixes it.

-John

On Mon, Dec 3, 2012 at 4:45 AM, Marc Logghe marc.log...@ablynx.com wrote:
 Hi,

 I have a workflow that basically needs a select parameter as input. 2 steps
 in the workflow actually need the very same input. I don’t think there is a
 (easy) way to let the user only input the parameter once and that it is
 passed to both steps.

 Anyhow, currently - as a workaround and not very user friendly - the user
 needs to input the very same parameter twice, for each step where that
 parameter is required.

 The first issue however, is that as soon as the first parameter is set, the
 second is set as well apparently (they have the same name, that could
 explain) which is fine, but not to the chosen one, eg. both are kind of
 reset to default. No errors or something, simply reset, which makes it
 impossible to enter the parameter.



 Next, I hoped to solve the issue by upgrading galaxy to the most recent
 version. This was not the case since the workflow did not run at all
 anymore, which brings me to the second issue (see exception dump below).

 Any ideas anyone ?

 Thanks and regards,

 Marc





 Error - type 'exceptions.AttributeError': 'list' object has no attribute
 'output_name'

 URL: http://smith:8889/workflow/run?id=4b187121143038ff

 File
 '/home/galaxy/galaxy-dev/eggs/Paste-1.6-py2.7.egg/paste/exceptions/errormiddleware.py',
 line 143 in __call__

   app_iter = self.application(environ, start_response)

 File '/home/galaxy/galaxy-dev/eggs/Paste-1.6-py2.7.egg/paste/recursive.py',
 line 80 in __call__

   return self.application(environ, start_response)

 File
 '/home/galaxy/galaxy-dev/eggs/Paste-1.6-py2.7.egg/paste/httpexceptions.py',
 line 632 in __call__

   return self.application(environ, start_response)

 File '/home/galaxy/galaxy-dev/lib/galaxy/web/framework/base.py', line 160 in
 __call__

   body = method( trans, **kwargs )

 File
 '/home/galaxy/galaxy-dev/lib/galaxy/webapps/galaxy/controllers/workflow.py',
 line 1523 in run

   enable_unique_defaults=trans.app.config.enable_unique_workflow_defaults)

 File '/home/galaxy/galaxy-dev/lib/galaxy/web/framework/__init__.py', line
 836 in fill_template

   return self.fill_template_mako( filename, **kwargs )

 File '/home/galaxy/galaxy-dev/lib/galaxy/web/framework/__init__.py', line
 847 in fill_template_mako

   return template.render( **data )

 File '/home/galaxy/galaxy-dev/eggs/Mako-0.4.1-py2.7.egg/mako/template.py',
 line 296 in render

   return runtime._render(self, self.callable_, args, data)

 File '/home/galaxy/galaxy-dev/eggs/Mako-0.4.1-py2.7.egg/mako/runtime.py',
 line 660 in _render

   **_kwargs_for_callable(callable_, data))

 File '/home/galaxy/galaxy-dev/eggs/Mako-0.4.1-py2.7.egg/mako/runtime.py',
 line 692 in _render_context

   _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)

 File '/home/galaxy/galaxy-dev/eggs/Mako-0.4.1-py2.7.egg/mako/runtime.py',
 line 718 in _exec_template

   callable_(context, *args, **kwargs)

 File '/home/galaxy/galaxy-dev/database/compiled_templates/base.mako.py',
 line 42 in render_body

   __M_writer(unicode(next.body()))

 File
 '/home/galaxy/galaxy-dev/database/compiled_templates/workflow/run.mako.py',
 line 171 in render_body

   __M_writer(unicode(do_inputs( tool.inputs, step.state.inputs, errors.get(
 step.id, dict() ), , step, None, used_accumulator )))

 File
 '/home/galaxy/galaxy-dev/database/compiled_templates/workflow/run.mako.py',
 line 40 in do_inputs

   return
 

Re: [galaxy-dev] workflow input param issue

2012-12-03 Thread Marc Logghe
Hi John,
Your patch works indeed. Issues--
Thanks,
Marc

-Original Message-
From: jmchil...@gmail.com [mailto:jmchil...@gmail.com] On Behalf Of John Chilton
Sent: Monday, December 03, 2012 2:58 PM
To: Marc Logghe
Cc: galaxy-dev@lists.bx.psu.edu
Subject: Re: [galaxy-dev] workflow input param issue

I am really very sorry about that. It seems this must be related to my pull 
request fixing multiple input tool parameters. I have spent some time this 
morning trying to reproduce your error, but I cannot.
That said I think I can fix it, this patch should work:

diff --git a/templates/workflow/run.mako b/templates/workflow/run.mako index 
c7cd138..175f148 100644
--- a/templates/workflow/run.mako
+++ b/templates/workflow/run.mako
@@ -243,9 +243,12 @@ if wf_parms:
 %if isinstance( param, DataToolParameter ):
 %if ( prefix + param.name ) in step.input_connections_by_name:
 %
-conn = step.input_connections_by_name[ prefix
+ param.name ]
+conns = step.input_connections_by_name[
prefix + param.name ]
+if not isinstance(conns, list):
+conns = [conns]
+vals = [Output dataset '%s' from step %d %
(conn.output_name, int(conn.output_step.order_index)+1
 %
-Output dataset '${conn.output_name}' from step
${int(conn.output_step.order_index)+1}
+${,.join(vals)}
 %else:
 ## FIXME: Initialize in the controller
 %

Can you apply the patch and tell me if it works? Probably a similar fix needs 
to be applied to display.mako also, but I want to be able to recreate the 
problem first or at least verify this fixes it.

-John

On Mon, Dec 3, 2012 at 4:45 AM, Marc Logghe marc.log...@ablynx.com wrote:
 Hi,

 I have a workflow that basically needs a select parameter as input. 2 
 steps in the workflow actually need the very same input. I don't think 
 there is a
 (easy) way to let the user only input the parameter once and that it 
 is passed to both steps.

 Anyhow, currently - as a workaround and not very user friendly - the 
 user needs to input the very same parameter twice, for each step where 
 that parameter is required.

 The first issue however, is that as soon as the first parameter is 
 set, the second is set as well apparently (they have the same name, 
 that could
 explain) which is fine, but not to the chosen one, eg. both are kind 
 of reset to default. No errors or something, simply reset, which makes 
 it impossible to enter the parameter.



 Next, I hoped to solve the issue by upgrading galaxy to the most 
 recent version. This was not the case since the workflow did not run 
 at all anymore, which brings me to the second issue (see exception dump 
 below).

 Any ideas anyone ?

 Thanks and regards,

 Marc





 Error - type 'exceptions.AttributeError': 'list' object has no 
 attribute 'output_name'

 URL: http://smith:8889/workflow/run?id=4b187121143038ff

 File
 '/home/galaxy/galaxy-dev/eggs/Paste-1.6-py2.7.egg/paste/exceptions/err
 ormiddleware.py',
 line 143 in __call__

   app_iter = self.application(environ, start_response)

 File 
 '/home/galaxy/galaxy-dev/eggs/Paste-1.6-py2.7.egg/paste/recursive.py',
 line 80 in __call__

   return self.application(environ, start_response)

 File
 '/home/galaxy/galaxy-dev/eggs/Paste-1.6-py2.7.egg/paste/httpexceptions
 .py',
 line 632 in __call__

   return self.application(environ, start_response)

 File '/home/galaxy/galaxy-dev/lib/galaxy/web/framework/base.py', line 
 160 in __call__

   body = method( trans, **kwargs )

 File
 '/home/galaxy/galaxy-dev/lib/galaxy/webapps/galaxy/controllers/workflo
 w.py',
 line 1523 in run

   
 enable_unique_defaults=trans.app.config.enable_unique_workflow_default
 s)

 File '/home/galaxy/galaxy-dev/lib/galaxy/web/framework/__init__.py', 
 line
 836 in fill_template

   return self.fill_template_mako( filename, **kwargs )

 File '/home/galaxy/galaxy-dev/lib/galaxy/web/framework/__init__.py', 
 line
 847 in fill_template_mako

   return template.render( **data )

 File 
 '/home/galaxy/galaxy-dev/eggs/Mako-0.4.1-py2.7.egg/mako/template.py',
 line 296 in render

   return runtime._render(self, self.callable_, args, data)

 File 
 '/home/galaxy/galaxy-dev/eggs/Mako-0.4.1-py2.7.egg/mako/runtime.py',
 line 660 in _render

   **_kwargs_for_callable(callable_, data))

 File 
 '/home/galaxy/galaxy-dev/eggs/Mako-0.4.1-py2.7.egg/mako/runtime.py',
 line 692 in _render_context

   _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)

 File 
 '/home/galaxy/galaxy-dev/eggs/Mako-0.4.1-py2.7.egg/mako/runtime.py',
 line 718 in _exec_template

   callable_(context, *args, **kwargs)

 File 
 '/home/galaxy/galaxy-dev/database/compiled_templates/base.mako.py',
 line 42 in render_body

   __M_writer(unicode(next.body()))

 File
 '/home/galaxy/galaxy-dev/database