Skip to content

Instantly share code, notes, and snippets.

View michaelaye's full-sized avatar

Michael Aye michaelaye

View GitHub Profile
@michaelaye
michaelaye / conda_env_export.py
Created October 22, 2021 23:28 — forked from michael-ford/conda_env_export.py
Export a Conda environment with --from-history, but also append Pip-installed dependencies
"""
Export a Conda environment with --from-history, but also append
Pip-installed dependencies
Exports only manually-installed dependencies, excluding build versions, but
including Pip-installed dependencies.
Lots of issues requesting this functionality in the Conda issue tracker, no
sign of progress (as of March 2020).
[LabBuildApp] Building in /home/maye/miniconda3/envs/py38/share/jupyter/lab
[LabBuildApp] Node v16.10.0
[LabBuildApp] Yarn configuration loaded.
[LabBuildApp] Building jupyterlab assets (production, minimized)
[LabBuildApp] > node /home/maye/miniconda3/envs/py38/lib/python3.8/site-packages/jupyterlab/staging/yarn.js install --non-interactive
[LabBuildApp] yarn install v1.21.1
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
@michaelaye
michaelaye / test_nbs.py
Created October 11, 2021 20:33
cloned from Nixtla/mlforecast
# taken from: https://raw.githubusercontent.com/pete88b/decision_tree/master/test_nbs.py
# We need a "test_" file with "test_" functions to make it easy to run with pytest
# couple of example "test_" functions
# import nbdev.test
# def test_run():
# print('running nbdev.test.test_nb("20_models.ipynb") ...')
@michaelaye
michaelaye / remotemd5.py
Created October 7, 2021 02:09 — forked from brianewing/remotemd5.py
Python MD5 of remote file (URL)
import os, hashlib, urllib2, optparse
def get_remote_md5_sum(url, max_file_size=100*1024*1024):
remote = urllib2.urlopen(url)
hash = hashlib.md5()
total_read = 0
while True:
data = remote.read(4096)
total_read += 4096
@michaelaye
michaelaye / my_speedtest.py
Created September 22, 2021 03:02
Adding a timestring to speedtest csv output and add to csv file.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime as dt
from pathlib import Path
from sh import speedtest
fname = Path("multiple_connections_triton.csv")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@michaelaye
michaelaye / advanced_rasterio_features.ipynb
Created October 24, 2020 01:34 — forked from sgillies/advanced_rasterio_features.ipynb
Advanced Rasterio features notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@michaelaye
michaelaye / blink_images.ipynb
Created September 24, 2020 00:40
Blinking images with matplotlib