Skip to content

Commit

Permalink
Merge branch 'main' into pfackeldey/fix_error_stacktraces
Browse files Browse the repository at this point in the history
  • Loading branch information
pfackeldey authored Dec 17, 2024
2 parents b109c93 + b84d8bc commit dc6446e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 107 deletions.
108 changes: 1 addition & 107 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,106 +17,6 @@ env:
SOURCE_DATE_EPOCH: "1668811211"

jobs:
pyodide-python-version:
name: Determine Pyodide Python version
runs-on: ubuntu-22.04
outputs:
python-version: ${{ steps.retrieve-python-version.outputs.python-version }}
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Cache python version
id: cache-pyodide-python-version
uses: actions/cache@v4
with:
path: pyodide-python-version
key: ${{ runner.os }}-docs-pyodide-python-version-${{ hashFiles('docs/requirements-wasm.txt') }}

- name: Setup Python
if: steps.cache-pyodide-python-version.outputs.cache-hit != 'true'
uses: actions/setup-python@v5
with:
python-version: "${{ env.X86_64_PYTHON_VERSION }}"

- name: Install dependencies
if: steps.cache-pyodide-python-version.outputs.cache-hit != 'true'
run: python3 -m pip install -r docs/requirements-wasm.txt

- name: Determine Python version
if: steps.cache-pyodide-python-version.outputs.cache-hit != 'true'
id: compute-python-version
run: |
# Save Python version
PYTHON_VERSION=$(pyodide config get python_version)
echo $PYTHON_VERSION > pyodide-python-version
- name: Retrieve Python version
id: retrieve-python-version
run: |
PYTHON_VERSION=$(cat pyodide-python-version)
echo "python-version=$PYTHON_VERSION" >> "$GITHUB_OUTPUT"
awkward-cpp-wasm:
name: Build C++ WASM
runs-on: ubuntu-22.04
needs: [pyodide-python-version]
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "${{ needs.pyodide-python-version.outputs.python-version }}"

- name: Generate build files
run: pipx run nox -s prepare -- --headers --signatures

- name: Cache wheel
id: cache-awkward-cpp-wasm-wheel
uses: actions/cache@v4
with:
path: ./awkward-cpp/dist
key: ${{ runner.os }}-"${{ needs.pyodide-python-version.outputs.python-version }}-awkward-cpp-wasm-${{ hashFiles('awkward-cpp/**') }}

- name: Install dependencies
if: steps.cache-awkward-cpp-wasm-wheel.outputs.cache-hit != 'true'
run: python3 -m pip install -r docs/requirements-wasm.txt

- name: Determine EMSDK version
if: steps.cache-awkward-cpp-wasm-wheel.outputs.cache-hit != 'true'
id: compute-emsdk-version
run: |
# Prepare xbuild environment (side-effect)
pyodide config list
# Save EMSDK version
EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version)
echo "emsdk-version=$EMSCRIPTEN_VERSION" >> $GITHUB_OUTPUT
working-directory: awkward-cpp

- name: Install EMSDK
uses: mymindstorm/setup-emsdk@v14
if: steps.cache-awkward-cpp-wasm-wheel.outputs.cache-hit != 'true'
with:
version: ${{ steps.compute-emsdk-version.outputs.emsdk-version }}

- name: Build wheel
if: steps.cache-awkward-cpp-wasm-wheel.outputs.cache-hit != 'true'
id: build-awkward-cpp-wasm-wheel
run: |
# pyodide-build doesn't work out of the box with pipx
CFLAGS=-fexceptions LDFLAGS=-fexceptions pyodide build --exports whole_archive
working-directory: awkward-cpp

- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: awkward-cpp-wasm
path: awkward-cpp/dist/awkward*wasm32.whl

awkward-cpp-x86-64:
runs-on: ubuntu-22.04
name: Build C++ x86
Expand Down Expand Up @@ -241,7 +141,7 @@ jobs:

build-docs:
runs-on: ubuntu-22.04
needs: [awkward-cpp-wasm, awkward-cpp-x86-64, awkward, execute-cppyy]
needs: [awkward-cpp-x86-64, awkward, execute-cppyy]
name: Build Docs
defaults:
run:
Expand Down Expand Up @@ -285,12 +185,6 @@ jobs:
mkdir -p docs/lite/pypi/
cp dist/awkward*.whl docs/lite/pypi/
- name: Download & copy awkward-cpp WASM wheel to JupyterLite
uses: actions/download-artifact@v4
with:
name: awkward-cpp-wasm
path: docs/lite/pypi

- name: Download awkward-cpp x86_64 wheel
uses: actions/download-artifact@v4
with:
Expand Down
3 changes: 3 additions & 0 deletions src/awkward/prettyprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ def get_at(data: Content, index: int):


def get_field(data: Content, field: str):
if isinstance(data._layout, ak.record.Record):
if data._layout._array.content(field)._is_getitem_at_placeholder():
return PlaceholderValue()
out = data._layout._getitem_field(field)
if isinstance(out, ak.contents.NumpyArray):
array_param = out.parameter("__array__")
Expand Down
3 changes: 3 additions & 0 deletions tests/test_1447_jax_autodiff_slices_ufuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@

import numpy as np
import pytest
from packaging.version import parse as parse_version

import awkward as ak

jax = pytest.importorskip("jax")
jax.config.update("jax_platform_name", "cpu")
jax.config.update("jax_enable_x64", True)
if parse_version(jax.__version__) >= parse_version("0.4.36"):
jax.config.update("jax_data_dependent_tracing_fallback", True)

ak.jax.register_and_check()

Expand Down

0 comments on commit dc6446e

Please sign in to comment.