mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Fixes for dealing with UnvalidatedValues (i.e. when running workflows) and also when passing None trans to dynamic options.
This commit is contained in:
@@ -464,7 +464,7 @@ class JobWrapper( object ):
|
||||
# custom post process setup
|
||||
inp_data = dict( [ ( da.name, da.dataset ) for da in job.input_datasets ] )
|
||||
out_data = dict( [ ( da.name, da.dataset ) for da in job.output_datasets ] )
|
||||
param_dict = dict( [ ( p.name, p.value ) for p in job.parameters ] ) # why not re-use self.param_dict here?
|
||||
param_dict = dict( [ ( p.name, p.value ) for p in job.parameters ] ) # why not re-use self.param_dict here? ##dunno...probably should, this causes tools.parameters.basic.UnvalidatedValue to be used in following methods instead of validated and transformed values during i.e. running workflows
|
||||
param_dict = self.tool.params_from_strings( param_dict, self.app )
|
||||
# Check for and move associated_files
|
||||
self.tool.collect_associated_files(out_data)
|
||||
|
||||
@@ -948,7 +948,10 @@ class Tool:
|
||||
# Regular tool parameter
|
||||
value = input_values[ input.name ]
|
||||
if isinstance( value, UnvalidatedValue ):
|
||||
value = input.from_html( value.value, None, context )
|
||||
if value.value is None: #if value.value is None, it could not have been submited via html form and therefore .from_html can't be guaranteed to work
|
||||
value = None
|
||||
else:
|
||||
value = input.from_html( value.value, None, context )
|
||||
# Then do any further validation on the value
|
||||
input.validate( value, None )
|
||||
input_values[ input.name ] = value
|
||||
|
||||
@@ -102,7 +102,7 @@ class DataMetaFilter( Filter ):
|
||||
if self.multiple:
|
||||
return dataset_value in file_value.split( self.separator )
|
||||
return file_value == dataset_value
|
||||
assert self.ref_name in other_values or trans.workflow_building_mode, "Required dependency '%s' not found in incoming values" % self.ref_name
|
||||
assert self.ref_name in other_values or ( trans is not None and trans.workflow_building_mode), "Required dependency '%s' not found in incoming values" % self.ref_name
|
||||
ref = other_values.get( self.ref_name, None )
|
||||
if not isinstance( ref, self.dynamic_option.tool_param.tool.app.model.HistoryDatasetAssociation ):
|
||||
return [] #not a valid dataset
|
||||
@@ -146,9 +146,9 @@ class ParamValueFilter( Filter ):
|
||||
def get_dependency_name( self ):
|
||||
return self.ref_name
|
||||
def filter_options( self, options, trans, other_values ):
|
||||
if trans.workflow_building_mode: return []
|
||||
if trans is not None and trans.workflow_building_mode: return []
|
||||
assert self.ref_name in other_values, "Required dependency '%s' not found in incoming values" % self.ref_name
|
||||
ref = str( other_values.get( self.ref_name, None ) )
|
||||
assert ref is not None, "Required dependency '%s' not found in incoming values" % self.ref_name
|
||||
rval = []
|
||||
for fields in options:
|
||||
if ( self.keep and fields[self.column] == ref ) or ( not self.keep and fields[self.column] != ref ):
|
||||
|
||||
@@ -80,7 +80,7 @@ def load_microbial_data( GALAXY_DATA_INDEX_DIR, sep='\t' ):
|
||||
return microbe_info
|
||||
|
||||
#post processing, set build for data and add additional data to history
|
||||
from galaxy import datatypes, config, jobs
|
||||
from galaxy import datatypes, config, jobs, tools
|
||||
from shutil import copyfile
|
||||
|
||||
def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr):
|
||||
@@ -95,7 +95,12 @@ def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr
|
||||
#if not (kingdom or group or org):
|
||||
if not (kingdom or org):
|
||||
print "Parameters are not available."
|
||||
|
||||
#workflow passes galaxy.tools.parameters.basic.UnvalidatedValue instead of values
|
||||
if isinstance( kingdom, tools.parameters.basic.UnvalidatedValue ):
|
||||
kingdom = kingdom.value
|
||||
if isinstance( org, tools.parameters.basic.UnvalidatedValue ):
|
||||
org = org.value
|
||||
|
||||
GALAXY_DATA_INDEX_DIR = app.config.tool_data_path
|
||||
microbe_info = load_microbial_data( GALAXY_DATA_INDEX_DIR, sep='\t' )
|
||||
new_stdout = ""
|
||||
|
||||
Reference in New Issue
Block a user