Skip to content

Conversation

@chrisrichardson
Copy link
Contributor

Throw a more appropriate error when there is a missing IndexMap in Topology.

Resolves #3844

@schnellerhase
Copy link
Contributor

Should we throw in index_maps right above instead, if maps is empty? Then we get the same interface behaviour for mixed topologies.

@chrisrichardson
Copy link
Contributor Author

I don't think that would be right. It might be that you want to check if there are any IndexMaps of dim(1) or not, without throwing an error.

@schnellerhase
Copy link
Contributor

Then we would have different behaviours between index_map and index_maps, it would be clearer if the behaviour was equivalent up to signature and return type. Even more on the Python side both functions will raise if the entities have not been computed before - #3756 (comment). So, with the new changes index_map would both in Python and C++ raise and index_maps only on the Python side but not in C++.

A quick check also does not show that we functionally rely on being able to check for entities having been computed beforehand main...schnellerhase/test-raise-indexmaps.

@chrisrichardson chrisrichardson added this pull request to the merge queue Aug 16, 2025
Merged via the queue into main with commit 974655a Aug 16, 2025
29 of 30 checks passed
@chrisrichardson chrisrichardson deleted the chris/warn-topo-imap branch August 16, 2025 07:48
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.

Improve refine output when edge entities are not computed

3 participants