Skip to content

Commit

Permalink
Work around issue #559 in training material.
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardomurri committed Jul 11, 2016
1 parent c4231a9 commit cccbcf4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
34 changes: 21 additions & 13 deletions docs/programmers/tutorials/workflows/grayscale_app.py
@@ -1,16 +1,24 @@
import os
from os.path import basename

from gc3libs import Application
from gc3libs.quantity import GB


class GrayscaleApp(Application):
"""Convert an image file to grayscale."""
def __init__(self, img):
inp = basename(img)
out = "gray-" + inp
Application.__init__(
self,
arguments=[
"convert", inp, "-colorspace", "gray", out],
inputs=[img],
outputs=[out],
output_dir="grayscale.d",
stdout="stdout.txt",
stderr="stderr.txt")
"""Convert an image file to grayscale."""
def __init__(self, img):
inp = basename(img)
out = "gray-" + inp
Application.__init__(
self,
arguments=[
"convert", inp, "-colorspace", "gray", out],
inputs=[img],
outputs=[out],
output_dir="grayscale.d",
stdout="stdout.txt",
stderr="stderr.txt",
# this is needed to circumvent GC3Pie issue #559, see
# <https://github.com/uzh/gc3pie/issues/559>
requested_memory=1*GB)
6 changes: 5 additions & 1 deletion docs/programmers/tutorials/workflows/solutions/ex2c.py
Expand Up @@ -6,6 +6,7 @@

from gc3libs import Application
from gc3libs.cmdline import SessionBasedScript
from gc3libs.quantity import GB


if __name__ == '__main__':
Expand Down Expand Up @@ -42,4 +43,7 @@ def __init__(self, img):
outputs=[out],
output_dir="grayscale.d",
stdout="stdout.txt",
stderr="stderr.txt")
stderr="stderr.txt",
# this is needed to circumvent GC3Pie issue #559, see
# <https://github.com/uzh/gc3pie/issues/559>
requested_memory=1*GB)

0 comments on commit cccbcf4

Please sign in to comment.