Skip to content

Instantly share code, notes, and snippets.

@poplarShift
poplarShift / odv2python.py
Created December 3, 2018 17:09
Reading ODV ("Ocean Data View") data formats into python/pandas
# CASE 1: 'ODV.nc' exported from ODV.
import xarray as xr
ds = xr.open_dataset('ODV.nc')
ds.rename({v: ds[v].long_name for v in ds if hasattr(ds[v], 'long_name')})
# CASE 2: 'ODV.txt' in the tabular ODV text format.
import pandas as pd
@poplarShift
poplarShift / SLURMCluster_vs_Singularity.ipynb
Created May 6, 2022 14:10 — forked from willirath/SLURMCluster_vs_Singularity.ipynb
Dask-Jobqueue SLURMCluster with Singularity
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@poplarShift
poplarShift / citefilter.py
Created November 4, 2023 11:55
Parse markdown-style citations in .docx using pandocfilters
#!/usr/bin/env python
"""
Pandoc filter to convert text of form [@foo,@bar] to citations.
Handy for e.g. word documents...
"""
import re
from pandocfilters import toJSONFilter, Str