PMEAL / porespy

A set of tools for characterizing and analying 3D images of porous materials
https://porespy.org
MIT License
287 stars 97 forks source link

Should funcs return a normal dict instead of a "results" object? #971

Closed jgostick closed 2 hours ago

jgostick commented 2 weeks ago

The results object has attributes attached like result.im_blah, while a dict would be result['im_blah']. The dict is a bit more 'normal' but lacks other custom functionality, like printability.

ma-sadeghi commented 1 week ago

Another "normal" option would be dataclasses

jgostick commented 2 hours ago

We have decided to keep the Results object as the main return container, since they have a "clean" name space, meaning the autocomplete menu only contains the actual attributes, no additional cruft like methods and other meta info. For instance, named tuples have count and index by default and dicts have lots of methods like keys etc. The clean namespace is better to just show only what is relevant.