Skip to content

Instantly share code, notes, and snippets.

*.py[oc]
@ahmadia
ahmadia / cmagic.py
Last active December 17, 2015 11:09
cmagic -- this is a very simple magic for compiling and importing C code with ctypes in IPython.
# -*- coding: utf-8 -*-
"""C magic.
This is a very simple magic for compiling and importing C code with ctypes.
This derives from biteymagic.py, by Bradley Froehle:
https://gist.github.com/bfroehle/3458310
You must provide the function names you would like exported.
@ahmadia
ahmadia / maruku_rdiscount.diff
Created May 18, 2013 16:46
differences in maruku, rdiscount, and redcarpet for SWC GitHub-Pages.
diff -r _site_maruku/1900-01-01-example-page/index.html _site_rdiscount/1900-01-01-example-page/index.html
30c30
< <h1 id='an_example'>An Example</h1>
---
> <h1>An Example</h1>
32,34c32,39
< <p>Our posturings, our imagined self-importance, the delusion that we have some privileged position in the Universe, are challenged by this point of pale light. Our planet is a lonely speck in the great enveloping cosmic dark. In our obscurity, in all this vastness, there is no hint that help will come from elsewhere to save us from ourselves.</p>
< <div class='highlight'><pre><code class='python'><span class='k'>def</span> <span class='nf'>hello_world</span><span class='p'>():</span>
< <span class='k'>print</span> <span class='s'>&#39;Hello, world!&#39;</span>
---
@ahmadia
ahmadia / test_growcut.py
Last active December 17, 2015 16:29
timing code for comparing pypy/numba
from timeit import timeit
try:
import numpypy as np
except:
import numpy as np
import math
def window_floor(idx, radius):
# -*- coding: utf-8 -*-
"""
Fortran f2py related magics.
Author:
* David Trémouilles
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2012, IPython Development Team.
@ahmadia
ahmadia / run_tests_output.txt
Created September 25, 2013 01:44
output of Randy's tests: amrclaw: commit 40171b174c45214f7b10f55ac27e5c6f6d4149ad Author: Randy LeVeque <rjl@ned> Date: Mon Sep 23 17:40:36 2013 -0700 Improved regression tests to make it easier to adapt to new problems commit bb68932cb9f081ec3789756b41cd794771631bd4 Merge: 8394859 f5d4ed1 Author: Kyle Mandli <[email protected]> Date: Thu Au…
ALL OUTPUT FROM NOSETESTS
============================================================
/Users/aron/sandbox/clawpack/amrclaw/tests/acoustics_2d_radial
============================================================
rm -f xamr qinit.f.html setprob.f.html regression_tests.py.html setplot.py.html setrun.py.html regression_data_test2.html regression_data_test3.html regression_data_test4.html Makefile.html
rm -f .data .output .plots .htmls
gfortran -c /Users/aron/sandbox/clawpack/amrclaw/src/2d/amr_module.f90 -J/Users/aron/sandbox/clawpack/amrclaw/src/2d -I/Users/aron/sandbox/clawpack/amrclaw/src/2d/ -I/Users/aron/sandbox/clawpack/amrclaw/src/2d/ -I/Users/aron/sandbox/clawpack/amrclaw/src/2d/ -I/Users/aron/sandbox/clawpack/amrclaw/tests/acoustics_2d_radial/ -o /Users/aron/sandbox/clawpack/amrclaw/src/2d/amr_module.o
gfortran -c /Users/aron/sandbox/clawpack/amrclaw/src/2d/gauges_module.f90 -J/Users/aron/sandbox/clawpack/amrclaw/src/2d -I/Users/aron/sandbox/clawpack/amrclaw/src/2d
@ahmadia
ahmadia / -
Created October 24, 2013 13:50
test_import
testing poisson on 1 node (8 mpi tasks)
Initializing NumericalSolution for poisson_3d_c0p1pe8
System includes:
poisson_3d_c0p1pe8
Setting Archiver(s)
Setting up MultilevelMesh
Building one multilevel mesh for all models
Generating mesh for poisson_3d_c0p1pe8
@ahmadia
ahmadia / -
Created October 24, 2013 14:07
This file has been truncated, but you can view the full file.
Warning: no access to tty (Bad file descriptor).
Thus no job control in this shell.
ModuleCmd_Switch.c(172):ERROR:152: Module 'PrgEnv-pgi' is currently not loaded
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
testing import
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Application 22407609 resources: utime ~0s, stime ~0s
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
testing import on all mpi processes
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- address: Phillips Auditorium at the Center for Astrophysics, 60 Garden Street
contact: [email protected]
country: United-States
enddate: 2013-08-24
humandate: August 23-24, 2013
humantime: 9:00 am - 4:30 pm
instructor: [Erik Bray, Jessica McKellar, R. David Murray, Mike Selik]
latlng: 42.381705,-71.127904
layout: bootcamp
registration: restricted
""" Group Tutorial
Tutorial code for assigning tasks to subcommunicators and relaying
results back.
In this tutorial, no intercommunicator is used. Instead,
intracommunicators are created with coordination done by rank 0. It
is assumed that the second process will be responsible for Task A, and
that all remaining processes coordinate on Task B.