Skip to content

Instantly share code, notes, and snippets.

@rossant
rossant / vispy-text
Last active February 12, 2019 14:17
vispy text
We couldn’t find that file to show.
@rossant
rossant / _template.ott
Last active March 25, 2024 12:03
Convert from Markdown to OpenOffice for Linux Magazine
@rossant
rossant / benchmark.ipynb
Last active July 12, 2023 09:34
Quick HDF5 benchmark
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rossant
rossant / broken.md
Last active September 3, 2018 06:32
Consider your software broken if

Consider your software broken if:

  • You're the only one to understand how it works
  • You can't remember what a function does just by reading its name
  • You're not using a version control system
  • You're not using continuous integration
  • You're not continuously monitoring the quality of your code
  • You have little or no unit tests
  • You have little or no integration tests
  • You don't use an issue tracker
@rossant
rossant / hdf5.md
Created October 9, 2015 08:49
Problems with HDF5

Problems with HDF5

  • Corruption: not sure why, sometimes files get corrupted during a session and users lose all their work, either automatic or manual, which may correspond to days of computer time or, worse, human time. Corruption is more likely to happen because libhdf5 is a very complex piece of software, and a crash or sudden kill is likely to corrupt the file completely. This would be much rarer with flat binary or text files, at least you'd be able to recover part of the data.

  • Not possible to delete arrays, but that might be fixed in the future (not today though...).

  • Various bugs with strings on Windows and h5py: users may need to downgrade h5py in order to use their files, otherwise a nasty segfault occurs. Not a good sign...

  • There is a single implementation of HDF5 in the world, so we depend critically on it. It is almost impossible to contribute on such a complex piece of code since it is really low-level (in C). There are bugs and performance issues with it and there is nothing we can

@rossant
rossant / ipyparallel_test.py
Created September 29, 2015 19:06
Fixture for IPython.parallel and pytest
import os
from pytest import yield_fixture
@yield_fixture(scope='module')
def ipy_client():
def iptest_stdstreams_fileno():
return os.open(os.devnull, os.O_WRONLY)
from __future__ import print_function
import os
import os.path as op
import shutil
from pprint import pprint
from timeit import default_timer
import h5py
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rossant
rossant / markers.py
Created January 28, 2015 14:45
Point sprint example with VisPy
import sys
import numpy as np
from vispy import app, scene
canvas = scene.SceneCanvas(keys='interactive')
view = canvas.central_widget.add_view()
view.set_camera('turntable', mode='perspective', up='z', distance=2,
azimuth=30., elevation=30.)
pos = .25 * np.random.randn(1000, 3)