PMEAL / OpenPNM

A Python package for performing pore network modeling of porous media
http://openpnm.org
MIT License
442 stars 175 forks source link

Should plotting functions be moved to a different place? #2547

Closed jgostick closed 2 years ago

jgostick commented 2 years ago

We have tended to use topotools as a bit of a dumping ground for functions that pertain to "network stuff". We have 4-5 plotting functions in there. I'm writing the plotting tutorial and wondering if these could be in a better spot? Not sure where, so any thoughts?

jgostick commented 2 years ago

Putting the functions at the top level comes to mind, like op.plot_coordinates. This would be handy, but misleading maybe since these functions are not meant to be used for heavy-duty visualization.

We could but them on the Network class, like pn.plot_connections. We actually used to have this back in V1, but decided to clean-up the Network namespace. It's not the worst idea to put them back though. But again, as above, it may be misleading.

jgostick commented 2 years ago

The other option would be to create a new module, openpnm.visualization (or openpnm.vis) or openpnm.plots? I feel like there will be more new and powerful visualization options coming in the near future, so perhaps creating this module gets us a head-start on this? For instance, the vispy plot function that was contributed by a user is an example of new plotting functionality that crops up. Also, there was a package called Firefly recently released, and I confirmed that it worked for openpnm with minimal effort.

ma-sadeghi commented 2 years ago

I like the new module approach, it keeps topotools clean and focused, plus like you mentioned, we might want to add more wrappers in the future, so it might as well be its own submodule.