Software Open Access

simpeg/discretize: Discretize restructure

Lindsey Heagy; Joseph Capriotti; Rowan Cockett; Gudni Karl Rosenkjaer; dom; SEOGI KANG; Bane Sullivan; David Marchant; Devin C. Cowan; Dieter Werthmüller; Michael Mitchell; Thibaut Astic; domfournier; Luz Angélica Caudillo Mata; Brendan Smithyman; Franklin Koch; Blue Tyson; Cody; Michael Wathen; Christoph Gohlke

This minor release is intended to bring consistent pep8 style naming across all of discretize's classes and functions.

There are two major types of renaming, aliases and deprecations. We have chosen to move to more descriptive property names for classes, generally. For example, mesh.area is deprecated and now is mesh.face_area. Also properties like mesh.vnC are now officially mesh.shape_cells due to the more descriptive name, but can also be accessed as mesh.vnC to speed up some code writing for users. We have included a full list of aliases and deprecations below. In PR #227 we have detailed our reasonings behind individual name choices.

The other big change that will likely cause previous code to break is that all of these mesh.shape_* type properties are now explicitly tuple-s, making them immutable. These properties could previously be modified which would result in undefined and unsafe behavoir. A side effect of this, is that any code that relied on these properties being numpy.ndarray-s, will break. This is intentional.

There's a few internal changes as well, to reorganize the file structure. importing items in discretize.utils from their individual module files is not recommended and might result in future broken code. Please only import these items from the discretize.utils module.

We have also separated the matplotlib plotting code into a separate module: discretize.utils.mixins.mpl_mod. At the same time we have further improved the plotting speed of discretize.TreeMesh and discretize.CurvilinearMesh. This also allows all of these functions to have a unified calling convention.

Finally, we have removed assert errors in favor of throwing the proper exception when checking inputs. We have removed all references to __future__ and six to clean up and drop python 2 compatibility.


For a full list of deprecations and aliases please visit the release notes in the documentation <a href=>here</a>.

Files (1.1 MB)
Name Size
1.1 MB Download
All versions This version
Views 5,2942,059
Downloads 3574
Data volume 272.6 MB4.3 MB
Unique views 4,9072,035
Unique downloads 804


Cite as