Skip to content

Instantly share code, notes, and snippets.

@kmader
Created October 20, 2017 10:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmader/40a9df71e58d62d58d04e0cc5bc59da2 to your computer and use it in GitHub Desktop.
Save kmader/40a9df71e58d62d58d04e0cc5bc59da2 to your computer and use it in GitHub Desktop.
A simple Dash and Luigi Job Submission Tool
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"source": [
"import matplotlib\n",
"matplotlib.use('Agg')\n",
"import os\n",
"import sys\n",
"\n",
"from subprocess import check_output, STDOUT\n",
"from sys import executable as exe_path\n",
"exe_base_path = os.path.split(exe_path)[0]\n",
"if os.name=='nt':\n",
" luigi_path = os.path.join(exe_base_path,'Scripts', 'luigi.exe')\n",
"else:\n",
" luigi_path = os.path.join(exe_base_path, 'luigi')"
],
"outputs": [],
"execution_count": 1,
"metadata": {}
},
{
"cell_type": "markdown",
"source": [
"# Overview\n",
"Here we make the module file for the Luigi tasks which can then be run from the command line, make sure ```luigid``` is running before trying to execute any tasks (the logic from the workflow should still work though)"
],
"metadata": {
"collapsed": false,
"outputHidden": false,
"inputHidden": false
}
},
{
"cell_type": "code",
"source": [
"%%writefile analysis_pipeline.py\n",
"import luigi\n",
"import os\n",
"from time import sleep\n",
"out_dir = 'analysis_output'\n",
"\n",
"class DownloadData(luigi.Task):\n",
" series_id = luigi.Parameter()\n",
" def run(self):\n",
" sleep(10)\n",
" with self.output().open('w') as o_file:\n",
" o_file.write('a dicom image')\n",
" def output(self): \n",
" return luigi.LocalTarget(os.path.join(out_dir, '{}.dcm'.format(self.series_id)))\n",
"\n",
"class PackageNPZ(luigi.Task):\n",
" accession_number = luigi.Parameter()\n",
" def requires(self):\n",
" for i in range(5):\n",
" yield DownloadData(series_id = '%s_%04d' % (self.accession_number, i))\n",
" \n",
" def run(self):\n",
" sleep(20)\n",
" with self.output().open('w') as o_file:\n",
" o_file.write('a fancy npz')\n",
" \n",
" def output(self): \n",
" return luigi.LocalTarget(os.path.join(out_dir, '{}.npz'.format(self.accession_number)))\n",
" \n",
"class SegmentLungs(luigi.Task):\n",
" accession_number = luigi.Parameter()\n",
" def requires(self):\n",
" yield PackageNPZ(accession_number = self.accession_number)\n",
" \n",
" def run(self):\n",
" sleep(30)\n",
" with self.output().open('w') as o_file:\n",
" o_file.write('a lung segmented npz')\n",
" \n",
" def output(self): \n",
" return luigi.LocalTarget(os.path.join(out_dir, '{}_lung.npz'.format(self.accession_number)))\n",
"\n",
"class DetectLesions(luigi.Task):\n",
" accession_number = luigi.Parameter()\n",
" def requires(self):\n",
" yield SegmentLungs(accession_number = self.accession_number)\n",
" \n",
" def run(self):\n",
" sleep(30)\n",
" with self.output().open('w') as o_file:\n",
" o_file.write('all the lesions')\n",
" \n",
" def output(self): \n",
" return luigi.LocalTarget(os.path.join(out_dir, '{}_lesions.pkl'.format(self.accession_number)))\n",
"\n",
"class Fancy3DRendering(luigi.Task):\n",
" accession_number = luigi.Parameter()\n",
" def requires(self):\n",
" yield SegmentLungs(accession_number = self.accession_number)\n",
" \n",
" def run(self):\n",
" sleep(60)\n",
" with self.output().open('w') as o_file:\n",
" o_file.write('nice rendering')\n",
" \n",
" def output(self): \n",
" return luigi.LocalTarget(os.path.join(out_dir, '{}_lungs.mov'.format(self.accession_number)))\n",
"\n",
" \n",
"class ClassifyPatient(luigi.Task):\n",
" accession_number = luigi.Parameter()\n",
" def requires(self):\n",
" yield SegmentLungs(accession_number = self.accession_number)\n",
" yield DetectLesions(accession_number = self.accession_number)\n",
" \n",
" def run(self):\n",
" sleep(30)\n",
" with self.output().open('w') as o_file:\n",
" o_file.write('all the lesions')\n",
" \n",
" def output(self): \n",
" return luigi.LocalTarget(os.path.join(out_dir, '{}_stages.csv'.format(self.accession_number)))\n",
" \n",
"class StartLungStage(luigi.Task):\n",
" patient_name = luigi.Parameter()\n",
" def requires(self):\n",
" os.makedirs(out_dir, exist_ok=True)\n",
" accession_number = int(self.patient_name.encode('ascii').hex(), 16)\n",
" yield Fancy3DRendering(accession_number = accession_number)\n",
" yield ClassifyPatient(accession_number = accession_number)\n",
" \n",
" def run(self):\n",
" sleep(20)\n",
" with self.output().open('w') as o_file:\n",
" o_file.write('a final report')\n",
" def output(self): \n",
" return luigi.LocalTarget(os.path.join(out_dir, '{}_result.html'.format(self.patient_name)))"
],
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Overwriting analysis_pipeline.py\n"
]
}
],
"execution_count": 2,
"metadata": {}
},
{
"cell_type": "code",
"source": [
"luigi_cmd = lambda patient_name: \"\"\"{luigi_path} StartLungStage --patient-name {patient_name} --module analysis_pipeline --workers 2\"\"\".format(patient_name = patient_name, luigi_path = luigi_path)\n",
"run_luigi_pipe = lambda patient_name: check_output(luigi_cmd(patient_name), \n",
" env = dict(PYTHONPATH = '.'), \n",
" stderr = STDOUT, \n",
" shell = True).decode()\n",
"if os.name=='nt':\n",
" print(\"\"\"cmd /V /C \"set PYTHONPATH=. && {luigi_str}\" \"\"\".format(luigi_str = luigi_cmd('Test')))\n",
"else:\n",
" print(\"\"\"PYTHONPATH=. {luigi_str}\"\"\".format(luigi_str = luigi_cmd('Test')))\n"
],
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"PYTHONPATH=. /Users/mader/anaconda/bin/luigi StartLungStage --patient-name Test --module analysis_pipeline --workers 2\n"
]
}
],
"execution_count": 3,
"metadata": {}
},
{
"cell_type": "code",
"source": [
"print(run_luigi_pipe('Bob'))"
],
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"DEBUG: Checking if StartLungStage(patient_name=Bob) is complete\n",
"/Users/mader/anaconda/lib/python3.5/site-packages/luigi/parameter.py:261: UserWarning: Parameter \"accession_number\" with value \"4353890\" is not of type string.\n",
" warnings.warn('Parameter \"{}\" with value \"{}\" is not of type string.'.format(param_name, param_value))\n",
"DEBUG: Checking if Fancy3DRendering(accession_number=4353890) is complete\n",
"DEBUG: Checking if ClassifyPatient(accession_number=4353890) is complete\n",
"INFO: Informed scheduler that task StartLungStage_Bob_5a82ae4636 has status PENDING\n",
"DEBUG: Checking if SegmentLungs(accession_number=4353890) is complete\n",
"DEBUG: Checking if DetectLesions(accession_number=4353890) is complete\n",
"INFO: Informed scheduler that task ClassifyPatient_4353890_eefce40d10 has status PENDING\n",
"INFO: Informed scheduler that task DetectLesions_4353890_eefce40d10 has status PENDING\n",
"DEBUG: Checking if PackageNPZ(accession_number=4353890) is complete\n",
"INFO: Informed scheduler that task SegmentLungs_4353890_eefce40d10 has status PENDING\n",
"DEBUG: Checking if DownloadData(series_id=4353890_0000) is complete\n",
"DEBUG: Checking if DownloadData(series_id=4353890_0001) is complete\n",
"DEBUG: Checking if DownloadData(series_id=4353890_0002) is complete\n",
"DEBUG: Checking if DownloadData(series_id=4353890_0003) is complete\n",
"DEBUG: Checking if DownloadData(series_id=4353890_0004) is complete\n",
"INFO: Informed scheduler that task PackageNPZ_4353890_eefce40d10 has status PENDING\n",
"INFO: Informed scheduler that task DownloadData_4353890_0004_9f29c6bd1f has status PENDING\n",
"INFO: Informed scheduler that task DownloadData_4353890_0003_e8e2d76292 has status PENDING\n",
"INFO: Informed scheduler that task DownloadData_4353890_0002_d167476a84 has status PENDING\n",
"INFO: Informed scheduler that task DownloadData_4353890_0001_06ba0d5077 has status PENDING\n",
"INFO: Informed scheduler that task DownloadData_4353890_0000_ea9a6e5015 has status PENDING\n",
"INFO: Informed scheduler that task Fancy3DRendering_4353890_eefce40d10 has status PENDING\n",
"INFO: Done scheduling tasks\n",
"INFO: Running Worker with 2 processes\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Pending tasks: 11\n",
"DEBUG: Asking scheduler for work...\n",
"INFO: [pid 48224] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) running DownloadData(series_id=4353890_0002)\n",
"DEBUG: Pending tasks: 10\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"INFO: [pid 48225] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) running DownloadData(series_id=4353890_0004)\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"INFO: [pid 48224] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) done DownloadData(series_id=4353890_0002)\n",
"INFO: [pid 48225] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) done DownloadData(series_id=4353890_0004)\n",
"INFO: Informed scheduler that task DownloadData_4353890_0002_d167476a84 has status DONE\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Pending tasks: 9\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"INFO: [pid 48240] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) running DownloadData(series_id=4353890_0001)\n",
"INFO: Informed scheduler that task DownloadData_4353890_0004_9f29c6bd1f has status DONE\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Pending tasks: 8\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"INFO: [pid 48241] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) running DownloadData(series_id=4353890_0003)\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"INFO: [pid 48240] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) done DownloadData(series_id=4353890_0001)\n",
"INFO: Informed scheduler that task DownloadData_4353890_0001_06ba0d5077 has status DONE\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Pending tasks: 7\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"INFO: [pid 48255] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) running DownloadData(series_id=4353890_0000)\n",
"INFO: [pid 48241] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) done DownloadData(series_id=4353890_0003)\n",
"INFO: Informed scheduler that task DownloadData_4353890_0003_e8e2d76292 has status DONE\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: DownloadData_4353890_0000_ea9a6e5015 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: DownloadData_4353890_0000_ea9a6e5015 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: DownloadData_4353890_0000_ea9a6e5015 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: DownloadData_4353890_0000_ea9a6e5015 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: DownloadData_4353890_0000_ea9a6e5015 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: DownloadData_4353890_0000_ea9a6e5015 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: DownloadData_4353890_0000_ea9a6e5015 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: DownloadData_4353890_0000_ea9a6e5015 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: DownloadData_4353890_0000_ea9a6e5015 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: DownloadData_4353890_0000_ea9a6e5015 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"INFO: [pid 48255] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) done DownloadData(series_id=4353890_0000)\n",
"INFO: Informed scheduler that task DownloadData_4353890_0000_ea9a6e5015 has status DONE\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Pending tasks: 6\n",
"DEBUG: Asking scheduler for work...\n",
"INFO: [pid 48272] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) running PackageNPZ(accession_number=4353890)\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: PackageNPZ_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: PackageNPZ_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: PackageNPZ_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: PackageNPZ_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: PackageNPZ_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: PackageNPZ_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: PackageNPZ_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: PackageNPZ_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: PackageNPZ_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: PackageNPZ_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: PackageNPZ_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: PackageNPZ_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: PackageNPZ_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: PackageNPZ_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: PackageNPZ_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: PackageNPZ_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: PackageNPZ_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: PackageNPZ_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: PackageNPZ_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: PackageNPZ_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"INFO: [pid 48272] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) done PackageNPZ(accession_number=4353890)\n",
"INFO: Informed scheduler that task PackageNPZ_4353890_eefce40d10 has status DONE\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Pending tasks: 5\n",
"DEBUG: Asking scheduler for work...\n",
"INFO: [pid 48287] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) running SegmentLungs(accession_number=4353890)\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: SegmentLungs_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"INFO: [pid 48287] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) done SegmentLungs(accession_number=4353890)\n",
"INFO: Informed scheduler that task SegmentLungs_4353890_eefce40d10 has status DONE\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Pending tasks: 4\n",
"DEBUG: Asking scheduler for work...\n",
"INFO: [pid 48303] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) running Fancy3DRendering(accession_number=4353890)\n",
"DEBUG: Pending tasks: 3\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"INFO: [pid 48304] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) running DetectLesions(accession_number=4353890)\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"INFO: [pid 48304] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) done DetectLesions(accession_number=4353890)\n",
"INFO: Informed scheduler that task DetectLesions_4353890_eefce40d10 has status DONE\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Pending tasks: 2\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"INFO: [pid 48319] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) running ClassifyPatient(accession_number=4353890)\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"DEBUG: 2 running tasks, waiting for next task to finish\n",
"INFO: [pid 48303] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) done Fancy3DRendering(accession_number=4353890)\n",
"INFO: Informed scheduler that task Fancy3DRendering_4353890_eefce40d10 has status DONE\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: ClassifyPatient_4353890_eefce40d10 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"INFO: [pid 48319] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) done ClassifyPatient(accession_number=4353890)\n",
"INFO: Informed scheduler that task ClassifyPatient_4353890_eefce40d10 has status DONE\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Pending tasks: 1\n",
"DEBUG: Asking scheduler for work...\n",
"INFO: [pid 48334] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) running StartLungStage(patient_name=Bob)\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: StartLungStage_Bob_5a82ae4636 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: StartLungStage_Bob_5a82ae4636 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: StartLungStage_Bob_5a82ae4636 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: StartLungStage_Bob_5a82ae4636 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: StartLungStage_Bob_5a82ae4636 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: StartLungStage_Bob_5a82ae4636 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: StartLungStage_Bob_5a82ae4636 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: StartLungStage_Bob_5a82ae4636 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: StartLungStage_Bob_5a82ae4636 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: StartLungStage_Bob_5a82ae4636 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: StartLungStage_Bob_5a82ae4636 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: StartLungStage_Bob_5a82ae4636 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: StartLungStage_Bob_5a82ae4636 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: StartLungStage_Bob_5a82ae4636 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: StartLungStage_Bob_5a82ae4636 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: StartLungStage_Bob_5a82ae4636 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: StartLungStage_Bob_5a82ae4636 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: StartLungStage_Bob_5a82ae4636 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: StartLungStage_Bob_5a82ae4636 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"DEBUG: StartLungStage_Bob_5a82ae4636 is currently run by worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219)\n",
"INFO: [pid 48334] Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) done StartLungStage(patient_name=Bob)\n",
"INFO: Informed scheduler that task StartLungStage_Bob_5a82ae4636 has status DONE\n",
"DEBUG: Asking scheduler for work...\n",
"DEBUG: Done\n",
"DEBUG: There are no more tasks to run at this time\n",
"INFO: Worker Worker(salt=090724200, workers=2, host=Kevins-MacBook-Pro-2.local, username=mader, pid=48219) was stopped. Shutting down Keep-Alive thread\n",
"INFO: \n",
"===== Luigi Execution Summary =====\n",
"\n",
"Scheduled 11 tasks of which:\n",
"* 11 ran successfully:\n",
" - 1 ClassifyPatient(accession_number=4353890)\n",
" - 1 DetectLesions(accession_number=4353890)\n",
" - 5 DownloadData(series_id=4353890_0000,4353890_0001,4353890_0002,...)\n",
" - 1 Fancy3DRendering(accession_number=4353890)\n",
" - 1 PackageNPZ(accession_number=4353890)\n",
" ...\n",
"\n",
"This progress looks :) because there were no failed tasks or missing external dependencies\n",
"\n",
"===== Luigi Execution Summary =====\n",
"\n\n"
]
}
],
"execution_count": 4,
"metadata": {}
},
{
"cell_type": "code",
"source": [
"from analysis_pipeline import StartLungStage\n",
"c_task = StartLungStage('Bob')\n",
"c_task.run()"
],
"outputs": [],
"execution_count": 5,
"metadata": {}
},
{
"cell_type": "markdown",
"source": [
"# Interactive Web Tool"
],
"metadata": {}
},
{
"cell_type": "code",
"source": [
"import numpy as np\n",
"import pandas as pd\n",
"import dash\n",
"import dash_core_components as dcc\n",
"import dash_html_components as html\n",
"from plotly import graph_objs as go\n",
"from dash.dependencies import Input, Output\n",
"from flask import Flask\n",
"from lungstage.dash import show_app, generate_table\n",
"test_case_names = [dict(label = c_name, value = c_name) for c_name in ['Bob', 'Joe', 'Dan']]"
],
"outputs": [],
"execution_count": 6,
"metadata": {}
},
{
"cell_type": "code",
"source": [
"page_layout = html.Div([\n",
" dcc.Dropdown(id = 'select_patient', \n",
" options = test_case_names,\n",
" placeholder = 'Select Patient',\n",
" searchable = True),\n",
" html.H4('Patient Status'),\n",
" html.Div(id = 'patient_status'),\n",
" html.Button('Run Task', id = 'submit_job'),\n",
" html.Div(id = 'task_info', children = ['No tasks are running']),\n",
" html.Iframe(src = 'http://localhost:8082', width = \"800px\")\n",
"])"
],
"outputs": [],
"execution_count": 7,
"metadata": {}
},
{
"cell_type": "code",
"source": [
"app_tm = dash.Dash()\n",
"app_tm.layout = page_layout\n",
"@app_tm.callback(\n",
" Output(component_id='patient_status', component_property='children'),\n",
" [Input(component_id='select_patient', component_property='value')]\n",
")\n",
"def update_status(in_patient):\n",
" if in_patient is None:\n",
" return 'No patient selected!'\n",
" c_task = StartLungStage(in_patient)\n",
" if c_task.complete():\n",
" with c_task.output().open('r') as f:\n",
" return f.readlines()\n",
" else:\n",
" return 'Analysis has not been run yet'\n",
"@app_tm.callback(\n",
" Output(component_id='submit_job', component_property='disabled'),\n",
" [Input(component_id='select_patient', component_property='value')]\n",
")\n",
"def button_disable(in_patient):\n",
" if in_patient is None:\n",
" return True\n",
" else:\n",
" if StartLungStage(in_patient).complete():\n",
" return True\n",
" return False\n",
"\n",
"@app_tm.callback(\n",
" dash.dependencies.Output('task_info', 'children'),\n",
" [dash.dependencies.Input('submit_job', 'n_clicks')],\n",
" [dash.dependencies.State('select_patient', 'value')])\n",
"def update_output(n_clicks, in_patient):\n",
" if (n_clicks is not None) and (in_patient is not None):\n",
" return run_luigi_pipe(in_patient)\n",
"\n\n"
],
"outputs": [],
"execution_count": 8,
"metadata": {}
},
{
"cell_type": "code",
"source": [
"show_app(app_tm, offline=False, width = 1024)"
],
"outputs": [
{
"output_type": "display_data",
"data": {
"text/html": [
"<iframe src=\"http://localhost:9999\" width=1024 height=350></iframe>"
]
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stderr",
"text": [
" * Running on http://127.0.0.1:9999/ (Press CTRL+C to quit)\n",
"127.0.0.1 - - [20/Oct/2017 11:41:05] \"GET / HTTP/1.1\" 200 -\n",
"127.0.0.1 - - [20/Oct/2017 11:41:07] \"GET /_dash-layout HTTP/1.1\" 200 -\n",
"127.0.0.1 - - [20/Oct/2017 11:41:07] \"GET /_dash-dependencies HTTP/1.1\" 200 -\n",
"127.0.0.1 - - [20/Oct/2017 11:41:07] \"POST /_dash-update-component HTTP/1.1\" 200 -\n",
"127.0.0.1 - - [20/Oct/2017 11:41:07] \"POST /_dash-update-component HTTP/1.1\" 200 -\n",
"127.0.0.1 - - [20/Oct/2017 11:41:07] \"POST /_dash-update-component HTTP/1.1\" 200 -\n",
"127.0.0.1 - - [20/Oct/2017 11:41:32] \"POST /_dash-update-component HTTP/1.1\" 200 -\n",
"127.0.0.1 - - [20/Oct/2017 11:41:32] \"POST /_dash-update-component HTTP/1.1\" 200 -\n",
"127.0.0.1 - - [20/Oct/2017 11:41:34] \"POST /_dash-update-component HTTP/1.1\" 200 -\n",
"127.0.0.1 - - [20/Oct/2017 11:41:34] \"POST /_dash-update-component HTTP/1.1\" 200 -\n",
"127.0.0.1 - - [20/Oct/2017 11:41:37] \"POST /_dash-update-component HTTP/1.1\" 200 -\n",
"127.0.0.1 - - [20/Oct/2017 11:41:37] \"POST /_dash-update-component HTTP/1.1\" 200 -\n"
]
}
],
"execution_count": 9,
"metadata": {}
},
{
"cell_type": "code",
"source": [],
"outputs": [],
"execution_count": 10,
"metadata": {}
}
],
"metadata": {
"kernelspec": {
"name": "python3",
"language": "python",
"display_name": "Python 3"
},
"language_info": {
"pygments_lexer": "ipython3",
"file_extension": ".py",
"version": "3.5.2",
"codemirror_mode": {
"version": 3,
"name": "ipython"
},
"name": "python",
"nbconvert_exporter": "python",
"mimetype": "text/x-python"
},
"kernel_info": {
"name": "python3"
},
"nteract": {
"version": "0.3.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment