Skip to content

Instantly share code, notes, and snippets.

View dionhaefner's full-sized avatar

Dion Häfner dionhaefner

View GitHub Profile
@dionhaefner
dionhaefner / 1-veros-sverdrup.ipynb
Last active June 17, 2021 14:20
Ocean modelling the Veros: The Sverdrup relation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dionhaefner
dionhaefner / tdma.ipynb
Created March 23, 2020 14:19
Benchmarks of the tridiagonal matrix algorithm in Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dionhaefner
dionhaefner / tdma_benchmarks.ipynb
Created February 23, 2017 21:55
tdma-benchmarks.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from xml.etree.ElementTree import XMLParser, TreeBuilder
import struct
import base64
import re
class VTKTreeBuilder(TreeBuilder):
"""
Sublass of TreeBuilder that decodes ASCII or base64-encoded VTK DataArrays.
When the end-tag of a base64-encoded DataArray is encountered, the XML string
is decoded and unpacked according to its data type and the VTK specification.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.