Skip to content

Instantly share code, notes, and snippets.

@hgrecco
hgrecco / maturin_build_stderr.txt
Last active March 6, 2024 00:19
tyring to run maturin
🔗 Found pyo3 bindings
🐍 Found CPython 3.10 at /Users/<USERNAME>/anaconda3/envs/maturin310/bin/python3
📡 Using build options features from pyproject.toml
💻 Using `MACOSX_DEPLOYMENT_TARGET=10.12` for x86_64-apple-darwin by default
Finished dev [unoptimized + debuginfo] target(s) in 0.03s
📦 Built wheel for CPython 3.10 to /Users/<USERNAME>/Documents/code/string_sum/target/wheels/string_sum-0.1.0-cp310-cp310-macosx_10_12_x86_64.whl
@hgrecco
hgrecco / _dynamic_form.py
Last active February 7, 2024 05:06
Dynamic reflex pages based on models
from dataclasses import dataclass
from typing import Iterable, Any, Sequence, NamedTuple
import stringcase
import reflex as rx
from sqlmodel import select
@hgrecco
hgrecco / hdr.py
Created August 9, 2018 17:39
hdr
import numpy as np
from scipy import interpolate
def to_hdr(stack, exposures, mininum, maximum):
"""Convert a stack of images with different exposure time
to a High Dynamic Range Image.
Parameters
@hgrecco
hgrecco / Cargo.toml
Last active June 18, 2018 16:29
Problem with serde_derive
[package]
name = "stest"
version = "0.2.0"
authors = ["Bla <[email protected]>"]
[dependencies]
serde = "=1.0.62"
serde_derive = "=1.0.62"
serde_json = "=1.0.21"
actix-web = "=0.6.13"
@hgrecco
hgrecco / flimds.py
Last active November 11, 2016 19:52
class UncorrectedFLIMds:
"""Abstract a FLIM dataset
"""
@classmethod
def from_file(self, filename):
"""Loads the dataset from a file.
"""
@hgrecco
hgrecco / _argsort.py
Created June 7, 2015 04:28
Naive argsort for 1D arrays
import numpy as np
import numba as nb
@nb.njit()
def partition(values, idxs, left, right):
"""
Partition method
"""
# -*- coding: utf-8 -*-
"""
Resource Name handling routines
:copyright: 2014 by PyVISA-sim Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
from __future__ import division, unicode_literals, print_function, absolute_import
@hgrecco
hgrecco / designer.html
Created March 20, 2015 00:00
designer
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-tooltip/core-tooltip.html">
<polymer-element name="my-element">
<template>
<style>
@hgrecco
hgrecco / get-lantz.py
Created December 31, 2014 05:51
Script to install Lantz and its dependencies
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import sys
if not sys.version_info >= (3, 2, 1):
print('Lantz requires Python >= 3.2.1')
sys.exit(1)
import os
@hgrecco
hgrecco / gist:3db1fb7d9b5357b668c7
Last active February 22, 2017 14:13
Matplotlib theming
http://olgabot.github.io/prettyplotlib/
http://damon-is-a-geek.com/publication-ready-the-first-time-beautiful-reproducible-plots-with-matplotlib.html
http://datasciencelab.wordpress.com/2013/12/21/beautiful-plots-with-pandas-and-matplotlib/
http://www.huyng.com/posts/sane-color-scheme-for-matplotlib/
http://stanford.edu/~mwaskom/software/seaborn/index.html
http://nbviewer.ipython.org/gist/olgabot/5357268