Skip to content

Conversation

@dan-k-k
Copy link

@dan-k-k dan-k-k commented Sep 29, 2025

Fixes issue #1498.

This PR resolves a ValueError that occurs when reading branches with a specific type of malformed metadata: a TLeaf that has a fixed dimension in its title (e.g., BranchName[102]) but is also designated as a jagged array via fLeafCount. The original logic in _from_leaves would incorrectly parse the fixed dimension, leading to a crash during data reshaping.

This fix adds a check at the top of the interpretation_of function to specifically detect this pattern. When found, it bypasses the faulty logic and returns a simple jagged array interpretation, allowing the file to be read correctly. This also resolves the issue for many other similarly malformed branches in the test file.

@ariostas
Copy link
Collaborator

Thank you @dan-k-k! It seems like this is a common occurrence, so let's not even bother showing the warning (which is what's causing the tests to fail).

@dan-k-k
Copy link
Author

dan-k-k commented Sep 29, 2025

Done. Thanks for the feedback.

@ianna
Copy link
Collaborator

ianna commented Oct 10, 2025

@dan-k-k - Please, let us know if you are still working on this PR? There are several tests that are failing:

FAILED tests/test_0023_more_interpretations_1.py::test_double32_2 - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0023_more_interpretations_1.py::test_double32_3 - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0034_generic_objects_in_ttrees.py::test_jagged_awkward_1 - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0053_parents_should_not_be_bases.py::test_TRefArray - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0053_parents_should_not_be_bases.py::test_awkward_TRefArray - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0087_memberwise_splitting_not_implemented_messages.py::test_issue510b - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0438_TClonesArray_is_not_AsGrouped.py::test - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0442_regular_TClonesArray.py::test_read_delphes_np - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0442_regular_TClonesArray.py::test_read_delphes_ak - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0610_awkward_form.py::test_awkward_array_tref_array_forth - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_01[False] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_01[True] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_02[False] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_02[True] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_23[False] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_23[True] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_24[False] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_24[True] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_25[False] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_25[True] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_26 - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_27[False] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_27[True] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_28[False] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_28[True] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_30[False] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_30[True] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_51[False] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_51[True] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_52[False] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_52[True] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_53[False] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_53[True] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_54[False] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_0637_setup_tests_for_AwkwardForth.py::test_54[True] - uproot.interpretation.identify.NotNumerical
FAILED tests/test_1114_fix_attempt_to_concatenate_numpy_with_awkward.py::test_partially_fix_issue_951 - uproot.interpretation.identify.NotNumerical
FAILED tests/test_1189_dask_failing_on_duplicate_keys.py::test_dask_duplicated_keys - uproot.interpretation.identify.NotNumerical

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants