Skip to content

Instantly share code, notes, and snippets.

View kohr-h's full-sized avatar

Holger Kohr kohr-h

  • Thermo Fisher Scientific (@thermofisher)
  • Eindhoven, The Netherlands
View GitHub Profile
@kohr-h
kohr-h / backtrace.txt
Created August 28, 2018 09:26
pytest plugin UsageError backtrace
[...]\_pytest\config\__init__.py:518: UsageError
____ ERROR at setup of [doctest] odl.util.utility.NumpyRandomSeed.__init__ ____
self = <CallInfo when='setup' exception: Plugin specs must be a ','-separated string or a list/tuple of strings for plugin names. Given: <module 'odl.util.pytest_plugins' from '[...]\\odl\\util\\pytest_plugins.py'>>
func = <function call_runtest_hook.<locals>.<lambda> at 0x00000000054AB620>
when = 'setup', treat_keyboard_interrupt_as_exception = False
def __init__(self, func, when, treat_keyboard_interrupt_as_exception=False):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
@kohr-h
kohr-h / tspace_pspace_conversion.py
Created January 9, 2018 13:51
ODL conversion between tensor spaces and power spaces
def as_tensor_space(pspace, axis=None):
"""Convert a `ProductSpace` of `TensorSpace`'s to a tensor space.
Parameters
----------
pspace : `ProductSpace`
Power space (with arbitrary shape) whose base is a `TensorSpace`.
axis : int or sequence of int, optional
Indices at which the powers should be inserted as new axes.
For the default ``None``, the power axes are added to the left.
@kohr-h
kohr-h / accum.py
Last active December 21, 2016 15:53
Attempt at GPU accumulation
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 21 11:13:32 2016
@author: kohr
"""
# %% --- Basic stuff from pygpu/reduction.py --- #
import math