Skip to content

Instantly share code, notes, and snippets.

View samuell's full-sized avatar
💻
Hacking away

Samuel Lampa samuell

💻
Hacking away
View GitHub Profile
import luigi
import time
class SleepA(luigi.Task):
taskid = luigi.Parameter()
def output(self):
return luigi.LocalTarget("sleepa_{taskid}_output.txt".format(taskid=self.taskid))
def run(self):
prefix prop: <http://dbpedia.org/property/>
select distinct ?species str(?abbrevStr) as ?abbrev str(?nameStr) as ?name where {
?species prop:species ?abbrevStr ;
prop:name ?nameStr .
} LIMIT 10
{
"tool": {
"accepts_input": true,
"backend": "nullbackend",
"cpus": "",
"description": "",
"display_name": "MzXML2Search",
"enabled": true,
"fs_backend": "nullbackend",
"inputExtensions": [
import luigi
import os
#from WorkflowUtils import WorkflowUtils
import logging as log
class ATask(luigi.Task):
# Task parameters
dataset_name = luigi.Parameter()
upstream_task = luigi.Parameter()
# Some needed luigi imports
import luigi
import luigi.scheduler
import luigi.worker
# Here we are importing our own tasks, provided they are
# arranged in a python module (folder) named "components"
from components.SomeTaskA import SomeTaskA
from components.SomeTaskB import SomeTaskB
from components.SomeTaskC import SomeTaskC
'''Luigi Workflow
Usage:
run_luigi_workflow.py (--host=|--local-scheduler) --workers=<workers> run <taskname> -p <partitioning_parameter>
run_luigi_workflow.py (-h|--help)
run_luigi_workflow.py --version
Options:
-h, --help Show this screen
--version Show version
import luigi
from SomePossibleUpstreamTask import SomePossibleUpstreamTask
from SomeOtherPossibleUpstreamTask import SomeOtherPossibleUpstreamTask
class ExampleTask(luigi.Task):
upstream_task = luigi.Parameter()
def requires(self):
# This will return the upstream task object
return self.upstream_task
python run_luigi_workflow.py --workers run some_task_c --partitioning-parameter Foo
import luigi
import luigi.scheduler
import luigi.worker
import logging as log
import socket
from datetime import datetime as dt
from ConfigParser import ConfigParser
from components import AssessSVMRegression
from components import CreateProteinList
from components import CreateReport
@samuell
samuell / myconfig.cfg
Last active August 29, 2015 14:01
Query Semantic MediaWiki via MediaWiki REST API
[wiki]
user = MyWikiBotUser
pass = ********