Skip to content

Instantly share code, notes, and snippets.

View mwtoews's full-sized avatar

Mike Taves mwtoews

View GitHub Profile
@mwtoews
mwtoews / requirements.txt
Last active August 14, 2020 03:04
General Python requirements
gdal
numpy
ipython
pytest
rasterio
fiona
shapely
geopandas
scipy
pyproj
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Slack filter by user.
Splits a single slack export into multiple exports, as viewed by
each user.
Created on Mon Jan 11 15:03:45 2021
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Check built-in super function to see if could be made better via PEP 3135.
Created on Sat Mar 20 21:23:36 2021
"""
import ast
import os
import git
@mwtoews
mwtoews / blend_text_array.py
Last active September 28, 2022 23:01
Blend two text arrays
#!/usr/bin/env python3
r"""Blend two text arrays.
Examples
--------
$ python blend_text_array.py \
--a1-fname si_3_s4_2000_orig.rch.dat \
--a2-fname topnet.rch_mean.dat \
--out-fname si_3_s4_2000.rch.dat
"""
@mwtoews
mwtoews / heads_to_raster.py
Created September 29, 2022 00:25
MODFLOW Heads to raster
#!/usr/bin/env python3
r"""Convert MODFLOW Heads to raster file.
Examples
--------
$ python heads_to_raster.py \
--hds-fname ni_3_s4_2000.hds \
--out-fname ni_hds.tif \
--top-left 1492000.0 6234000.0 \
--resolution 2000.0 --projection EPSG:2193
@mwtoews
mwtoews / digital_root.py
Last active April 9, 2024 02:56
digital root
import re
good = {1, 4, 7}
bad = {3, 6, 9}
neutral = {2, 8, 5}
re_digits = re.compile(r"([\d\:\.\,]+)")
re_digit = re.compile(r"\d")