Use function lookup table for mass bound check in `amrlib.check_grid`
The list of supported mass coordinates has grown somewhat large in amrlib
. Most of the functions use lookup tables to handle different coordinate systems, which is good for consistency/accuracy (don't repeat yourself) and keeps performance constant (a lookup table has \mathcal{O}(1)
complexity whereas an if/elif/.../elif/else
block is \mathcal{O}(n)
, and makes it much easier to add new coordinate systems (simply insert them into the lookup table).
There is one place that uses a big if/elif/.../elif/else
block, here in amrlib.check_grid
. This needs to be replaced with a lookup table.