RAPPEL : Opération de maintenance > ForgeMIA indisponible le 20 Janvier entre 7h et 12h

Commit 443f8ac6 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

update documentation

parent 9ebe831e
......@@ -52,6 +52,7 @@
<li><a href="./jflow_plugin.html">Plugin insertion</a></li>
<li><a href="./jflow_type.html">Add a data type</a></li>
<li><a href="./jflow_format.html">Add a file format</a></li>
<li><a href="./jflow_rule.html">Add a rule</a></li>
<li><a href="./jflow_advanced_configuration.html">Advanced configuration</a></li>
</ul>
</li>
......
......@@ -49,6 +49,7 @@
<li><a href="./jflow_plugin.html">Plugin insertion</a></li>
<li><a href="./jflow_type.html">Add a data type</a></li>
<li><a href="./jflow_format.html">Add a file format</a></li>
<li><a href="./jflow_rule.html">Add a rule</a></li>
<li><a href="./jflow_advanced_configuration.html">Advanced configuration</a></li>
</ul>
</li>
......
......@@ -50,6 +50,7 @@
<li><a href="./jflow_core_component.html">Add a component</a></li>
<li><a href="./jflow_plugin.html">Plugin insertion</a></li>
<li><a href="./jflow_type.html">Add a data type</a></li>
<li><a href="./jflow_rule.html">Add a rule</a></li>
<li><a href="./jflow_format.html">Add a file format</a></li>
<li class="active"><a href="./jflow_advanced_configuration.html">Advanced configuration</a></li>
</ul>
......
......@@ -51,6 +51,7 @@
<li><a href="./jflow_plugin.html">Plugin insertion</a></li>
<li><a href="./jflow_type.html">Add a data type</a></li>
<li><a href="./jflow_format.html">Add a file format</a></li>
<li><a href="./jflow_rule.html">Add a rule</a></li>
<li><a href="./jflow_advanced_configuration.html">Advanced configuration</a></li>
</ul>
</li>
......
......@@ -51,6 +51,7 @@
<li><a href="./jflow_plugin.html">Plugin insertion</a></li>
<li><a href="./jflow_type.html">Add a data type</a></li>
<li><a href="./jflow_format.html">Add a file format</a></li>
<li><a href="./jflow_rule.html">Add a rule</a></li>
<li><a href="./jflow_advanced_configuration.html">Advanced configuration</a></li>
</ul>
</li>
......@@ -88,14 +89,6 @@
<li><a href="#get_resource">Get resource</a></li>
</ul>
</li>
<li><a href="#your-rules">Custom rules</a>
<ul class="nav nav-stacked">
<li><a href="#simple-rules">Simple rules</a></li>
<li><a href="#link-rules">Link rules</a></li>
<li><a href="#conditional-rules">Conditional rules</a></li>
<li><a href="#raise-error-warning">Raise an error or a warning in a rule</a></li>
</ul>
</li>
</ul>
</nav>
......@@ -310,10 +303,10 @@ class MyWorkflow (Workflow):
<td>Define custom rules on the parameter. Rules are separated by a ";"<br/>
Available rules:<br/>
<ul>
<li><strong>Exclude:</strong> exclude parameters. If one is given, the other must be not given.<br/>
<em>Syntax: Exclude=param1,param2,...</em></li>
<li><strong>ToBeRequired:</strong> require other parameters if parameter is given.<br/>
<em>Syntax: ToBeRequired=param1,param2,...</em></li>
<li><strong>Exclude:</strong> if the parameter is provided by the user, the specified parameters
are disabled (<code>Exclude=param1,param2,...</code>).<br/>
<li><strong>ToBeRequired:</strong> the specified parameters are required if the current one is
provided by the user (<code>ToBeRequired=param1,param2,...</code>).<br/>
<li><strong>RequiredIf:</strong> parameter is required only if other parameters have (or have not) some values.<br/>
<em>Syntax: RequiredIf?(ANY|ALL)[param_1=value1,param_2!=value2,...] (all conditions or any condition)</em><br/>
Special values: * for any value of the parameter (not empty), None for not given (or empty)<br/>
......@@ -505,7 +498,7 @@ class MyWorkflow (Workflow):
the final user will be allowed to provide multiple files and the object attribut <code>self.parameter_name</code> will be
settled as a Python list.</p>
<p>The <code>rules</code> argument has a rule available only on input files list: Unique. If this rule is given, a same file must be unique on the list.</p>
<p>The only rule available for this function is <code>Unique<code>: a file must be provided only once.</p>
<h3>add_input_directory()</h3>
<p>
......
......@@ -51,6 +51,7 @@
<li><a href="./jflow_plugin.html">Plugin insertion</a></li>
<li><a href="./jflow_type.html">Add a data type</a></li>
<li class="active"><a href="./jflow_format.html">Add a file format</a></li>
<li><a href="./jflow_rule.html">Add a rule</a></li>
<li><a href="./jflow_advanced_configuration.html">Advanced configuration</a></li>
</ul>
</li>
......
......@@ -51,6 +51,7 @@
<li><a href="./jflow_plugin.html">Plugin insertion</a></li>
<li><a href="./jflow_type.html">Add a data type</a></li>
<li><a href="./jflow_format.html">Add a file format</a></li>
<li><a href="./jflow_rule.html">Add a rule</a></li>
<li><a href="./jflow_advanced_configuration.html">Advanced configuration</a></li>
</ul>
</li>
......
......@@ -51,6 +51,7 @@
<li class="active"><a href="./jflow_plugin.html">Plugin insertion</a></li>
<li><a href="./jflow_type.html">Add a data type</a></li>
<li><a href="./jflow_format.html">Add a file format</a></li>
<li><a href="./jflow_rule.html">Add a rule</a></li>
<li><a href="./jflow_advanced_configuration.html">Advanced configuration</a></li>
</ul>
</li>
......
......@@ -51,6 +51,7 @@
<li><a href="./jflow_plugin.html">Plugin insertion</a></li>
<li><a href="./jflow_type.html">Add a data type</a></li>
<li><a href="./jflow_format.html">Add a file format</a></li>
<li><a href="./jflow_rule.html">Add a rule</a></li>
<li><a href="./jflow_advanced_configuration.html">Advanced configuration</a></li>
</ul>
</li>
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Jflow Types</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Bootstrap theme -->
<link href="css/bootstrap-theme.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/theme.css" rel="stylesheet">
<!-- Highlight code -->
<link href="css/tomorrow-night-eighties.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body role="document">
<!-- Fixed navbar -->
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="./index.html">Jflow</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="./index.html">About</a></li>
<li><a href="./jflow_install.html">Install</a></li>
<li><a href="./jflow_quickstart.html">Quick start</a></li>
<li class="dropdown active">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="./jflow_core_workflow.html">Add a workflow</a></li>
<li><a href="./jflow_core_component.html">Add a component</a></li>
<li><a href="./jflow_plugin.html">Plugin insertion</a></li>
<li><a href="./jflow_type.html">Add a data type</a></li>
<li><a href="./jflow_format.html">Add a file format</a></li>
<li class="active"><a href="./jflow_rule.html">Add a rule</a></li>
<li><a href="./jflow_advanced_configuration.html">Advanced configuration</a></li>
</ul>
</li>
<li><a href="./example1.html">Example</a></li>
<li><a href="mailto:support.genopole@toulouse.inra.fr">Contact</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="container">
<div class="row">
<!--Nav Bar -->
<nav class="col-xs-3 bs-docs-sidebar">
<ul id="sidebar" class="nav nav-stacked fixed">
<li><a href="#where" class="active">Where to add a new rule</a></li>
<li><a href="#how" >How to add a new rule</a>
<ul class="nav nav-stacked">
<li><a href="#simple-rules">Simple rules</a></li>
<li><a href="#link-rules">Link rules</a></li>
<li><a href="#conditional-rules">Conditional rules</a></li>
<li><a href="#raise-error-warning">Raise an error or a warning</a></li>
</ul>
</li>
<li><a href="#howuse" >How to use a new rule</a></li>
</ul>
</nav>
<div class="col-xs-12 col-sm-9">
<section id="where" class="group">
<h1>Where to add a new rule</h1>
<p>In the <code>workflows/</code> directory, jflow provides a <code>types.py</code> file where new types can be added.</p>
<pre class="pre-hl"><code class="ini">jflow/
├── bin/
├── docs/
├── src/
├── workflows/
│ ├── components/
│ ├── extparsers/
│ ├── __init__.py
│ ├── formats.py
│ └── types.py [ file where to add new jflow types ]
├── applications.properties
└── README</code></pre>
</section>
<section id="how" class="group">
<h1>How to add a new type</h1>
<p>In jflow a type is represented by a function named by the desired type name. The function should take only
one argument, whose value is given by the user. The function is in charge to check and/or modify
the given value. If an error occurred or if the value does not meet the expected criteria, an
<code>argparse.ArgumentTypeError</code> should be raised with the suitable error message. This message will
be used by jflow to inform the final user of the error.</p>
<p>In the following example, the <code>intBetween1and100</code> function checks if the input value is in between
1 and 100:</p>
<pre class="pre-hl "><code class="python">def intBetween1and100(myint):
# the input argument type is allways a string
try:
myint = int(myint)
except:
raise argparse.ArgumentTypeError("'"+str(myint)+"' is not a valid int!")
if myint <= 100 and myint >= 1:
return myint
else:
raise argparse.ArgumentTypeError("'"+str(myint)+"' is not between 1 and 100!")</code></pre>
</section>
<section id="howuse" class="group">
<h1>How to use a new type</h1>
<p>The new created type can then be used in both <code>add_parameter</code> and <code>add_parameter_list</code> of the
class <code>jflow.workflow.Workflow</code> and <code>jflow.component.Component</code> as following:</p>
<pre class="pre-hl "><code class="python">[...]
def define_parameters(self, function="process"):
self.add_parameter("my_param", "A value in between 1 and 100", type="intBetween1and100")
[...]</code></pre>
</section>
</div>
</div>
<hr>
<footer>
<div class="container" style="text-align: center;">
<p>Copyright © 2015, INRA | Designed by <a target="_blank" href="http://bioinfo.genotoul.fr/">GenoToul Bioinfo platform</a> and <a target="_blank" href="http://www.sigenae.org/">Sigenae platform</a>.</p>
</div>
</footer>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<!-- <script src="../../assets/js/docs.min.js"></script> -->
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<!-- <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script> -->
<!-- Highlight code -->
<script src="js/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script type='text/javascript'>
$('body').scrollspy({
target: '.bs-docs-sidebar',
offset: 150
});
</script>
</body>
</html>
\ No newline at end of file
......@@ -51,6 +51,7 @@
<li><a href="./jflow_plugin.html">Plugin insertion</a></li>
<li class="active"><a href="./jflow_type.html">Add a data type</a></li>
<li><a href="./jflow_format.html">Add a file format</a></li>
<li><a href="./jflow_rule.html">Add a rule</a></li>
<li><a href="./jflow_advanced_configuration.html">Advanced configuration</a></li>
</ul>
</li>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment