Skip to content

Instantly share code, notes, and snippets.

@douglatornell
douglatornell / gist:11020457
Created April 18, 2014 01:33
IPython Notebook Exploring How netCDF4 Variable fill_value=0 Works
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@douglatornell
douglatornell / WestgridJun2014.ipynb
Last active August 29, 2015 14:02
Analysis of Jun-2014 Salish Sea NEMO runtime profile tests on westgrid.ca machines
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@douglatornell
douglatornell / script_runs_example.py
Created July 22, 2014 16:50
Example of a script to execute a series of Salish Sea NEMO model runs.
"""Example script to define and execute a series of Salish Sea NEMO model runs.
"""
from __future__ import absolute_import
import os
import salishsea_cmd.api
def main():
@douglatornell
douglatornell / gist:2151f2ab1173e7985594
Created September 17, 2014 20:46
Commands to concatenate hourly EC research 2.5km GEM files to create a 1-day forcing file for NEMO
ncrcat -4 -L4 2014091000_00?_2.5km_360x300.nc ../NEMO-atmos/y2014m09d10.nc
ncrcat -4 -L4 -A ../NEMO-atmos/y2014m09d10.nc 2014091000_01?_2.5km_360x300.nc ../NEMO-atmos/y2014m09d10.nc
ncrcat -4 -L4 -A ../NEMO-atmos/y2014m09d10.nc 2014091000_02?_2.5km_360x300.nc ../NEMO-atmos/y2014m09d10.nc
{
"metadata": {
"name": "",
"signature": "sha256:9e4150b049ad8b9ee7600a8fe76567ad97f185a1fd5cf7f86f63e60c83795bf7"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@douglatornell
douglatornell / gist:550c46ebd38c0f627a3e
Last active August 29, 2015 14:16
Notes from plot_thresholds_all() code review on 2015-03-10
from collections import OrderedDict
# Here's a possible data structure to hold constant values for the sites
# that we report ssh for. The outer dict has 2 keys: DFO and NOAA. Each of
# those keys has an OrderedDict as its value. OrderedDicts are defined by
# lists of key-value 2-tuples. Here the keys of the DFO OrderedDict are the
# names of the DFO sites, and the values are a dict of constant values.
# So, iterating over SITES['DFO'].items() will return the constants for
# Point Atkinson, Campbell River, and Victoria, in that order. The Campbell
# River extreme_ssh is accessed by SITES['DFO']['Campbell River']['extreme_ssh'].
@douglatornell
douglatornell / incremental.py
Created March 18, 2012 17:40
Options for keys list for buildbot try job parser
# Incremental:
v1_keys = ['jobid', 'branch', 'baserev', 'patch_level', 'patch_body']
v2_keys = v1_keys + ['repository', 'project']
v3_keys = v2_keys + ['who']
v4_keys = v3_keys + ['comment']
keys = [v1_keys, v2_keys, v3_keys, v4_keys]
@douglatornell
douglatornell / gist:2728814
Created May 19, 2012 03:09
Typical Traceback of Blogofile plugins Branch Test Error (unittest discover)
With Python 3.2 unittest discover as test runner:
======================================================================
ERROR: testUpperCaseAutoPermalink (blogofile.tests.test_content.TestContent)
Auto generated permalinks should have title and filenames lower case
----------------------------------------------------------------------
Traceback (most recent call last):
File "blogofile/tests/test_content.py", line 79, in testUpperCaseAutoPermalink
main.main("init blog_unit_test")
File "blogofile/main.py", line 186, in main
@douglatornell
douglatornell / gist:2728853
Created May 19, 2012 03:22
Typical Traceback of Blogofile plugins Branch Test Error (py.test)
With Python 3.2 py.test as test runner:
___________________________ TestContent.testUpperCaseAutoPermalink ___________________________
self = <blogofile.tests.test_content.TestContent testMethod=testUpperCaseAutoPermalink>
def testUpperCaseAutoPermalink(self):
"""Auto generated permalinks should have title and filenames lower case
(but not the rest of the URL)"""
main.main("init blog_unit_test")
@douglatornell
douglatornell / gist:4435214
Created January 2, 2013 15:07
pyramid_mailer transaction traceback from Python 3.3
Traceback (most recent call last):
File "/Users/doug/.virtualenvs/randopony-tetra/lib/python3.3/site-packages/pyramid_debugtoolbar-1.0.3-py3.3.egg/pyramid_debugtoolbar/panels/performance.py", line 55, in resource_timer_handler
result = handler(request)
File "/Users/doug/.virtualenvs/randopony-tetra/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/tweens.py", line 21, in excview_tween
response = handler(request)
File "/Users/doug/.virtualenvs/randopony-tetra/lib/python3.3/site-packages/pyramid_tm-0.7-py3.3.egg/pyramid_tm/__init__.py", line 82, in tm_tween
reraise(*exc_info)
File "/Users/doug/.virtualenvs/randopony-tetra/lib/python3.3/site-packages/pyramid_tm-0.7-py3.3.egg/pyramid_tm/compat.py", line 13, in reraise
raise value
File "/Users/doug/.virtualenvs/randopony-tetra/lib/python3.3/site-packages/pyramid_tm-0.7-py3.3.egg/pyramid_tm/__init__.py", line 63, in tm_tween