Commit Graph
77 Commits
Author SHA1 Message Date
John Chilton 937a9eeef8 Fix unit tests for ddbe0d1. 2015-02-03 20:09:46 -05:00
Dannon Baker dba89dff83 Convert everything from elementtree to stdlib xml module. 2015-01-29 16:10:56 -05:00
John Chilton 44f7317fa5 Allow tools to output collections with static or determinable structure.
By "static" I mean tools such as a FASTQ de-interlacer that would produce a "paired" collection with two datasets everytime. By "determinable" I mean tools that perform N->N operations within the same job - such as a tool that needs to normalize a bunch of datasets all at once and not in separate jobs. (For N->N collection operations that should or can be done in N separate jobs tool authors should just write tools that operate over a dataset and produce a dataset and let the end-user 'map over' that operation.)

There are still large classes of operations where the structure of the output collection cannot be pre-determined - such as splitting files (e.g. bam files by read group) - that are not implemented in this commit.

Model:

The models have been updated to do a more thorough job of tracking collection outputs. Jobs just producing HistoryDatasetCollectionAssociations works fine for simple jobs producing collections - but you don't want to map a list over a tool that produces a pair and produce a bunch of pairs HDCAs and a list:pair HDCA- you just want a bunch of pieces and the one list:pair at that the top.

Workflow:

Workflows containing such operations can be executed - but the workflow editor has not been updated to handle this complexity (and it will require a significant overhaul) so such tools are not available in the workflow editor.

Tool Testing:

This commit also introduces a new tool XML syntax for describing tests on output collections. See files test/functional/tools/collection_creates_list.xml and test/functional/tools/collection_creates_pair.xml for examples.

Tests:

Includes two tools to test this - one that uses explicit pair output names and one that iterates over the structure of input list to produce an output list.

Includes several new tools API tests that test the tools described above via the API and implicit mapping over such tools. Includes two new workflow API tests - one that verifies a simple workflow with output collections works and one that verifies mapping over workflow steps in collections works.
2015-01-15 09:30:00 -05:00
John Chilton 6dd7f5a0fb Unit test to verify tool panel handles multiple successive TS install...
In particular that the integrated panel reflects all the installed tools but that they are groupped correctly in ToolBox._tool_panel.
2015-01-01 10:02:23 -05:00
John Chilton aa86181e7c Move ToolSection and ToolSectionLabel out of galaxy.tools directly.
Would like to move the whole ToolBox out of galaxy.tools and into galaxy.tools.toolbox but need to separate all dependencies on galaxy.tools first.
2014-12-31 18:21:10 -05:00
John Chilton 7e45ca2a72 Allow multiple tools with the same id in ToolBox.
How to use:

 1.) Place multiple tools with different IDs in your tool conf.
 2.) ... ummm ... no step 2 - just use the tools.

Implementation:

The Tool Shed allows tool lineages by assigning each tool version a GUID and tracking versions in a database. This
implementation works by simply allowing the ToolBox to contain multiple tools with the same ID and orders them by the version specified by the tool author.

To track enable this a second tool lineage has been introduced that just uses tool versions instead of a database (non-toolshed installed tools are not longer placed into the Tool Shed install database). The ToolBox has been updated to allow multiple versions per tool id (defaulting to the 'latest' version for all operations which do not specify a version). Both jobs and workflow steps would track tool versions but did not use that version when fetching tools from the Toolbox - these components have been updated to try to use the tool version.

Unit tests working through most of the ToolBox and tool panel have been added, as well as functional tests exercising the tools API and to ensure workflows now at least attempt to respect tool versions (still kind of silently switches versions in some cases). Manual tests against the new tool form seem to demonstrate the tool switching and tool re-running work with only minor changes to the tools API and the job handler.
2014-12-31 18:21:10 -05:00
John Chilton 9b5f374189 Move galaxy.tools.filters to galaxy.tools.toolbox.filters.
Leave empty module in galaxy.tools.filters and modify config to ensure backward compatibility (filters in this old directory will continue to work for now).

