{"action":"opened","issue":{"url":"https://api.github.com/repos/pharmbio/sciluigi/issues/28","repository_url":"https://api.github.com/repos/pharmbio/sciluigi","labels_url":"https://api.github.com/repos/pharmbio/sciluigi/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/pharmbio/sciluigi/issues/28/comments","events_url":"https://api.github.com/repos/pharmbio/sciluigi/issues/28/events","html_url":"https://github.com/pharmbio/sciluigi/issues/28","id":185955554,"number":28,"title":"Expand to work with other parameter types.","user":{"login":"cpaulik","id":380927,"avatar_url":"https://avatars.githubusercontent.com/u/380927?v=3","gravatar_id":"","url":"https://api.github.com/users/cpaulik","html_url":"https://github.com/cpaulik","followers_url":"https://api.github.com/users/cpaulik/followers","following_url":"https://api.github.com/users/cpaulik/following{/other_user}","gists_url":"https://api.github.com/users/cpaulik/gists{/gist_id}","starred_url":"https://api.github.com/users/cpaulik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpaulik/subscriptions","organizations_url":"https://api.github.com/users/cpaulik/orgs","repos_url":"https://api.github.com/users/cpaulik/repos","events_url":"https://api.github.com/users/cpaulik/events{/privacy}","received_events_url":"https://api.github.com/users/cpaulik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-28T15:42:11Z","updated_at":"2016-10-28T15:42:11Z","closed_at":null,"body":"It would be great if SciLuigi could work with parameters other than strings.\r\n\r\nI tried to use DictParameters and IntParameters in the MetaWF example and both failed.\r\n\r\nAm I doing something wrong or is this just not supported?\r\n\r\ne.g. for `IntParameter`\r\n```python\r\n'''\r\nAn example showing how you can run multiple workflow tasks, from a \"Meta workflow\" (MetaWF below)\r\n'''\r\n\r\nimport sciluigi as sl\r\nimport luigi\r\n\r\nclass MetaWF(sl.WorkflowTask):\r\n    '''\r\n    Meta workflow\r\n    '''\r\n    def workflow(self):\r\n        tasks = []\r\n        for r in [3, 2, 1]:\r\n            wf = self.new_task('wf', WF, replacement=r)\r\n            tasks.append(wf)\r\n        return tasks\r\n\r\nclass WF(sl.WorkflowTask):\r\n    '''\r\n    Main workflow, which is run in multiple instances above\r\n    '''\r\n    replacement = luigi.IntParameter()\r\n    def workflow(self):\r\n        t1 = self.new_task('foowriter', FooWriter)\r\n        t2 = self.new_task('foo2bar', Foo2Bar, replacement=self.replacement)\r\n        t2.in_foo = t1.out_foo\r\n        return t2\r\n\r\nclass FooWriter(sl.Task):\r\n    '''\r\n    A dummy task\r\n    '''\r\n    def out_foo(self):\r\n        return sl.TargetInfo(self, 'foo.txt')\r\n    def run(self):\r\n        self.ex('echo foo > {foo}'.format(\r\n            foo=self.out_foo().path))\r\n\r\nclass Foo2Bar(sl.Task):\r\n    '''\r\n    Another dummy task\r\n    '''\r\n    replacement = luigi.IntParameter()\r\n    in_foo = sl.TargetInfo(None, 'None')\r\n    def out_bar(self):\r\n        return sl.TargetInfo(self, self.in_foo().path + '.{r}.txt'.format(r=str(self.replacement)))\r\n    def run(self):\r\n        self.ex('sed \"s/foo/{r}/g\" {inf} > {outf}'.format(\r\n            r=type(self.replacement),\r\n            inf=self.in_foo().path,\r\n            outf=self.out_bar().path)\r\n        )\r\n\r\n# Run as script\r\nif __name__ == '__main__':\r\n    sl.run_local(main_task_cls=MetaWF)\r\n```"}}
{"actor":{"display_login":"cpaulik"}}