Skip to content

Commit

Permalink
Merge branch 'main' into agoose77/fix-from-iter-non-iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 authored Apr 5, 2023
2 parents c10b557 + 6a24ed0 commit 6b0f46e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/getting-started/community-tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ A tutorial presented at the SciPy conference on July 11, 2022.

### Format
- [{fab}`github` GitHub repository](https://github.com/jpivarski-talks/2022-07-11-scipy-loopy-tutorial)
with Jupyter Notebooks that can be run on [MyBinder](https://mybinder.org/).
with Jupyter Notebooks that can be run on [MyBinder](https://mybinder.org/v2/gh/jpivarski-talks/2022-07-11-scipy-loopy-tutorial/v1.0?urlpath=lab/tree/narrative.ipynb).
- [{fab}`youtube` YouTube](https://www.youtube.com/watch?v=Dovyd72eD70) recording of presentation.

### Objectives
Expand Down
20 changes: 20 additions & 0 deletions tests/test_2355_to_backend_record.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE

import numpy as np # noqa: F401
import pytest

import awkward as ak
from awkward._backends import NumpyBackend, TypeTracerBackend


def test():
layout = ak.to_layout({"x": 1, "y": 1})
assert ak.backend(layout) == "cpu"
assert layout.backend is NumpyBackend.instance()

layout_tt = layout.to_backend("typetracer")
assert ak.backend(layout_tt) == "typetracer"
assert layout_tt.backend is TypeTracerBackend.instance()

with pytest.raises(TypeError):
layout_tt.to_backend("cpu")

0 comments on commit 6b0f46e

Please sign in to comment.