You only need to do this one time.
module avail # look for dev/python/3
module load dev/python/3.4.2
python -m venv ~/venv # You can replace ~/venv with any directory if you wish
Do this each time you log in, before running python code.
import jaydebeapi | |
import pandas as pd | |
def cursor_to_df(cursor): | |
df = pd.DataFrame(cursor.fetchall()) | |
df.columns = [d[0] for d in cursor.description] | |
return df | |
fmsHostname = 'fmprod13.med.harvard.edu' | |
fmFilename = 'HITS_Reagent_Tracker_2_0' |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import (relationship, sessionmaker, subqueryload, | |
with_polymorphic) | |
from sqlalchemy import create_engine, Column, String, Integer | |
from sqlalchemy.schema import ForeignKey | |
Base = declarative_base() | |
class A(Base): |
import logging | |
logger = logging.getLogger(__name__) | |
def foo(a, b): | |
logger.info('foo(%s, %s)', a, b) |
from pysb import * | |
Model() | |
Monomer('Glucose') | |
Monomer('Vp') | |
Parameter('kf', .015) | |
Parameter('kr', .015) | |
Parameter('Vsk', -18) |
# Hacks to get line_profiler to profile top-level code in a script/module. | |
# 1. The interface only allows profiling functions, but the core profiling logic | |
# actually works directly with code objects. We create a new function object | |
# from the code at the top level of the script to profile, and call | |
# profile.add_function on it. This is enough to trick the bookkeeping code in | |
# line_profiler to include the top-level code. | |
# 2. Even though the entirety of the top-level code is profiled in full, the | |
# results printer will stop at the first function definition, class definition, |
import String | |
import Array | |
import Graphics.Input (Input, input) | |
import Graphics.Input.Field as Field | |
logistic : Float -> Float -> Float -> Float -> Float -> Float | |
logistic x emin emax mid slope = | |
( (emin-emax) / (1 + ((x/mid)^slope) ) ) + emax | |
lcurve : Float -> Float -> Float -> Path |