Skip to content

Commit

Permalink
The child of a base-class can be a dispatch-by-version.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpivarski committed Dec 2, 2023
1 parent 158ac58 commit 254cbb0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 7 additions & 3 deletions src/uproot/_awkward_forth.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,13 @@ def derive_form(self):
for child in self._children:
if child.name.startswith("base-class "):
assert len(child._children) == 1
assert child._children[0].name.startswith("start-of-model ")
assert len(child._children[0]._children) == 1
base_form = child._children[0]._children[0].derive_form()
descendant = child._children[0]
if descendant.name.startswith("dispatch-by-version "):
assert len(descendant._children) == 1
descendant = descendant._children[0]
assert descendant.name.startswith("start-of-model ")
assert len(descendant._children) == 1
base_form = descendant._children[0].derive_form()
out["fields"].extend(base_form["fields"])
out["contents"].extend(base_form["contents"])
else:
Expand Down
4 changes: 0 additions & 4 deletions tests/test_0637-setup-tests-for-AwkwardForth.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ def test_07(is_forth):
assert interp._complete_forth_code is not None


# @pytest.mark.skip(reason="AwkwardForth generation not implemented for this case.")
@pytest.mark.parametrize("is_forth", [False, True])
def test_08(is_forth):
# see AwkwardForth testing: A, B, E, P (previously, this hadn't been tested: library="np")
Expand Down Expand Up @@ -486,7 +485,6 @@ def test_10(is_forth):
assert interp._complete_forth_code is not None


@pytest.mark.skip(reason="AwkwardForth generation not implemented for this case.")
@pytest.mark.parametrize("is_forth", [False, True])
def test_11(is_forth):
# see AwkwardForth testing: A, B, E, P
Expand Down Expand Up @@ -537,7 +535,6 @@ def test_11(is_forth):
assert interp._complete_forth_code is not None


@pytest.mark.skip(reason="AwkwardForth generation not implemented for this case.")
@pytest.mark.parametrize("is_forth", [False, True])
def test_12(is_forth):
# see AwkwardForth testing: A, B, E, P
Expand Down Expand Up @@ -586,7 +583,6 @@ def test_12(is_forth):
assert interp._complete_forth_code is not None


@pytest.mark.skip(reason="AwkwardForth generation not implemented for this case.")
@pytest.mark.parametrize("is_forth", [False, True])
def test_13(is_forth):
# see AwkwardForth testing: A, B, E, P
Expand Down

0 comments on commit 254cbb0

Please sign in to comment.