Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
bernt-matthias committed Jun 14, 2023
1 parent 4423d10 commit 98d67e1
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 14 deletions.
43 changes: 35 additions & 8 deletions examples/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@

# A float in a section
section = gxtp.Section("float_section", "Float section")
param = gxtp.FloatParam("float", value=0, label="Float label", help="Float help", num_dashes=1)
param = gxtp.FloatParam(
"float", value=0, label="Float label", help="Float help", num_dashes=1
)
param.space_between_arg = " "
section.append(param)
param = gxtp.FloatParam(None, argument="--float-fromarg", value=0, label="Float label", help="Float help")
param = gxtp.FloatParam(
None, argument="--float-fromarg", value=0, label="Float label", help="Float help"
)
section.append(param)
inputs.append(section)

Expand All @@ -41,16 +45,29 @@
param.append(gxtp.SelectParam("Select", options={"hi": "1", "bye": "2"}))
when_a = gxtp.When(value="hi")
when_b = gxtp.When(value="bye")
when_b.append(gxtp.IntegerParam("some_int", value=0, num_dashes=1, label="Advanced value"))
when_b.append(
gxtp.IntegerParam("some_int", value=0, num_dashes=1, label="Advanced value")
)
param.append(when_a)
param.append(when_b)
inputs.append(param)

# Integer parameters
param_min = gxtp.IntegerParam("int_min", label="int_min label", help="int_min help", value=0, num_dashes=1)
param_max = gxtp.IntegerParam("int_max", label="int_max label", help="int_max help", value=0, num_dashes=1)
param_min = gxtp.IntegerParam(
"int_min", label="int_min label", help="int_min help", value=0, num_dashes=1
)
param_max = gxtp.IntegerParam(
"int_max", label="int_max label", help="int_max help", value=0, num_dashes=1
)

posint = gxtp.IntegerParam("posint", label="posint label", positional=True, help="posinthelp", value=0, num_dashes=2)
posint = gxtp.IntegerParam(
"posint",
label="posint label",
positional=True,
help="posinthelp",
value=0,
num_dashes=2,
)

param_min.command_line_override = "-i$int_min,$int_max"
param_max.command_line_override = ""
Expand All @@ -76,7 +93,15 @@
inputs.append(param)

param = gxtp.Repeat("repeat", "repeat title")
data = gxtp.DataParam("data", argument="--data", optional=True, format="fasta", multiple=True, label="data label", help="data help")
data = gxtp.DataParam(
"data",
argument="--data",
optional=True,
format="fasta",
multiple=True,
label="data label",
help="data help",
)
param.append(data)
inputs.append(param)

Expand All @@ -91,7 +116,9 @@
outputs.append(param)
# Collection
collection = gxtp.OutputCollection("supercollection", label="a small label")
discover = gxtp.DiscoverDatasets(r"(?P<designation>.+)\.pdf.fasta", format="fasta")
discover = gxtp.DiscoverDatasets(
r"(?P<designation>.+)\.pdf.fasta", format="fasta"
)
collection.append(discover)
outputs.append(collection)

Expand Down
29 changes: 23 additions & 6 deletions examples/example_macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@

# A float in a section
section = gxtp.Section("float_section", "Float section")
param = gxtp.FloatParam("float", label="Float label", help="Float help", value=0, num_dashes=1)
param = gxtp.FloatParam(
"float", label="Float label", help="Float help", value=0, num_dashes=1
)
param.space_between_arg = " "
section.append(param)
inputs.append(section)
Expand All @@ -41,16 +43,29 @@
param.append(gxtp.SelectParam("Select", options={"hi": "1", "bye": "2"}))
when_a = gxtp.When(value="hi")
when_b = gxtp.When(value="bye")
when_b.append(gxtp.IntegerParam("some_int", value=0, num_dashes=1, label="Advanced value"))
when_b.append(
gxtp.IntegerParam("some_int", value=0, num_dashes=1, label="Advanced value")
)
param.append(when_a)
param.append(when_b)
inputs.append(param)

# Integer parameters
param_min = gxtp.IntegerParam("int_min", label="int_min label", help="int_min help", value=0, num_dashes=1)
param_max = gxtp.IntegerParam("int_max", label="int_max label", help="int_max help", value=0, num_dashes=1)
param_min = gxtp.IntegerParam(
"int_min", label="int_min label", help="int_min help", value=0, num_dashes=1
)
param_max = gxtp.IntegerParam(
"int_max", label="int_max label", help="int_max help", value=0, num_dashes=1
)

posint = gxtp.IntegerParam("posint", label="posint label", positional=True, help="posinthelp", value=0, num_dashes=2)
posint = gxtp.IntegerParam(
"posint",
label="posint label",
positional=True,
help="posinthelp",
value=0,
num_dashes=2,
)

param_min.command_line_override = "-i$int_min,$int_max"
param_max.command_line_override = ""
Expand Down Expand Up @@ -83,7 +98,9 @@
outputs.append(param)
# Collection
collection = gxtp.OutputCollection("supercollection", label="a small label")
discover = gxtp.DiscoverDatasets(r"(?P<designation>.+)\.pdf.fasta", format="fasta")
discover = gxtp.DiscoverDatasets(
r"(?P<designation>.+)\.pdf.fasta", format="fasta"
)
collection.append(discover)
outputs.append(collection)

Expand Down

0 comments on commit 98d67e1

Please sign in to comment.