TopoToolbox / pytopotoolbox

Python interface to TopoToolbox
https://topotoolbox.github.io/pytopotoolbox/
GNU General Public License v3.0
1 stars 2 forks source link

Added GridObj generation with OpenSimplex noise #15

Closed Teschl closed 3 months ago

Teschl commented 3 months ago

Useful to better visualize changes when using fillsinks() for example. I used opensimplex to compute the array. I don't think it's necessary to implement Simplex or Perlin noise in libtopotoobox since it's only use is for testing or examples. Nevertheless, I think it's a nice addition to have. opensimplex will not be automatically installed, but the user will be prompted to install it when trying to use topotoolbox.GridObject.gen_random().

We'll probably also need a better name than gen_random since it's not really random.

wkearn commented 3 months ago

Neat! I was thinking about adding some kind of gradient noise generator to the testing apparatus for libtopotoolbox, but I think you are right that it doesn't really make sense to implement it in the library itself at least for now.

Does it make sense to declare opensimplex an optional dependency of the package? This could be useful going forward if we want to have users install a few packages just to run the examples.

Teschl commented 3 months ago

I added the optional dependency to the pyproject.toml and modified the error message when trying to use gen_random() to prompt the user to install with opensimplex. Right now its pip install .[opensimplex]. I think we can go ahead and merge if you want @wkearn.