Fix ambiguous Region/Locset expressions (#1629)
- Add a set of test cases to check the behaviour - Remove the function `(nil)` from the the DSL - Remove `nil` and `()` as literals - Add functions `(region-nil)` and `(locset-nil)` Fixes an issue where `join` (and likely `intersect`) would not work due to the fact that `nil` values could not be coerced to `region` or `locset`. This occurred while loading a NML files. While investigating it was found that certain calls, eg `(join () ())` are ambiguous and cannot be resolved without changes in no proportion to the gain. The cause here is that we can resolve `()` as region or a locset and at the same time `join` maps a list of locsets or regions to a locset or region, consequently `(join () ())` can be both. For future reference, in `label_parse.cpp::eval` we look for the first match in the `eval_map` of a function name that can be successfully evaluated. However, this might not be the best match (and the ordering depends on the internal...
Showing
- arbor/morph/locset.cpp 1 addition, 1 deletionarbor/morph/locset.cpp
- arbor/morph/region.cpp 1 addition, 1 deletionarbor/morph/region.cpp
- arborio/label_parse.cpp 4 additions, 5 deletionsarborio/label_parse.cpp
- arborio/parse_helpers.hpp 5 additions, 16 deletionsarborio/parse_helpers.hpp
- doc/concepts/labels.rst 6 additions, 2 deletionsdoc/concepts/labels.rst
- doc/scripts/gen-labels.py 1 addition, 1 deletiondoc/scripts/gen-labels.py
- test/unit/test_s_expr.cpp 82 additions, 0 deletionstest/unit/test_s_expr.cpp
Please register or sign in to comment