discretize 0.6.0 Release Notes#
November 16, 2020
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.
Note
Testing now uses Azure CI
Changes#
This is a full list of the aliases and deprecations for this discretize release.
Aliases#
On discretize.base.BaseMesh:
origin=x0n_cells=nCn_nodes=nNn_edges=nEn_faces=nFn_edges_x=nEx,n_edges_y=nEy,n_edges_z=nEzn_faces_x=nFx,n_faces_y=nFy,n_faces_z=nFzn_edges_per_direction=vnE,n_faces_per_direction=vnF
On discretize.base.BaseRectangularMesh:
shape_cells=vnCshape_nodes=vnNshape_edges_x=vnEx,shape_edges_y=vnEy,shape_edges_z=vnEzshape_faces_x=vnFx,shape_faces_y=vnFy,shape_faces_z=vnFz
On discretize.base.BaseTensorMesh:
cell_centers=gridCCnodes=gridNedges_x=gridEx,edges_y=gridEy,edges_z=gridEzfaces_x=gridFx,faces_y=gridFy,faces_z=gridFz
On discretize.operators.DiffOperators:
average_face_to_cell=aveF2CC,average_face_to_cell_vector=aveF2CCVaverage_face_x_to_cell=aveFx2CC,average_face_y_to_cell=aveFy2CC,average_face_z_to_cell=aveFz2CCaverage_cell_to_face=aveCC2F,average_cell_vector_to_face=aveCCV2Faverage_edge_to_cell=aveE2CC,average_edge_to_cell_vector=aveE2CCVaverage_edge_x_to_cell=aveEx2CC,average_edge_y_to_cell=aveEy2CC,average_edge_z_to_cell=aveEz2CCaverage_node_to_cell=aveN2CC,average_node_to_edge=aveN2E,average_node_to_face=aveN2F
On TreeMesh:
Similar to above, all
n_hanging_XXX=nhX, andn_total_XXX=ntX, for eachnode=N,face_x,y,z=Fx,y,z, andedge_x,y,z=Ex,y,zAlso, similar to above:
hanging_XXX=gridhX, for each hangingnode=N,face_x,y,z=Fx,y,zandedge_x,y,z=Ex,y,z
These aliases are consistent across all meshes that inherit from these classes:
discretize.TensorMesh, discretize.CurvilinearMesh, discretize.CylindricalMesh,
and discretize.TreeMesh.
Deprecations#
These deprecations will give FutureWarning when called indicating that they
will be removed in version 1.0.0 of discretize.
Base Classes#
On discretize.base.BaseMesh:
normals→face_normalstangents→edge_tangentsprojectEdgeVector→project_edge_vectorprojectFaceVector→project_face_vector
On discretize.base.BaseRectangularMesh:
r→reshapenCx→shape_cells[0],nCy→shape_cells[1],nCz→shape_cells[2]nNx→shape_nodes[0],nNy→shape_nodes[1],nNz→shape_nodes[2]hx``→``h[0],hy→h[1],hz``→ ``h[2]
On discretize.base.BaseTensorMesh:
vectorNx→nodes_x,vectorNy→nodes_y,vectorNz→nodes_zvectorCCx→cell_centers_x,vectorCCy→cell_centers_y,vectorCCz→cell_centers_zgetInterpolationMat→get_interpolation_matrixisInside→is_insidegetTensor→get_tensor
On discretize.base.MeshIO:
readUBC→read_UBCreadModelUBC→read_model_UBCwriteUBC→write_UBCwriteModelUBC→write_model_UBC
On discretize.operators.DiffOperators:
cellGrad→cell_gradientcellGradBC→cell_gradient_BCcellGradx→cell_gradient_x,cellGrady→cell_gradient_y,cellGradz→cell_gradient_znodalGrad→nodal_gradientnodalLaplacian→nodal_laplacianfaceDiv→face_divergencefaceDivx→face_x_divergence,faceDivy→face_y_divergence,faceDivz→``face_z_divergence``edgeCurl→edge_curlsetCellGradBC→set_cell_gradient_BCgetBCProjWF→get_BC_projectionsgetBCProjWF_simple→get_BC_projections_simple
On discretize.operators.InnerProducts:
getFaceInnerProduct→get_face_inner_productgetEdgeInnerProduct→get_edge_inner_productgetFaceInnerProductDeriv→get_face_inner_product_derivgetEdgeInnerProductDeriv→get_edge_inner_product_deriv
Main Meshes#
CylMesh → CylindricalMesh
On discretize.TensorMesh, discretize.CylindricalMesh, discretize.TreeMesh, discretize.CurvilinearMesh:
vol→cell_volumesarea→face_areasedge→edge_lengths
On discretize.TensorMesh, discretize.CylindricalMesh, discretize.TreeMesh:
areaFx→face_x_areas,areaFy→face_y_areas,areaFz→``face_z_areas``edgeEx→edge_x_lengths,edgeEy→edge_y_lengths,edgeEz→``edge_z_lengths``
On discretize.TensorMesh, discretize.TreeMesh:
faceBoundaryInd→face_boundary_indicescellBoundaryInd→cell_boundary_indices
On discretize.CurvilinearMesh:
* The nodes property is now node_list to avoid the name clash with the nodes location property
On discretize.CylindricalMesh:
isSymmetric→is_symmetriccartesianOrigin→cartesian_origingetInterpolationMatCartMesh→get_interpolation_matrix_cartesian_meshcartesianGrid→cartesian_grid
On discretize.TreeMesh:
maxLevel→max_used_levelpermuteCC→permute_cellspermuteF→permute_facespermuteE→permute_edges
And for plotting with matplotlib:
plotGrid→plot_gridplotImage→plot_imageplotSlice→plot_slice
Utilities deprecations#
Deprecations inside discretize.utils:
isScalar→is_scalarasArray_N_x_Dim→as_array_n_by_dimsdInv→sdinvgetSubArray→get_subarrayinv3X3BlockDiagonal→inverse_3x3_block_diagonalinv2X2BlockDiagonal→inverse_2x2_block_diagonalmakePropertyTensor→make_property_tensorinvPropertyTensor→inverse_property_tensorexampleLrmGrid→example_curvilinear_gridmeshTensor→unpack_widthsclosestPoints→closest_points_indexExtractCoreMesh→extract_core_meshvolTetra→volume_tetrahedronindexCube→index_cubefaceInfo→face_infointerpmat→interpolation_matrixrotationMatrixFromNormals→rotate_points_from_normalsrotatePointsFromNormals→rotation_matrix_from_normals
Contributors#
@jcapriot
With reviews from:
@prisae
@lheagy
Also, input on function names were given by many of the discretize developers.
Pull requests#
#227: Restructure.