Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GridAab & Vol split #489

Closed
6 tasks done
kpreid opened this issue Apr 23, 2024 · 1 comment
Closed
6 tasks done

GridAab & Vol split #489

kpreid opened this issue Apr 23, 2024 · 1 comment
Assignees
Labels
area: data Things related to the data structures underlying the world, and the functions that manipulate them. kind: feature Adding user-facing/developer-facing functionality

Comments

@kpreid
Copy link
Owner

kpreid commented Apr 23, 2024

GridAab, the type of axis-aligned boxes with i32 coordinates, has a volume limit: no GridAab may have a total volume (or number of enclosed cubes) greater than usize::MAX, so that every GridAab may correspond to a linearization into a vector.

This has proven more inconvenient than helpful, because all operations that might construct a larger GridAab have to be fallible, but the volume limit is irrelevant to most of those operations. Therefore, I am splitting it into two types:

  • GridAab will become an arbitrary axis-aligned box. It will no longer have a volume limit, and also will not have any operations related to linearization (other than, maybe, iteration).
  • Vol, which is primarily a container for volume data, can also have no data but still only exist when the volume limit is satisfied, thus serving as a “volume-checked GridAab”.

History and remaining tasks:

  • Create Vol — commit 1128553
  • Remove GridAab::index() — commit d3ba1e7
  • Make GridAab::volume() fallible — commit ac68ecc
  • Check that no remaining users of GridAab — especially .interior_iter() — care about volume.
  • Remove GridAab volume limit — commit 62bc45e
  • Adjust signatures of GridAab methods to be infallible where that is now possible — commit e373374
@kpreid kpreid added kind: feature Adding user-facing/developer-facing functionality area: data Things related to the data structures underlying the world, and the functions that manipulate them. labels Apr 23, 2024
@kpreid kpreid self-assigned this Apr 23, 2024
@kpreid
Copy link
Owner Author

kpreid commented Apr 27, 2024

All done.

@kpreid kpreid closed this as completed Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: data Things related to the data structures underlying the world, and the functions that manipulate them. kind: feature Adding user-facing/developer-facing functionality
Projects
None yet
Development

No branches or pull requests

1 participant