TST+BF: properly store fdim, and add doctest
TST+RF: doctest for neighborhood function