# HG changeset patch # User rv43 # Date 1659469967 0 # Node ID ca61007a60fa96d79de42b484535e33e7c8c1fd3 # Parent bead50a4eadc8e32163ed4365cab44f36a44a0c5 "planemo upload for repository https://github.com/rolfverberg/galaxytools commit fc9b26da497e467c28b0adf3f94422b4cb61f59c" diff -r bead50a4eadc -r ca61007a60fa general.py --- a/general.py Thu Jul 28 17:44:49 2022 +0000 +++ b/general.py Tue Aug 02 19:52:47 2022 +0000 @@ -334,6 +334,7 @@ i = input() if isinstance(i, str) and not len(i): v = default + print(f'{v}') else: v = literal_eval(i) if inset and v not in inset: @@ -389,6 +390,7 @@ i = input() if isinstance(i, str) and not len(i): v = default + print(f'{v}') else: v = literal_eval(i) except (ValueError, TypeError, SyntaxError, MemoryError, RecursionError): @@ -460,6 +462,7 @@ i = input() if isinstance(i, str) and not len(i): i = default + print(f'{i}') if i is not None and i.lower() in 'yes': v = True elif i is not None and i.lower() in 'no': @@ -487,16 +490,25 @@ print(f'{header} (1, {len(items)}){default_string}:') for i, choice in enumerate(items): print(f' {i+1}: {choice}') - choice = input() - if isinstance(choice, str) and not len(choice): - choice = items.index(default) - else: - choice = literal_eval(choice) - if isinstance(choice, int) and 1 <= choice <= len(items): - choice -= 1 + try: + choice = input() + if isinstance(choice, str) and not len(choice): + choice = items.index(default) + print(f'{choice+1}') else: - print(f'Illegal choice, enter a number between 1 and {len(items)}') - choice = input_menu(items, default) + choice = literal_eval(choice) + if isinstance(choice, int) and 1 <= choice <= len(items): + choice -= 1 + else: + raise ValueError + except (ValueError, TypeError, SyntaxError, MemoryError, RecursionError): + choice = None + except: + print('Unexpected error') + raise + if choice is None: + print(f'Illegal choice, enter a number between 1 and {len(items)}') + choice = input_menu(items, default) return choice def create_mask(x, bounds=None, reverse_mask=False, current_mask=None): @@ -525,7 +537,7 @@ return mask def draw_mask_1d(ydata, xdata=None, current_index_ranges=None, current_mask=None, - select_mask=True, num_index_ranges_max=None, title=None, legend=None): + select_mask=True, num_index_ranges_max=None, title=None, legend=None, test_mode=False): def draw_selections(ax): ax.clear() ax.set_title(title) @@ -679,30 +691,32 @@ if current_include[-1][1] < num_data-1: current_exclude.append((current_include[-1][1]+1, num_data-1)) - # Set up matplotlib figure - plt.close('all') - fig, ax = plt.subplots() - plt.subplots_adjust(bottom=0.2) - draw_selections(ax) + if not test_mode: - # Set up event handling for click-and-drag range selection - cid_click = fig.canvas.mpl_connect('button_press_event', onclick) - cid_release = fig.canvas.mpl_connect('button_release_event', onrelease) + # Set up matplotlib figure + plt.close('all') + fig, ax = plt.subplots() + plt.subplots_adjust(bottom=0.2) + draw_selections(ax) + + # Set up event handling for click-and-drag range selection + cid_click = fig.canvas.mpl_connect('button_press_event', onclick) + cid_release = fig.canvas.mpl_connect('button_release_event', onrelease) - # Set up confirm / clear range selection buttons - confirm_b = Button(plt.axes([0.75, 0.05, 0.15, 0.075]), 'Confirm') - clear_b = Button(plt.axes([0.59, 0.05, 0.15, 0.075]), 'Clear') - cid_confirm = confirm_b.on_clicked(confirm_selection) - cid_clear = clear_b.on_clicked(clear_last_selection) + # Set up confirm / clear range selection buttons + confirm_b = Button(plt.axes([0.75, 0.05, 0.15, 0.075]), 'Confirm') + clear_b = Button(plt.axes([0.59, 0.05, 0.15, 0.075]), 'Clear') + cid_confirm = confirm_b.on_clicked(confirm_selection) + cid_clear = clear_b.on_clicked(clear_last_selection) - # Show figure - plt.show(block=True) + # Show figure + plt.show(block=True) - # Disconnect callbacks when figure is closed - fig.canvas.mpl_disconnect(cid_click) - fig.canvas.mpl_disconnect(cid_release) - confirm_b.disconnect(cid_confirm) - clear_b.disconnect(cid_clear) + # Disconnect callbacks when figure is closed + fig.canvas.mpl_disconnect(cid_click) + fig.canvas.mpl_disconnect(cid_release) + confirm_b.disconnect(cid_confirm) + clear_b.disconnect(cid_clear) # Swap selection depending on select_mask if not select_mask: diff -r bead50a4eadc -r ca61007a60fa tomo_setup.xml --- a/tomo_setup.xml Thu Jul 28 17:44:49 2022 +0000 +++ b/tomo_setup.xml Tue Aug 02 19:52:47 2022 +0000 @@ -1,4 +1,4 @@ - + Preprocess tomography images tomo_macros.xml @@ -24,55 +24,136 @@ --output_config 'output_config.yaml' -l '$log' #for $s in $input.tomo_sets# ${s.offset} ${s.num} #end for + ]]> - + + + - -
- - - -
- - - - - + + + + - - - - - - + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - - - - - - - - - - - - - - - + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -87,8 +168,10 @@ - + + +