Skip to content

Instantly share code, notes, and snippets.

$ setup --nolocks -n -v -v -r ./astrometry_net_data astrometry_net_data
Reading tags from /ssd/lsstsw/stack3_20171021/stack/miniconda3-4.3.21-10a4fa6/ups_db/global.tags
Regenerating missing or out-of-date cache for Linux64 in /home/swinbank/.eups/ups_db
Using VRO for "default": ['type:exact', 'commandLine', 'version', 'versionExpr', 'current']
Setting up: astrometry_net_data Flavor: Linux64 Version: LOCAL:/ssd/swinbank/lsst_dm_stack_demo/astrometry_net_data
export PATH=/ssd/lsstsw/stack3_20171021/stack/miniconda3-4.3.21-10a4fa6/Linux64/meas_mosaic/16.0-3-gc6b5e5c+1/bin:/ssd/lsstsw/stack3_20171021/stack/miniconda3-4.3.21-10a4fa6/Linux64/treecorr/3.2.3.lsst3+2/bin:/ssd/lsstsw/stack3_20171021/stack/miniconda3-4.3.21-10a4fa6/Linux64/validate_drp/16.0-3-gab31991+1/bin:/ssd/lsstsw/stack3_20171021/stack/miniconda3-4.3.21-10a4fa6/Linux64/verify/16.0+1/bin:/ssd/lsstsw/stack3_20171021/stack/miniconda3-4.3.21-10a4fa6/Linux64/synpipe/16.0-1-g682901a+1/bin:/ssd/lsstsw/stack3_20171021/stack/miniconda3-4.3.21
[jds@magpie lsst_dm_stack_demo-16.0]$ setup lsst_distrib
[jds@magpie lsst_dm_stack_demo-16.0]$ eups list -s python_future
0.16.0+3 v16_0_rc1 w_2018_20 d_2018_06_13 w_2018_22 d_2018_06_11 d_2018_06_08 sims_2_8_1 d_latest current w_2018_26 d_2018_06_15 d_2018_06_28 w_2018_19 w_2018_24 d_2018_06_17 v16_0 sims d_2018_06_10 w_2018_23 v16_0_rc2 sims_2_8_0 qserv-dev sims_2_8_2 d_2018_06_12 w_2018_21 w_2018_25 w_2018_18 w_latest o_latest d_2018_06_29 sims_2_9_0 d_2018_06_14 d_2018_06_18 d_2018_06_25 d_2018_07_01 d_2018_07_03 dax_latest d_2018_06_27 d_2018_06_07 d_2018_07_05 d_2018_06_21 d_2018_07_02 d_2018_06_26 d_2018_06_24 d_2018_06_19 d_2018_07_04 d_2018_06_20 d_2018_06_22 d_2018_07_06 setup
[jds@magpie lsst_dm_stack_demo-16.0]$ eups list -s | wc -l
116
[jds@magpie lsst_dm_stack_demo-16.0]$ cat astrometry_net_data/ups/astrometry_net_data.table
[jds@magpie lsst_dm_stack_demo-16.0]$ setup --nolocks -v -r ./astrometry_net_data astrometry_net_data
Setting up: astrometry_net_data Flavor: DarwinX86 V
vitafol ["","","","4511",""]
nephron fa ["","","","4511"]
allerx 10 ["","","","8896"]
allerx 30 ["","","","8896"]
corvite 150 ["","","4511","","","","11248","42954",""]
choice-tabs ["","","4511","",""]
dialyvite zinc ["","","4511","",""]
hematron-af ["","","4511","",""]
strovite advance + d ["","","4511","",""]
strovite one ["","","4511","",""]
"""
Cross-match RxNorm-RxCUI with Medicare Part D drug names.
"""
from collections import defaultdict
from collections import namedtuple
from difflib import SequenceMatcher
import re
import sys
def normalize_text(text):
class PSDPosterior(object):
def __init__(self):
self.foo = 10
my_lambda = lambda self, x : self.foo * x
psd_posterior = PSDPosterior()
import types
psd_posterior.logprior = types.MethodType(my_lambda, psd_posterior)

In your task code: when you call:

debug = lsstDebug.Info(__name__)

(with __name__ being the name of the current task), you are given a "debug object". By default that will return False for any attribute you access. Thus, you can do:

>>> debug.foo
False
In [1]: import matplotlib
In [2]: matplotlib.cm
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-2-d4848939ab69> in <module>()
----> 1 matplotlib.cm
AttributeError: module 'matplotlib' has no attribute 'cm'
[jds@magpie mpi4py-2.0.0]$ mpiexec -n 5 python test/runtests.py
[2@magpie] Python 3.5 (/Users/jds/test/bin/python)
[2@magpie] MPI 3.0 (MPICH 3.1.4)
[0@magpie] Python 3.5 (/Users/jds/test/bin/python)
[0@magpie] MPI 3.0 (MPICH 3.1.4)
[0@magpie] mpi4py 2.0.0 (/Users/jds/test/lib/python3.5/site-packages/mpi4py)
[2@magpie] mpi4py 2.0.0 (/Users/jds/test/lib/python3.5/site-packages/mpi4py)
[4@magpie] Python 3.5 (/Users/jds/test/bin/python)
[4@magpie] MPI 3.0 (MPICH 3.1.4)
[4@magpie] mpi4py 2.0.0 (/Users/jds/test/lib/python3.5/site-packages/mpi4py)
[jds@magpie mpi4py-1.3.1 (master)]$ mpiexec -n 5 python test/runtests.py
[0@magpie] Python 2.7 (/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python)
[1@magpie] Python 2.7 (/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python)
[1@magpie] MPI 3.0
[1@magpie] mpi4py 1.3.1 (/Users/jds/Projects/Astronomy/LSST/stack/DarwinX86/mpi4py/1.3.1.lsst1/lib/python/mpi4py)
[2@magpie] Python 2.7 (/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python)
[2@magpie] MPI 3.0
[2@magpie] mpi4py 1.3.1 (/Users/jds/Projects/Astronomy/LSST/stack/DarwinX86/mpi4py/1.3.1.lsst1/lib/python/mpi4py)
[3@magpie] Python 2.7 (/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python)
[3@magpie] MPI 3.0
[jds@magpie mpi4py-1.3.1 (master)]$ mpiexec -n 5 python test/runtests.py
[0@magpie] Python 2.7 (/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python)
[1@magpie] Python 2.7 (/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python)
[1@magpie] MPI 3.0
[1@magpie] mpi4py 1.3.1 (/Users/jds/Projects/Astronomy/LSST/stack/DarwinX86/mpi4py/1.3.1.lsst1/lib/python/mpi4py)
[2@magpie] Python 2.7 (/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python)
[2@magpie] MPI 3.0
[2@magpie] mpi4py 1.3.1 (/Users/jds/Projects/Astronomy/LSST/stack/DarwinX86/mpi4py/1.3.1.lsst1/lib/python/mpi4py)
[3@magpie] Python 2.7 (/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python)
[3@magpie] MPI 3.0