Update config/galaxy.ini.sample with more discussion of ToolBox filter.
2014-12-29 23:07:01 -05:00
John Chilton 66625dfc69 Move galaxy.tools.watcher into galaxy.tools.toolbox.watcher. 2014-12-29 23:07:01 -05:00
John Chilton aad51263f0 Various ToolBox filtering improvements and tests.
- Allow overriding the base module location for ToolBox filters (needed for OS packages, etc...).
 - Allow scanning multiple base modules for filters.
 - Unit tests for module loading functionality, custom tool, label, and section filters, default hidden and require_login filters.
2014-12-29 23:07:01 -05:00
John Chilton 2717c85e54 Update attribute and method names in ToolBox to reflect encapsulation efforts.
Using ToolBox._xxx instead of ToolBox.__xxx because realistically ToolBox is still much to large to grok and so I imagine it will need to be broken up even more (base class focused on just the panel details perhaps - or mixins - etc...).
2014-12-29 12:23:55 -05:00
John Chilton 0e17abd7ea Fix unit tests for 7cee92f. 2014-12-29 11:10:41 -05:00
John Chilton 7dca5cb1f6 Bugfix for 44dfa6f and typos in unit tests that caused it to go undetected. 2014-12-28 23:25:56 -05:00
John Chilton 280dc18442 De-duplication for loading elements into the tool panel.
Create one public method load_item on ToolBox that should be used externally instead of load_tool_tag_set, load_section_tag_set, etc.... This reduces the duplication within the toolbox and between the toolbox and the Tool Shed's ToolPanelManager. Probably more importantly it also is another step down the road toward hiding implementation details such as toolbox.tool_panel and toolbox.intergrated_tool_panel from the ToolPanelManager.

Already had unit test coverage for ToolPanelManager stuff here - but added test coverage for loading labels, workflows, and tool directories.
2014-12-28 11:23:44 -05:00
John Chilton 36599a16d2 Simplify shed-y logic in load_tool_tag_set.
Drops cycolomatic complexity from 14 to 10 for that method.
2014-12-28 11:23:44 -05:00
John Chilton 974a4c124f Introduce abstraction shielding toolbox.tools_by_id from galaxy.workflow.modules.
That was the last module outside of ToolBox itself that was accessing tools_by_id directly.
2014-12-26 09:55:27 -05:00
John Chilton fd1c34b4c9 Unit test coverage for removing stuff from the toolbox.
Covers cases for tools inside and outside of sections and both deactivation versus uninstallation.
2014-12-24 00:42:54 -05:00
John Chilton 0e0b3199e7 Add tool lineage test for tools outside of sections. 2014-12-23 22:17:55 -05:00
John Chilton fd1ab33231 Unit test for tool panel merging tools by tool shed lineage. 2014-12-23 21:42:37 -05:00
John Chilton 00f68131df More tool panel manager unit tests.
(Including adding file missing with previous commit 697b58f0.)
2014-12-23 21:42:37 -05:00
John Chilton b292873de6 Move ToolPanelManager operation to create or get section into ToolBox.
Now with unit test. Part of broader effort to make ToolBox interface more explicit, tested, and hide implementation details from other parts of code (such as ToolPanelManager).

Also reworked the code to now build up and re-parse XML structures - just use a dictionary - thanks to 34b3e1c.
2014-12-23 14:22:08 -05:00
John Chilton 1acda2715f Introduce abstraction for updating ToolBox's shed configs.
Hides some details of writing out integrated tool panel, reindexing, etc... from tool shed install code and reduces duplicatation in tool shed's tool_panel_manager.

