Skip to content

Instantly share code, notes, and snippets.

View glyg's full-sized avatar

Guillaume Gay glyg

View GitHub Profile
@glyg
glyg / generator.py
Created November 16, 2021 18:52
a simple waveform generator with magicgui
"""
See: https://docs.scipy.org/doc/scipy/reference/signal.html#waveforms
"""
from dataclasses import dataclass, field
from functools import partial
import matplotlib.pyplot as plt
import numpy as np
from scipy import signal
@glyg
glyg / quiver.py
Last active October 22, 2021 12:13
import matplotlib.pyplot as plt
import io
def quiver_overlay(img, x, y, u, v, rescale, **kwargs):
"""Plots a quiver and return a superposable visualisation
Parameters
----------
img: ndarray,
the input (2D) image array
@glyg
glyg / blocks.py
Created September 6, 2021 11:46
slices blocks from images
import numpy as np
img = np.random.poisson(size=(1024, 1024))
pad_x, pad_y = np.meshgrid(np.arange(-5, 5), np.arange(-5, 5))
cx = np.random.randint(0, img.shape[0], 12)
cy = np.random.randint(0, img.shape[0], 12)
xx = cx[:, None, None] + pad_x
import os
import sys
from pathlib import Path
sys.path.append(r"C:\Users\endo\Documents\endo-py")
import numpy as np
import matplotlib.pyplot as plt

Keybase proof

I hereby claim:

  • I am glyg on github.
  • I am glyg (https://keybase.io/glyg) on keybase.
  • I have a public key ASBkD0fyyN9VGEg1GJKlxQfw3_WBzI7xGVdkmNthXVGNago

To claim this, I am signing this object:

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import os
import ipyvolume as ipv
from tyssue import Sheet, config, SheetGeometry
from tyssue.draw import sheet_view
from tyssue.io import hdf5
from pathlib import Path
import numpy as np
import pandas as pd
i = 0
def MyClass()
def __init__(self, data):
self._backups = deque()
self.data = data
def copy(self):
return MyClass(self.data)
def backup(self):
"""Creates a copy of self and keeps a reference to it
@glyg
glyg / minimal_bug.py
Last active August 29, 2015 14:07
Bug in graph_tool with list of edges property map
import graph_tool.all as gt
import numpy as np
import sys
print('*********************************')
print('gt version:\n {}\n'.format(gt.__version__))
print('sytem info:\n {}'.format(sys.version))
print('*********************************')
## Creating an hexagonal mesh
@glyg
glyg / Pombe's shape.ipynb
Last active May 6, 2016 00:04
The shape of the fission yeast s.Pombe cortex with python functions
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.