jupytext: text_representation: extension: .md format_name: myst format_version: 0.13 jupytext_version: 1.15.0 kernelspec: display_name: Python 3 (ipykernel) language: python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Move option outside record | |
structured = ak.zip( | |
dict(zip( | |
ak.fields(log), | |
ak.unzip(log) | |
)), | |
optiontype_outside_record=True | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE | |
__all__ = ("join",) | |
import awkward as ak | |
from awkward._behavior import behavior_of | |
from awkward._dispatch import high_level_function | |
from awkward._layout import wrap_layout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import awkward as ak | |
import numpy as np | |
import numba as nb | |
@nb.njit() | |
def _strings_in_strings_kernel(needle, haystack): | |
result = np.empty(len(needle), np.bool_) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import types | |
import inspect | |
def impl(x, *, y, z=None): | |
print(x, y, z, "impl") | |
def dispatch(x, y, z): | |
print(x, y, z, "dispatch") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import annotations | |
from collections.abc import Sequence | |
import awkward as ak | |
import numpy as np | |
def _compute_starts(parts: Sequence[ak.contents.Content]) -> tuple[int, ...]: | |
# The following won't work for typetracer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import annotations | |
import vector | |
vector.register_awkward() | |
import awkward as ak | |
import numpy as np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import annotations | |
from functools import wraps | |
from inspect import signature | |
import awkward as ak | |
# Awkward functions that are not public | |
def behavior_of(args) -> dict | None: | |
it = iter(args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sphinx.transforms.post_transforms import SphinxPostTransform | |
from docutils import nodes | |
class HiddenNode(nodes.Element): | |
"""A node that will not be rendered.""" | |
def __init__(self, rawsource="", *children, **attributes): | |
super().__init__("", **attributes) |