Infer ghost_depth and dim from neighbor definition