Skip to content

Instantly share code, notes, and snippets.

View PhillCli's full-sized avatar

Filip Brzek PhillCli

View GitHub Profile
#!/usr/bin/env python3
import subprocess
import uuid
try:
import click
except ImportError:
print("install click: `pip install click`")
exit
@PhillCli
PhillCli / click_memory_profiler.py
Last active September 27, 2022 09:26
memory profiler embedded into click command group
DEFAULT_DIR = "/tmp/memory_profile"
class RunMprof:
def __init__(self):
self.thread: subprocess.Popen = None
def __enter__(self):
import datetime, os, pathlib
@PhillCli
PhillCli / .bumpversion.cfg
Last active November 14, 2022 14:11
PEP440 bump2version config
[bumpversion]
commit = True
tag = False
current_version = 1.2.0.dev0
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<build>\d+))?
serialize =
{major}.{minor}.{patch}.{release}{build}
{major}.{minor}.{patch}
# inspired by: https://stackoverflow.com/a/64654668/8389830
@PhillCli
PhillCli / bench_blas_lapack.py
Created December 30, 2022 17:07 — forked from ogrisel/bench_blas_lapack.py
Running some benchmark of BLAS level 3 and LAPACK on Apple M1
import numpy as np
try:
import tensorflow as tf
except ImportError:
tf = None
from time import perf_counter
def timeit(func, *args, **kwargs):
durations = []