Skip to content

Instantly share code, notes, and snippets.

@hgrecco
hgrecco / flux.py
Created March 12, 2014 06:00
A GUI to travel through time in your filesystem using Camlistore.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Camlistore Flux Capacitor
~~~~~~~~~~~~~~~~~~~~~~~~~
A GUI to travel through time in your filesystem using Camlistore.
:copyright: 2014 by Hernan E. Grecco.
:license: BSD.
@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 / 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>
# -*- 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 / _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
"""
@hgrecco
hgrecco / lantz_multiple.py
Created October 5, 2012 12:09
Writting a multiple interface driver in lantz
class _A33120(object):
"""Agilent 33120A Function/Arbitrary Waveform Generator
"""
# Here goes the code for the instrument functions that
# are available in *both* GPIB and RS-232
class A33120Serial(_A33120, SerialDriver):
"""Agilent 33120A Function/Arbitrary Waveform Generator
@hgrecco
hgrecco / test_wrap.py
Created August 21, 2013 01:28
Wrapping a ndarray
import numpy as np
class C(object):
def __init__(self, value):
self.value = value
def __getattr__(self, name):
return getattr(self.value, name)
@hgrecco
hgrecco / code
Last active December 22, 2015 14:39 — forked from ColinBrosseau/code
SampleRateUnit = {'Seconds': '0', 'Minutes': '1', 'Hours': '2',
'Days': '3', '%': '4'}
SamplePeriodUnit = {'Seconds': '0', 'Minutes': '1', 'Hours': '2',
'Days': '3', 'Weeks': '4', 'Pulses': '5'}
TotalDurationUnit = {'Period': '0', 'Seconds': '1', 'Minutes': '2',
'Hours': '3', 'Days': '4', 'Weeks': '5', 'Continuous': '6',
'predefinded': '7'}
TimeStampEnabled = {False: 0, True: 1}
@Feat(values=(None, SampleRateUnit, None, SamplePeriodUnit, None,
from __future__ import division, unicode_literals, print_function, absolute_import
import re
from collections import defaultdict
_NEST_SCOPES = {'[': ']', '(': ')', '{': '}'}
_STR_SCOPES = '"' + "'"
#: Regex to find function calls.
@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.
"""