Add unit tests.
2014-12-23 13:52:39 -05:00
John Chilton d2081e1fea Start work on unit tests for galaxy.tools.ToolBox. 2014-12-23 13:52:39 -05:00
John Chilton fb1e9fc5f4 Start decoupling Toolbox elements from XML (sections+labels).
Just a small tweak and some tests to verify these things can indeed be created from dictionaries. Also slightly simplifies galaxy.tools.
2014-12-22 13:16:30 -05:00
John Chilton ace30535b2 Improvements to loading help text from tools.
Do not convert rst to a mako template until needed, this is a costly operation and has the potential to speed update Galaxy start time. Move logic related to parsing of simple help text blocks out of tool and into the new tool parser interface and add implementation for YAML-based tools as well as unit tests for both. More advanced, multi-page tool help is still possible, workflows with the old tool form, but is only available to XML-based tools.
2014-12-13 22:09:51 -05:00
John Chilton ec24396140 Refactoring: Start abstracting XML processing out of Tool and param classes.
Long term this could allow Galaxy to support - multiple tooling formats (Galaxy-like YAML, CWL http://bit.ly/cwltooldesc, etc...). But I think it is also important from a purely design perspective - this is a core logic class integrating different components - they should not also be doing XML parsing.

To verify the interface for parsing tools is expressive enough to allow multiple useful implementations, I built a test YAML tool description that implements many of the same features as Galaxy but smooths out rough edges (uses exit codes for job failure by default for instance). Loading these tools is disabled by default and it is not documented how to enable them because they are not intended to be part of Galaxy's public API.
2014-12-11 00:26:13 -05:00
John Chilton 461b8a7f5a More testing for parameter parsing. 2014-12-10 23:51:45 -05:00
John Chilton a0f853c4c7 Unit testing explicitly related to parsing of XML for parameters.
Cleans up some existing tests and does some de-duplication as well.
2014-12-10 11:49:50 -05:00
John Chilton 441081613c Merged in jmchilton/galaxy-central-fork-1 (pull request #575)
Allow using attribute 'optional' for data column parameters.
2014-12-04 09:50:45 -05:00
John Chilton 0b80d5e895 Merge next-stable. 2014-11-25 23:03:03 -05:00
John Chilton 2f5f2cc2df Skip galaxy.tools.watcher test if watchdog unavailable.
Instead of failing.
2014-11-25 23:02:05 -05:00
John Chilton c9efbe9b75 Allow using attribute 'optional' for data column parameters.
For consistency with other parameters, has the opposite effect of 'force_select'.
2014-11-25 10:57:49 -05:00
John Chilton 5b493218f6 Unit tests for pull request #568. 2014-11-21 10:27:18 -05:00
John Chilton 18054a05fc Options to load and watch directories of tools, auto reload on update of any tool.
Allow tool panel to contain a <tool_dir dir="foo" /> element. Tools in such a directory will be loaded at startup time.

Additionally, if watch_tools is set to True in config/galaxy.ini and watchdog (http://pythonhosted.org/watchdog/) is available to Galaxy - all tools will be dynamically reloaded as they are modified and new tools that are added to the tool_dir directories will be dynamically populated (no need to restart Galaxy).
2014-09-28 17:25:12 -04:00
John Chilton d8457bb7ee Unit tests for tool action code determining output formats.
With refactoring to reduce cyclomatic complexity. Also renaming 'input_ext' what it actually is 'random_input_ext'. We should fix that or at least issue a huge warning if we detect 'input' could have reasonable been different things.
2014-09-03 08:43:25 -04:00
John Chilton 6515dc274d Unit test for galaxy.tools.action to ensure all datasets get same object store id.
Enables subsequent refactoring.
2014-09-03 08:43:25 -04:00
John Chilton fe0c53c930 Fix new Tool.get_externally_referenced_paths to find imported macro files.
Should fix this bug https://trello.com/c/TeguDYSq discovered by Bjoern... on stage at the GCC.
2014-08-04 12:18:00 -04:00
John Chilton daaf2c8cf0 Restructure tool external file logic in load_tool_from_tmp_config in ToolValidator...
... so internals of tool XML description are only utilized in the galaxy.tools module (and submodules). Add some unit tests for this new method for finding externally referenced files.
2014-08-04 12:18:00 -04:00
John Chilton 10fd2279ee Fix some basic citation unit tests missing from PR #440. 2014-07-28 19:18:40 -04:00
John Chilton ba04c4ab9a More collection-y state update tests. 2014-07-24 14:30:11 -05:00
John Chilton b6be01a5b5 Fix tool multi-run inside conditionals and repeats during state updates.
Fixes multirun inside of conditional, repeats if tool form state updated (e.g. because conditional param updated or repeat block added).

More tests - ugly tests - but tests.
2014-07-03 20:41:09 -05:00
John Chilton 5f5cc36950 Fix unit tests broken with 4de240e. 2014-07-03 20:41:09 -05:00
John Chilton d0f33bc14e Fix unit tests for 315997f. 2014-06-01 18:30:44 -05:00
John Chilton f33bb43025 Merged in jmchilton/galaxy-central-fork-1 (pull request #389)
Small Column Parameter Enhancements
2014-05-15 13:49:44 -05:00
John Chilton c79e4dcc40 Fix duplicated names in on_text when using multiple data inputs.
Unit tests verifing the fixed, correct behavior included. Bug introduced in e8c84dd715782e7c1d709d8068e6033b835f7f39 as an unintended consequence of duplicating the first dataset in the dictionary of input datasets generated by the tool action code.

Fixes https://trello.com/c/LCEKxImR.
2014-05-13 17:47:57 -05:00
John Chilton 22bddab240 Implement serializable class that can describe full dependency context for remote dependency resolution.
Previously LWR jut serialized tool requirements, by transitioning to this class LWR should be able to resolve tool shed installed packages as well - requiring the additional repository and tool dependency context.
2014-05-13 00:13:02 -05:00
John Chilton 40f19d2a0f Allow c to appear in default value for Column parameters, allow specification with value attribute.
Ideas purposed by Peter Cock here - http://dev.list.galaxyproject.org/Default-value-for-data-column-not-working-tp4139574p4664492.html.
2014-05-12 12:01:14 -05:00
John Chilton dc5563371a Unit test case for tool column parameters.
Ever more duplication in these parameters tests, I need to find some time to refactor...
2014-05-12 12:01:14 -05:00
John Chilton 704446ea24 Dataset collections - tools API returns implicitly created collections.
Use improvements to write better functional tests, ensure element identifiers preserved.
2014-05-06 08:54:31 -05:00
John Chilton cf206e1692 Dataset collections - implicit "map" creates collections.
When running normal tools with normal data inputs across dataset collections in parallel - a collection will be created for each output with a "structure" matching that of the input (for instance pairs will create pairs, lists will create lists with the same identifiers, etc...). A previous changeset added the ability to run the tool in parallel - this changeset extends that functionality to create analogous collections from these parallel runs.

For example, if one filters a pair of FASTQ files a pair is created out of the result. Likewise, if one filters a list of FASTQ files - a list collection with same cardinality is built from the results.

There is a lot left TODO here - for one a lot of this logic should be moved into the dataset_collection module. The matching needs to be exact right now - not a problem for pairs (every 'element' has name 'left' or 'right') but for lists with element names - these have to match exactly - but a 'list' like samp1_l, samp2_l, samp3_l should be able to match against samp1_r, samp2_r, samp3_r and create a new list samp1, samp2, and samp3. Even if there is no matching prefixes a new 'unlabeled' list should be able to be created.
2014-05-06 08:54:30 -05:00
John Chilton 8168334297 Dataset collections - "map" with existing tools (backend).
Allow replacing data parameter inputs with collections - this will cause the tool to produce multiple jobs for the submission - one for each combination of input parameters after being matched up (linked). In addition to various unit tests, functional tests demonstrate the API usage in `test/functional/api/test_tools.py`.
2014-05-06 08:54:30 -05:00