1
0
Fork
You've already forked mpath
0

Inconsistent shape with repeated comma-separated list selector indices #36

Closed
opened 2026年07月11日 12:40:56 +02:00 by UserCurt · 1 comment

Repeated indices in CSL selectors produce inconsistent shapes.

>> data = struct(a={10, 20});
>> result = mpath.resolve(data, "/a<1,2,1>", MissingPolicy="retain")
result =
 2x1 mpath array
 /a<1>
 /a<2>

The expected result is 3x1, each with the three respective CSL selector indices.

In contrast, having just the index 1 repeated gives the expected result:

>> result = mpath.resolve(data, "/a<1,1>", MissingPolicy="retain")
result =
 2x1 mpath array
 /a<1>
 /a<1>
>> result = mpath.resolve(data, "/a<2,2>", MissingPolicy="retain")
result = 
 mpath: /a<2>

The second case here would expect the same element but repeated as a 2x1.

Repeated indices in CSL selectors produce inconsistent shapes. ```matlab >> data = struct(a={10, 20}); >> result = mpath.resolve(data, "/a<1,2,1>", MissingPolicy="retain") result = 2x1 mpath array /a<1> /a<2> ``` The expected result is 3x1, each with the three respective CSL selector indices. In contrast, having just the index `1` repeated gives the expected result: ```matlab >> result = mpath.resolve(data, "/a<1,1>", MissingPolicy="retain") result = 2x1 mpath array /a<1> /a<1> >> result = mpath.resolve(data, "/a<2,2>", MissingPolicy="retain") result = mpath: /a<2> ``` The second case here would expect the same element but repeated as a 2x1.
Author
Owner
Copy link

Fixed in 5b0dbd.

Fixed in `5b0dbd`.
Sign in to join this conversation.
No Branch/Tag specified
main
dev
functional
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
UserCurt/mpath#36
Reference in a new issue
UserCurt/mpath
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?