Skip to content

Instantly share code, notes, and snippets.

View honno's full-sized avatar
🛰️

Matthew Barber honno

🛰️
  • Hexegic
  • Southend-on-Sea
  • 09:35 (UTC)
View GitHub Profile
@honno
honno / unmute_all.ipynb
Created July 18, 2021 10:05
Unmute everyone you follow. Yaknow, for those times when you fuck around with the API and mute everybody by accident.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@honno
honno / wip_hypothesis_array_api_demo.ipynb
Last active August 5, 2021 15:46
WIP demo that demonstrates what my internship project is doing. For those not familiar with Array API and/or Hypothesis I want to try and explain what they do.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python
import pytest
from hypothesis import assume, given, strategies as st
from hypothesis.errors import InvalidArgument
from hypothesis.extra.array_api import DTYPE_NAMES, NUMERIC_NAMES
from tests.array_api.common import COMPLIANT_XP, xp, xps
from tests.common.debug import find_any, minimal
from tests.common.utils import fails_with, flaky
@honno
honno / _dask.py
Last active January 18, 2022 09:42
# Wrapper of dask for use with github.com/data-apis/array-api-tests
# Tested with dask version 2022.01.0
# How to use:
# 1. Place this file in `array_api_tests/_dask.py`
# 2. In `array_api_tests/_array_module.py` replace `array_module = None` with
# `from ._dask import array_module`
from dask import array as da
@honno
honno / _mxnet.py
Last active January 18, 2022 11:00
# Wrapper of mxnet for use with github.com/data-apis/array-api-tests
# Tested with dask version 1.9.0
# How to use:
# 1. Place this file in `array_api_tests/_mxnet.py`
# 2. In `array_api_tests/_array_module.py` replace `array_module = None` with
# `from ._mxnet import array_module`
import mxnet as mx
@honno
honno / get_mod.py
Created February 8, 2022 11:14
Get module via path
from importlib.util import spec_from_file_location, module_from_spec
from pathlib import Path
from types import ModuleType
def get_mod(path: Path) -> ModuleType:
mod_name = path.name.replace(".py", "")
spec = spec_from_file_location(mod_name, path)
assert spec is not None
mod = module_from_spec(spec)
assert spec.loader is not None
@honno
honno / details_summary.md
Created June 14, 2022 11:21
Using `<details>` for code blocks
Summary text
your code