diff --git a/discretize/Tests/__init__.py b/discretize/Tests/__init__.py deleted file mode 100644 index 5969ba256..000000000 --- a/discretize/Tests/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -from discretize.tests import * # NOQA F401,F403 -from discretize.utils.code_utils import deprecate_module - -# note this needs to be a module with an __init__ so we can avoid name clash -# with tests.py in the discretize directory on systems that are agnostic to Case. -deprecate_module( - "discretize.Tests", "discretize.tests", removal_version="1.0.0", error=True -) diff --git a/discretize/Tests/meson.build b/discretize/Tests/meson.build deleted file mode 100644 index dac9b559a..000000000 --- a/discretize/Tests/meson.build +++ /dev/null @@ -1,9 +0,0 @@ - -python_sources = [ - '__init__.py', -] - -py.install_sources( - python_sources, - subdir: 'discretize/Tests' -) diff --git a/discretize/View.py b/discretize/View.py deleted file mode 100644 index 0bc0e5df0..000000000 --- a/discretize/View.py +++ /dev/null @@ -1,14 +0,0 @@ -"""Deprecated view module.""" - -from discretize.utils.code_utils import deprecate_module - -deprecate_module( - "discretize.View", - "discretize.mixins.mpl_mod", - removal_version="1.0.0", - error=True, -) -try: - from discretize.mixins.mpl_mod import Slicer # NOQA F401 -except ImportError: - pass diff --git a/discretize/__init__.py b/discretize/__init__.py index 73432f1e7..106d28867 100644 --- a/discretize/__init__.py +++ b/discretize/__init__.py @@ -37,7 +37,7 @@ """ from discretize.tensor_mesh import TensorMesh -from discretize.cylindrical_mesh import CylMesh, CylindricalMesh +from discretize.cylindrical_mesh import CylindricalMesh from discretize.curvilinear_mesh import CurvilinearMesh from discretize.unstructured_mesh import SimplexMesh from discretize.utils.io_utils import load_mesh diff --git a/discretize/base/base_mesh.py b/discretize/base/base_mesh.py index 90fb2e331..be7bc4c6d 100644 --- a/discretize/base/base_mesh.py +++ b/discretize/base/base_mesh.py @@ -6,11 +6,7 @@ import json from scipy.spatial import KDTree from discretize.utils import is_scalar, mkvc, sdiag, sdinv -from discretize.utils.code_utils import ( - deprecate_property, - deprecate_method, - as_array_n_by_dim, -) +from discretize.utils.code_utils import as_array_n_by_dim class BaseMesh: @@ -154,7 +150,7 @@ def deserialize(cls, items, **kwargs): items.pop("__class__", None) return cls(**items) - def save(self, file_name="mesh.json", verbose=False, **kwargs): + def save(self, file_name="mesh.json", verbose=False): """Save the mesh to json. This method is used to save a mesh by writing @@ -168,11 +164,6 @@ def save(self, file_name="mesh.json", verbose=False, **kwargs): verbose : bool, optional If *True*, the path of the json file is printed """ - if "filename" in kwargs: - raise TypeError( - "The filename keyword argument has been removed, please use file_name. " - "This will be removed in discretize 1.0.0" - ) f = os.path.abspath(file_name) # make sure we are working with abs path with open(f, "w") as outfile: json.dump(self.to_dict(), outfile) @@ -4201,70 +4192,3 @@ def _parse_location_type(self, location_type): return "cell_centers" else: return location_type - - # DEPRECATED - normals = deprecate_property( - "face_normals", "normals", removal_version="1.0.0", error=True - ) - tangents = deprecate_property( - "edge_tangents", "tangents", removal_version="1.0.0", error=True - ) - projectEdgeVector = deprecate_method( - "project_edge_vector", - "projectEdgeVector", - removal_version="1.0.0", - error=True, - ) - projectFaceVector = deprecate_method( - "project_face_vector", - "projectFaceVector", - removal_version="1.0.0", - error=True, - ) - getInterpolationMat = deprecate_method( - "get_interpolation_matrix", - "getInterpolationMat", - removal_version="1.0.0", - error=True, - ) - nodalGrad = deprecate_property( - "nodal_gradient", "nodalGrad", removal_version="1.0.0", error=True - ) - nodalLaplacian = deprecate_property( - "nodal_laplacian", "nodalLaplacian", removal_version="1.0.0", error=True - ) - faceDiv = deprecate_property( - "face_divergence", "faceDiv", removal_version="1.0.0", error=True - ) - edgeCurl = deprecate_property( - "edge_curl", "edgeCurl", removal_version="1.0.0", error=True - ) - getFaceInnerProduct = deprecate_method( - "get_face_inner_product", - "getFaceInnerProduct", - removal_version="1.0.0", - error=True, - ) - getEdgeInnerProduct = deprecate_method( - "get_edge_inner_product", - "getEdgeInnerProduct", - removal_version="1.0.0", - error=True, - ) - getFaceInnerProductDeriv = deprecate_method( - "get_face_inner_product_deriv", - "getFaceInnerProductDeriv", - removal_version="1.0.0", - error=True, - ) - getEdgeInnerProductDeriv = deprecate_method( - "get_edge_inner_product_deriv", - "getEdgeInnerProductDeriv", - removal_version="1.0.0", - error=True, - ) - vol = deprecate_property("cell_volumes", "vol", removal_version="1.0.0", error=True) - area = deprecate_property("face_areas", "area", removal_version="1.0.0", error=True) - edge = deprecate_property( - "edge_lengths", "edge", removal_version="1.0.0", error=True - ) diff --git a/discretize/base/base_regular_mesh.py b/discretize/base/base_regular_mesh.py index b4918ccd6..b4e174a39 100644 --- a/discretize/base/base_regular_mesh.py +++ b/discretize/base/base_regular_mesh.py @@ -3,7 +3,6 @@ import numpy as np from discretize.utils import mkvc, Identity from discretize.base.base_mesh import BaseMesh -from discretize.utils.code_utils import deprecate_method class BaseRegularMesh(BaseMesh): @@ -56,11 +55,6 @@ def __init__( shape_cells = kwargs.pop("n") if "x0" in kwargs: origin = kwargs.pop("x0") - axis_u = kwargs.pop("axis_u", None) - axis_v = kwargs.pop("axis_v", None) - axis_w = kwargs.pop("axis_w", None) - if axis_u is not None and axis_v is not None and axis_w is not None: - orientation = np.array([axis_u, axis_v, axis_w]) shape_cells = tuple((int(val) for val in shape_cells)) self._shape_cells = shape_cells @@ -516,66 +510,6 @@ def rotation_matrix(self): """ return self.orientation # np.array([self.axis_u, self.axis_v, self.axis_w]) - @property - def axis_u(self): - """Orientation of the first axis. - - .. deprecated:: 0.7.0 - `axis_u` will be removed in discretize 1.0.0. This functionality was replaced - by the :py:attr:`~.BaseRegularMesh.orientation`. - """ - raise NotImplementedError( - "The axis_u property is rmoved, please access as self.orientation[0]. " - "This will be removed in discretize 1.0.0." - ) - - @axis_u.setter - def axis_u(self, value): - raise NotImplementedError( - "The axis_u property is removed, please access as self.orientation[0]. " - "This will be removed in discretize 1.0.0." - ) - - @property - def axis_v(self): - """Orientation of the second axis. - - .. deprecated:: 0.7.0 - `axis_v` will be removed in discretize 1.0.0. This functionality was replaced - by the :py:attr:`~.BaseRegularMesh.orientation`. - """ - raise NotImplementedError( - "The axis_v property is removed, please access as self.orientation[1]. " - "This will be removed in discretize 1.0.0." - ) - - @axis_v.setter - def axis_v(self, value): - raise NotImplementedError( - "The axis_v property is removed, please access as self.orientation[1]. " - "This will be removed in discretize 1.0.0." - ) - - @property - def axis_w(self): - """Orientation of the third axis. - - .. deprecated:: 0.7.0 - `axis_w` will be removed in discretize 1.0.0. This functionality was replaced - by the :py:attr:`~.BaseRegularMesh.orientation`. - """ - raise NotImplementedError( - "The axis_w property is removed, please access as self.orientation[2]. " - "This will be removed in discretize 1.0.0." - ) - - @axis_w.setter - def axis_w(self, value): - raise NotImplementedError( - "The axis_w property is removed, please access as self.orientation[2]. " - "This will be removed in discretize 1.0.0." - ) - class BaseRectangularMesh(BaseRegularMesh): """Base rectangular mesh class for the ``discretize`` package. @@ -820,7 +754,6 @@ def reshape( x_type="cell_centers", out_type="cell_centers", return_format="V", - **kwargs, ): """Reshape tensor quantities. @@ -849,24 +782,6 @@ def reshape( - *M:* return matrix (nD array) or a list of matrices """ - if "xType" in kwargs: - raise TypeError( - "The xType keyword argument has been removed, please use x_type. " - "This will be removed in discretize 1.0.0" - ) - x_type = kwargs["xType"] - if "outType" in kwargs: - raise TypeError( - "The outType keyword argument has been removed, please use out_type. " - "This will be removed in discretize 1.0.0", - ) - if "format" in kwargs: - raise TypeError( - "The format keyword argument has been removed, please use return_format. " - "This will be removed in discretize 1.0.0", - ) - return_format = kwargs["format"] - x_type = self._parse_location_type(x_type) out_type = self._parse_location_type(out_type) @@ -998,78 +913,3 @@ def switchKernal(xx): return out else: return switchKernal(x) - - # DEPRECATED - r = deprecate_method("reshape", "r", removal_version="1.0.0", error=True) - - @property - def nCx(self): - """Number of cells in the x direction. - - `nCx` will be removed in discretize 1.0.0, it is replaced by - `mesh.shape_cells[0]` to reduce namespace clutter. - """ - raise NotImplementedError( - "The nCx property is removed, please access as mesh.shape_cells[0]. " - "This message will be removed in discretize 1.0.0." - ) - - @property - def nCy(self): - """Number of cells in the y direction. - - `nCy` will be removed in discretize 1.0.0, it is replaced by - `mesh.shape_cells[1]` to reduce namespace clutter. - """ - raise NotImplementedError( - "The nCy property is removed, please access as mesh.shape_cells[1]. " - "This message will be removed in discretize 1.0.0." - ) - - @property - def nCz(self): - """Number of cells in the z direction. - - `nCz` will be removed in discretize 1.0.0, it is replaced by - `mesh.shape_cells[2]` to reduce namespace clutter. - """ - raise NotImplementedError( - "The nCz property is removed, please access as mesh.shape_cells[2]. " - "This message will be removed in discretize 1.0.0." - ) - - @property - def nNx(self): - """Number of nodes in the x-direction. - - `nNx` will be removed in discretize 1.0.0, it is replaced by - `mesh.shape_nodes[0]` to reduce namespace clutter. - """ - raise NotImplementedError( - "The nNx property is removed, please access as mesh.shape_nodes[0]. " - "This message will be removed in discretize 1.0.0." - ) - - @property - def nNy(self): - """Number of nodes in the y-direction. - - `nNy` will be removed in discretize 1.0.0, it is replaced by - `mesh.shape_nodes[1]` to reduce namespace clutter. - """ - raise NotImplementedError( - "The nNy property is removed, please access as mesh.shape_nodes[1]. " - "This message will be removed in discretize 1.0.0." - ) - - @property - def nNz(self): - """Number of nodes in the z-direction. - - `nNz` will be removed in discretize 1.0.0, it is replaced by - `mesh.shape_nodes[2]` to reduce namespace clutter. - """ - raise NotImplementedError( - "The nNz property is removed, please access as mesh.shape_nodes[2]. " - "This message will be removed in discretize 1.0.0." - ) diff --git a/discretize/base/base_tensor_mesh.py b/discretize/base/base_tensor_mesh.py index 58375b19c..f57f6ff3b 100644 --- a/discretize/base/base_tensor_mesh.py +++ b/discretize/base/base_tensor_mesh.py @@ -17,7 +17,6 @@ interpolation_matrix, make_boundary_bool, ) -from discretize.utils.code_utils import deprecate_method, deprecate_property import warnings @@ -635,7 +634,7 @@ def get_tensor(self, key): # --------------- Methods --------------------- - def is_inside(self, pts, location_type="nodes", **kwargs): + def is_inside(self, pts, location_type="nodes"): """Determine which points lie within the mesh. For an arbitrary set of points, **is_indside** returns a @@ -656,11 +655,6 @@ def is_inside(self, pts, location_type="nodes", **kwargs): Boolean array identifying points which lie within the mesh """ - if "locType" in kwargs: - raise TypeError( - "The locType keyword argument has been removed, please use location_type. " - "This will be removed in discretize 1.0.0", - ) pts = as_array_n_by_dim(pts, self.dim) tensors = self.get_tensor(location_type) @@ -774,19 +768,9 @@ def _get_interpolation_matrix( return Q.tocsr() def get_interpolation_matrix( # NOQA D102 - self, loc, location_type="cell_centers", zeros_outside=False, **kwargs + self, loc, location_type="cell_centers", zeros_outside=False ): # Documentation inherited from discretize.base.BaseMesh - if "locType" in kwargs: - raise TypeError( - "The locType keyword argument has been removed, please use location_type. " - "This will be removed in discretize 1.0.0", - ) - if "zerosOutside" in kwargs: - raise TypeError( - "The zerosOutside keyword argument has been removed, please use zeros_outside. " - "This will be removed in discretize 1.0.0", - ) return self._get_interpolation_matrix(loc, location_type, zeros_outside) def _fastInnerProduct( @@ -986,65 +970,3 @@ def innerProductDeriv(v=None): return innerProductDeriv else: return None - - # DEPRECATED - @property - def hx(self): - """Width of cells in the x direction. - - `hx` will be removed in discretize 1.0.0, it is replaced by - `mesh.h[0]` to reduce namespace clutter. - """ - raise NotImplementedError( - "The hx property is removed, please access as mesh.h[0]. " - "This message will be removed in discretize 1.0.0." - ) - - @property - def hy(self): - """Width of cells in the y direction. - - `hy` will be removed in discretize 1.0.0, it is replaced by - `mesh.h[1]` to reduce namespace clutter. - """ - raise NotImplementedError( - "The hy property is removed, please access as mesh.h[1]. " - "This message will be removed in discretize 1.0.0." - ) - - @property - def hz(self): - """Width of cells in the z direction. - - `hz` will be removed in discretize 1.0.0, it is replaced by - `mesh.h[2]` to reduce namespace clutter. - """ - raise NotImplementedError( - "The hz property is removed, please access as mesh.h[2]. " - "This message will be removed in discretize 1.0.0." - ) - - vectorNx = deprecate_property( - "nodes_x", "vectorNx", removal_version="1.0.0", error=True - ) - vectorNy = deprecate_property( - "nodes_y", "vectorNy", removal_version="1.0.0", error=True - ) - vectorNz = deprecate_property( - "nodes_z", "vectorNz", removal_version="1.0.0", error=True - ) - vectorCCx = deprecate_property( - "cell_centers_x", "vectorCCx", removal_version="1.0.0", error=True - ) - vectorCCy = deprecate_property( - "cell_centers_y", "vectorCCy", removal_version="1.0.0", error=True - ) - vectorCCz = deprecate_property( - "cell_centers_z", "vectorCCz", removal_version="1.0.0", error=True - ) - isInside = deprecate_method( - "is_inside", "isInside", removal_version="1.0.0", error=True - ) - getTensor = deprecate_method( - "get_tensor", "getTensor", removal_version="1.0.0", error=True - ) diff --git a/discretize/cylindrical_mesh.py b/discretize/cylindrical_mesh.py index 4e84e1c54..c1cf27d92 100644 --- a/discretize/cylindrical_mesh.py +++ b/discretize/cylindrical_mesh.py @@ -21,11 +21,6 @@ from discretize.base import BaseTensorMesh, BaseRectangularMesh from discretize.operators import DiffOperators, InnerProducts from discretize.mixins import InterfaceMixins -from discretize.utils.code_utils import ( - deprecate_class, - deprecate_property, - deprecate_method, -) class CylindricalMesh( @@ -133,8 +128,6 @@ class CylindricalMesh( def __init__(self, h, origin=None, cartesian_origin=None, **kwargs): kwargs.pop("reference_system", None) # reference system must be cylindrical - if "cartesianOrigin" in kwargs.keys(): - cartesian_origin = kwargs.pop("cartesianOrigin") super().__init__(h=h, origin=origin, reference_system="cylindrical", **kwargs) if self.h[1].sum() > 2 * np.pi + 1e-10: @@ -1764,7 +1757,10 @@ def _deflation_matrix(self, location, as_ones=False): #################################################### def get_interpolation_matrix( - self, loc, location_type="cell_centers", zeros_outside=False, **kwargs + self, + loc, + location_type="cell_centers", + zeros_outside=False, ): r"""Construct interpolation matrix from mesh. @@ -1804,17 +1800,6 @@ def get_interpolation_matrix( The interpolation matrix """ - if "locType" in kwargs: - raise TypeError( - "The locType keyword argument has been removed, please use location_type. " - "This will be removed in discretize 1.0.0" - ) - if "zerosOutside" in kwargs: - raise TypeError( - "The zerosOutside keyword argument has been removed, please use zeros_outside. " - "This will be removed in discretize 1.0.0" - ) - location_type = self._parse_location_type(location_type) if self.is_symmetric and location_type in ["edges_x", "edges_z", "faces_y"]: raise ValueError( @@ -2019,7 +2004,7 @@ def get_interpolation_matrix( Q[~self.is_inside(loc), :] = 0 return Q - def cartesian_grid(self, location_type="cell_centers", theta_shift=None, **kwargs): + def cartesian_grid(self, location_type="cell_centers", theta_shift=None): """Return the specified grid in cartesian coordinates. Takes a grid location ('CC', 'N', 'Ex', 'Ey', 'Ez', 'Fx', 'Fy', 'Fz') @@ -2037,11 +2022,6 @@ def cartesian_grid(self, location_type="cell_centers", theta_shift=None, **kwarg (n_items, dim) numpy.ndarray cartesian coordinates for the cylindrical grid """ - if "locType" in kwargs: - raise TypeError( - "The locType keyword argument has been removed, please use location_type. " - "This will be removed in discretize 1.0.0" - ) try: grid = getattr(self, location_type).copy() except AttributeError: @@ -2051,7 +2031,10 @@ def cartesian_grid(self, location_type="cell_centers", theta_shift=None, **kwarg return cyl2cart(grid) # TODO: account for cartesian origin def get_interpolation_matrix_cartesian_mesh( - self, Mrect, location_type="cell_centers", location_type_to=None, **kwargs + self, + Mrect, + location_type="cell_centers", + location_type_to=None, ): """Construct projection matrix from ``CylindricalMesh`` to other mesh. @@ -2079,17 +2062,6 @@ def get_interpolation_matrix_cartesian_mesh( interpolation matrix from gridded locations on cylindrical mesh to gridded locations on another mesh """ - if "locType" in kwargs: - raise TypeError( - "The locType keyword argument has been removed, please use location_type. " - "This will be removed in discretize 1.0.0" - ) - if "locTypeTo" in kwargs: - raise TypeError( - "The locTypeTo keyword argument has been removed, please use location_type_to. " - "This will be removed in discretize 1.0.0" - ) - location_type = self._parse_location_type(location_type) if not self.is_symmetric: @@ -2168,45 +2140,3 @@ def get_interpolation_matrix_cartesian_mesh( Pc2r = self.get_interpolation_matrix(G, interp_type) Proj = sdiag(proj) return Proj * Pc2r - - # DEPRECATIONS - areaFx = deprecate_property( - "face_x_areas", "areaFx", removal_version="1.0.0", error=True - ) - areaFy = deprecate_property( - "face_y_areas", "areaFy", removal_version="1.0.0", error=True - ) - areaFz = deprecate_property( - "face_z_areas", "areaFz", removal_version="1.0.0", error=True - ) - edgeEx = deprecate_property( - "edge_x_lengths", "edgeEx", removal_version="1.0.0", error=True - ) - edgeEy = deprecate_property( - "edge_y_lengths", "edgeEy", removal_version="1.0.0", error=True - ) - edgeEz = deprecate_property( - "edge_z_lengths", "edgeEz", removal_version="1.0.0", error=True - ) - isSymmetric = deprecate_property( - "is_symmetric", "isSymmetric", removal_version="1.0.0", error=True - ) - cartesianOrigin = deprecate_property( - "cartesian_origin", "cartesianOrigin", removal_version="1.0.0", error=True - ) - getInterpolationMatCartMesh = deprecate_method( - "get_interpolation_matrix_cartesian_mesh", - "getInterpolationMatCartMesh", - removal_version="1.0.0", - error=True, - ) - cartesianGrid = deprecate_method( - "cartesian_grid", "cartesianGrid", removal_version="1.0.0", error=True - ) - - -@deprecate_class(removal_version="1.0.0", error=True) -class CylMesh(CylindricalMesh): - """Deprecated calling of `discretize.CylindricalMesh`.""" - - pass diff --git a/discretize/meson.build b/discretize/meson.build index 8fb7aa2d9..41b228aca 100644 --- a/discretize/meson.build +++ b/discretize/meson.build @@ -8,7 +8,6 @@ python_sources = [ 'tests.py', 'tree_mesh.py', 'unstructured_mesh.py', - 'View.py', ] py.install_sources( @@ -21,4 +20,3 @@ subdir('_extensions') subdir('mixins') subdir('operators') subdir('utils') -subdir('Tests') diff --git a/discretize/mixins/mesh_io.py b/discretize/mixins/mesh_io.py index 947eec959..742ed12e5 100644 --- a/discretize/mixins/mesh_io.py +++ b/discretize/mixins/mesh_io.py @@ -7,7 +7,6 @@ import numpy as np from discretize.utils import mkvc -from discretize.utils.code_utils import deprecate_method try: from discretize.mixins.vtk_mod import ( @@ -415,31 +414,6 @@ def write_UBC(mesh, file_name, models=None, directory=None, comment_lines=""): ) mesh.write_model_UBC(key, models[key], directory=directory) - # DEPRECATED - @classmethod - def readUBC(TensorMesh, file_name, directory=""): - """Read 2D or 3D tensor mesh from UBC-GIF formatted file. - - *readUBC* has been deprecated and replaced by *read_UBC* - See Also - -------- - read_UBC - """ - raise NotImplementedError( - "TensorMesh.readUBC has been removed and this be removed in" - "discretize 1.0.0. please use TensorMesh.read_UBC", - ) - - readModelUBC = deprecate_method( - "read_model_UBC", "readModelUBC", removal_version="1.0.0", error=True - ) - writeUBC = deprecate_method( - "write_UBC", "writeUBC", removal_version="1.0.0", error=True - ) - writeModelUBC = deprecate_method( - "write_model_UBC", "writeModelUBC", removal_version="1.0.0", error=True - ) - class TreeMeshIO(object): """Class for managing the input/output of tree meshes and models. @@ -610,32 +584,6 @@ def write_model_UBC(mesh, file_name, model, directory=None): m = model[ubc_order] np.savetxt(fname, m) - # DEPRECATED - @classmethod - def readUBC(TreeMesh, file_name, directory=""): - """Read 3D Tree mesh from UBC-GIF formatted file. - - *readUBC* has been deprecated and replaced by *read_UBC* - - See Also - -------- - read_UBC - """ - raise NotImplementedError( - "TensorMesh.readUBC has been removed and this be removed in" - "discretize 1.0.0. please use TensorMesh.read_UBC", - ) - - readModelUBC = deprecate_method( - "read_model_UBC", "readModelUBC", removal_version="1.0.0", error=True - ) - writeUBC = deprecate_method( - "write_UBC", "writeUBC", removal_version="1.0.0", error=True - ) - writeModelUBC = deprecate_method( - "write_model_UBC", "writeModelUBC", removal_version="1.0.0", error=True - ) - class SimplexMeshIO(InterfaceSimplexReadVTK): """Empty class for future text based IO of a SimplexMesh.""" diff --git a/discretize/mixins/mpl_mod.py b/discretize/mixins/mpl_mod.py index c58fda18a..753f5577f 100644 --- a/discretize/mixins/mpl_mod.py +++ b/discretize/mixins/mpl_mod.py @@ -3,7 +3,6 @@ import numpy as np import warnings from discretize.utils import mkvc, ndgrid -from discretize.utils.code_utils import deprecate_method import discretize @@ -162,14 +161,6 @@ def plot_grid( ) ) - if "showIt" in kwargs: - show_it = kwargs.pop("showIt") - warnings.warn( - "showIt has been deprecated, please use show_it", - FutureWarning, - stacklevel=2, - ) - if ax is not None: ax_test = ax if not isinstance(ax, (list, tuple, np.ndarray)): @@ -303,42 +294,6 @@ def plot_image( ) ) - if "pcolorOpts" in kwargs: - pcolor_opts = kwargs.pop("pcolorOpts") - warnings.warn( - "pcolorOpts has been deprecated, please use pcolor_opts", - FutureWarning, - stacklevel=2, - ) - if "streamOpts" in kwargs: - stream_opts = kwargs.pop("streamOpts") - warnings.warn( - "streamOpts has been deprecated, please use stream_opts", - FutureWarning, - stacklevel=2, - ) - if "gridOpts" in kwargs: - grid_opts = kwargs.pop("gridOpts") - warnings.warn( - "gridOpts has been deprecated, please use grid_opts", - FutureWarning, - stacklevel=2, - ) - if "showIt" in kwargs: - show_it = kwargs.pop("showIt") - warnings.warn( - "showIt has been deprecated, please use show_it", - FutureWarning, - stacklevel=2, - ) - if "vType" in kwargs: - v_type = kwargs.pop("vType") - warnings.warn( - "vType has been deprecated, please use v_type", - FutureWarning, - stacklevel=2, - ) - # Some Error checking and common defaults if pcolor_opts is None: pcolor_opts = {} @@ -547,41 +502,6 @@ def plot_slice( ) normal = normal.upper() - if "pcolorOpts" in kwargs: - pcolor_opts = kwargs["pcolorOpts"] - warnings.warn( - "pcolorOpts has been deprecated, please use pcolor_opts", - FutureWarning, - stacklevel=2, - ) - if "streamOpts" in kwargs: - stream_opts = kwargs["streamOpts"] - warnings.warn( - "streamOpts has been deprecated, please use stream_opts", - FutureWarning, - stacklevel=2, - ) - if "gridOpts" in kwargs: - grid_opts = kwargs["gridOpts"] - warnings.warn( - "gridOpts has been deprecated, please use grid_opts", - FutureWarning, - stacklevel=2, - ) - if "showIt" in kwargs: - show_it = kwargs["showIt"] - warnings.warn( - "showIt has been deprecated, please use show_it", - FutureWarning, - stacklevel=2, - ) - if "vType" in kwargs: - v_type = kwargs["vType"] - warnings.warn( - "vType has been deprecated, please use v_type", - FutureWarning, - stacklevel=2, - ) if pcolor_opts is None: pcolor_opts = {} if stream_opts is None: @@ -761,14 +681,6 @@ def plot_3d_slicer( else: fig.clf() - if "pcolorOpts" in kwargs: - pcolor_opts = kwargs["pcolorOpts"] - warnings.warn( - "pcolorOpts has been deprecated, please use pcolor_opts", - FutureWarning, - stacklevel=2, - ) - # Populate figure tracker = Slicer( self, @@ -1036,14 +948,6 @@ def __plot_image_tensor( stream_threshold=None, **kwargs, ): - if "annotationColor" in kwargs: - annotation_color = kwargs.pop("annotationColor") - warnings.warn( - "annotationColor has been deprecated, please use annotation_color", - FutureWarning, - stacklevel=2, - ) - if self.dim == 1: if v_type == "CC": ph = ax.plot( @@ -2350,16 +2254,6 @@ def __plot_image_simp( return out - plotGrid = deprecate_method( - "plot_grid", "plotGrid", removal_version="1.0.0", future_warn=True - ) - plotImage = deprecate_method( - "plot_image", "plotImage", removal_version="1.0.0", future_warn=True - ) - plotSlice = deprecate_method( - "plot_slice", "plotSlice", removal_version="1.0.0", future_warn=True - ) - class Slicer(object): """Plot slices of a 3D volume, interactively (scroll wheel). @@ -2447,22 +2341,12 @@ def __init__( aspect="auto", grid=(2, 2, 1), pcolor_opts=None, - **kwargs, ): """Initialize interactive figure.""" _, plt = load_matplotlib() from matplotlib.widgets import Slider # Lazy loaded from matplotlib.colors import Normalize - # 0. Some checks, not very extensive - if "pcolorOpts" in kwargs: - pcolor_opts = kwargs["pcolorOpts"] - warnings.warn( - "pcolorOpts has been deprecated, please use pcolor_opts", - FutureWarning, - stacklevel=2, - ) - # Add pcolor_opts to self self.pc_props = pcolor_opts if pcolor_opts is not None else {} diff --git a/discretize/mixins/vtk_mod.py b/discretize/mixins/vtk_mod.py index 82a54817f..aaba082ad 100644 --- a/discretize/mixins/vtk_mod.py +++ b/discretize/mixins/vtk_mod.py @@ -625,22 +625,6 @@ def to_vtk(mesh, models=None): ) return cvtd - def toVTK(mesh, models=None): - """Convert mesh (and models) to corresponding VTK or PyVista data object. - - *toVTK* has been deprecated and replaced by *to_vtk*. - - See Also - -------- - to_vtk - """ - warnings.warn( - "Deprecation Warning: `toVTK` is deprecated, use `to_vtk` instead", - category=FutureWarning, - stacklevel=2, - ) - return InterfaceVTK.to_vtk(mesh, models=models) - @staticmethod def _save_unstructured_grid(file_name, vtkUnstructGrid, directory=""): """Save an unstructured grid to a vtk file. @@ -787,24 +771,6 @@ def write_vtk(mesh, file_name, models=None, directory=""): raise RuntimeError("VTK data type `%s` is not currently supported." % key) return write(file_name, vtkObj, directory=directory) - def writeVTK(mesh, file_name, models=None, directory=""): - """Convert mesh (and models) to corresponding VTK or PyVista data object then writes to file. - - *writeVTK* has been deprecated and replaced by *write_vtk* - - See Also - -------- - write_vtk - """ - warnings.warn( - "Deprecation Warning: `writeVTK` is deprecated, use `write_vtk` instead", - category=FutureWarning, - stacklevel=2, - ) - return InterfaceVTK.write_vtk( - mesh, file_name, models=models, directory=directory - ) - class InterfaceTensorread_vtk(object): """Mixin class for converting vtk to TensorMesh. @@ -899,25 +865,6 @@ def read_vtk(TensorMesh, file_name, directory=""): vtrGrid = vtrReader.GetOutput() return TensorMesh.vtk_to_tensor_mesh(vtrGrid) - @classmethod - def readVTK(TensorMesh, file_name, directory=""): - """Read VTK rectilinear file (vtr or xml) and return a discretize tensor mesh (and models). - - *readVTK* has been deprecated and replaced by *read_vtk* - - See Also - -------- - read_vtk - """ - warnings.warn( - "Deprecation Warning: `readVTK` is deprecated, use `read_vtk` instead", - category=FutureWarning, - stacklevel=2, - ) - return InterfaceTensorread_vtk.read_vtk( - TensorMesh, file_name, directory=directory - ) - class InterfaceSimplexReadVTK: """Mixin class for converting vtk to SimplexMesh. diff --git a/discretize/operators/differential_operators.py b/discretize/operators/differential_operators.py index a7dbbdaad..bda3954c0 100644 --- a/discretize/operators/differential_operators.py +++ b/discretize/operators/differential_operators.py @@ -15,7 +15,6 @@ make_boundary_bool, cross2d, ) -from discretize.utils.code_utils import deprecate_method, deprecate_property def _validate_BC(bc): @@ -1730,35 +1729,6 @@ def cell_gradient_weak_form_robin(self, alpha=0.0, beta=1.0, gamma=0.0): return A, b - @property - def cell_gradient_BC(self): - """Boundary conditions matrix for the cell gradient operator (Deprecated).""" - warnings.warn( - "cell_gradient_BC is deprecated and is not longer used. See cell_gradient", - stacklevel=2, - ) - if getattr(self, "_cell_gradient_BC", None) is None: - BC = self.set_cell_gradient_BC(self._cell_gradient_BC_list) - n = self.vnC - if self.dim == 1: - G = _ddxCellGradBC(n[0], BC[0]) - elif self.dim == 2: - G1 = sp.kron(speye(n[1]), _ddxCellGradBC(n[0], BC[0])) - G2 = sp.kron(_ddxCellGradBC(n[1], BC[1]), speye(n[0])) - G = sp.block_diag((G1, G2), format="csr") - elif self.dim == 3: - G1 = kron3(speye(n[2]), speye(n[1]), _ddxCellGradBC(n[0], BC[0])) - G2 = kron3(speye(n[2]), _ddxCellGradBC(n[1], BC[1]), speye(n[0])) - G3 = kron3(_ddxCellGradBC(n[2], BC[2]), speye(n[1]), speye(n[0])) - G = sp.block_diag((G1, G2, G3), format="csr") - # Compute areas of cell faces & volumes - S = self.face_areas - V = ( - self.aveCC2F * self.cell_volumes - ) # Average volume between adjacent cells - self._cell_gradient_BC = sdiag(S / V) * G - return self._cell_gradient_BC - @property def cell_gradient_x(self): r"""X-derivative operator (cell centers to x-faces). @@ -3426,69 +3396,3 @@ def project_node_to_boundary_node(self): # NOQA D102 is_b = make_boundary_bool(self.shape_nodes) return sp.eye(self.n_nodes, format="csr")[is_b] - - # DEPRECATED - cellGrad = deprecate_property( - "cell_gradient", "cellGrad", removal_version="1.0.0", error=True - ) - cellGradBC = deprecate_property( - "cell_gradient_BC", "cellGradBC", removal_version="1.0.0", error=True - ) - cellGradx = deprecate_property( - "cell_gradient_x", "cellGradx", removal_version="1.0.0", error=True - ) - cellGrady = deprecate_property( - "cell_gradient_y", "cellGrady", removal_version="1.0.0", error=True - ) - cellGradz = deprecate_property( - "cell_gradient_z", "cellGradz", removal_version="1.0.0", error=True - ) - faceDivx = deprecate_property( - "face_x_divergence", "faceDivx", removal_version="1.0.0", error=True - ) - faceDivy = deprecate_property( - "face_y_divergence", "faceDivy", removal_version="1.0.0", error=True - ) - faceDivz = deprecate_property( - "face_z_divergence", "faceDivz", removal_version="1.0.0", error=True - ) - _cellGradStencil = deprecate_property( - "stencil_cell_gradient", - "_cellGradStencil", - removal_version="1.0.0", - error=True, - ) - _cellGradxStencil = deprecate_property( - "stencil_cell_gradient_x", - "_cellGradxStencil", - removal_version="1.0.0", - error=True, - ) - _cellGradyStencil = deprecate_property( - "stencil_cell_gradient_y", - "_cellGradyStencil", - removal_version="1.0.0", - error=True, - ) - _cellGradzStencil = deprecate_property( - "stencil_cell_gradient_z", - "_cellGradzStencil", - removal_version="1.0.0", - error=True, - ) - - setCellGradBC = deprecate_method( - "set_cell_gradient_BC", - "setCellGradBC", - removal_version="1.0.0", - error=True, - ) - getBCProjWF = deprecate_method( - "get_BC_projections", "getBCProjWF", removal_version="1.0.0", error=True - ) - getBCProjWF_simple = deprecate_method( - "get_BC_projections_simple", - "getBCProjWF_simple", - removal_version="1.0.0", - error=True, - ) diff --git a/discretize/operators/inner_products.py b/discretize/operators/inner_products.py index eb5976391..c24188389 100644 --- a/discretize/operators/inner_products.py +++ b/discretize/operators/inner_products.py @@ -38,26 +38,8 @@ def get_face_inner_product( # NOQA D102 invert_model=False, invert_matrix=False, do_fast=True, - **kwargs, ): # Inherited documentation from discretize.base.BaseMesh - if "invProp" in kwargs: - raise TypeError( - "The invProp keyword argument has been removed, please use invert_model. " - "This will be removed in discretize 1.0.0", - ) - if "invMat" in kwargs: - raise TypeError( - "The invMat keyword argument has been removed, please use invert_matrix. " - "This will be removed in discretize 1.0.0", - ) - if "doFast" in kwargs: - raise TypeError( - "The doFast keyword argument has been removed, please use do_fast. " - "This will be removed in discretize 1.0.0", - ) - do_fast = kwargs["doFast"] - return self._getInnerProduct( "F", model=model, @@ -72,24 +54,8 @@ def get_edge_inner_product( # NOQA D102 invert_model=False, invert_matrix=False, do_fast=True, - **kwargs, ): # Inherited documentation from discretize.base.BaseMesh - if "invProp" in kwargs: - raise TypeError( - "The invProp keyword argument has been removed, please use invert_model. " - "This will be removed in discretize 1.0.0", - ) - if "invMat" in kwargs: - raise TypeError( - "The invMat keyword argument has been removed, please use invert_matrix. " - "This will be removed in discretize 1.0.0", - ) - if "doFast" in kwargs: - raise TypeError( - "The doFast keyword argument has been removed, please use do_fast. " - "This will be removed in discretize 1.0.0", - ) return self._getInnerProduct( "E", model=model, @@ -151,7 +117,6 @@ def _getInnerProduct( invert_model=False, invert_matrix=False, do_fast=True, - **kwargs, ): """Get the inner product matrix. @@ -173,21 +138,6 @@ def _getInnerProduct( scipy.sparse.csr_matrix M, the inner product matrix (nE, nE) """ - if "invProp" in kwargs: - raise TypeError( - "The invProp keyword argument has been removed, please use invert_model. " - "This will be removed in discretize 1.0.0", - ) - if "invMat" in kwargs: - raise TypeError( - "The invMat keyword argument has been removed, please use invert_matrix. " - "This will be removed in discretize 1.0.0", - ) - if "doFast" in kwargs: - raise TypeError( - "The doFast keyword argument has been removed, please use do_fast. " - "This will be removed in discretize 1.0.0", - ) if projection_type not in ["F", "E"]: raise TypeError("projection_type must be 'F' for faces or 'E' for edges") @@ -272,24 +222,9 @@ def _getInnerProductProjectionMatrices(self, projection_type, tensorType): return [V * proj(*locs[node][d - 1]) for node in nodes] def get_face_inner_product_deriv( # NOQA D102 - self, model, do_fast=True, invert_model=False, invert_matrix=False, **kwargs + self, model, do_fast=True, invert_model=False, invert_matrix=False ): # Inherited documentation from discretize.base.BaseMesh - if "invProp" in kwargs: - raise TypeError( - "The invProp keyword argument has been removed, please use invert_model. " - "This will be removed in discretize 1.0.0", - ) - if "invMat" in kwargs: - raise TypeError( - "The invMat keyword argument has been removed, please use invert_matrix. " - "This will be removed in discretize 1.0.0", - ) - if "doFast" in kwargs: - raise TypeError( - "The doFast keyword argument has been removed, please use do_fast. " - "This will be removed in discretize 1.0.0", - ) return self._getInnerProductDeriv( model, "F", @@ -299,24 +234,9 @@ def get_face_inner_product_deriv( # NOQA D102 ) def get_edge_inner_product_deriv( # NOQA D102 - self, model, do_fast=True, invert_model=False, invert_matrix=False, **kwargs + self, model, do_fast=True, invert_model=False, invert_matrix=False ): # Inherited documentation from discretize.base.BaseMesh - if "invProp" in kwargs: - raise TypeError( - "The invProp keyword argument has been removed, please use invert_model. " - "This will be removed in discretize 1.0.0", - ) - if "invMat" in kwargs: - raise TypeError( - "The invMat keyword argument has been removed, please use invert_matrix. " - "This will be removed in discretize 1.0.0", - ) - if "doFast" in kwargs: - raise TypeError( - "The doFast keyword argument has been removed, please use do_fast. " - "This will be removed in discretize 1.0.0", - ) return self._getInnerProductDeriv( model, "E", diff --git a/discretize/tensor_mesh.py b/discretize/tensor_mesh.py index c8ddb3278..f0b2694b9 100644 --- a/discretize/tensor_mesh.py +++ b/discretize/tensor_mesh.py @@ -7,7 +7,6 @@ from discretize.operators import DiffOperators, InnerProducts from discretize.mixins import InterfaceMixins, TensorMeshIO from discretize.utils import mkvc -from discretize.utils.code_utils import deprecate_property from .tensor_cell import TensorCell @@ -789,38 +788,6 @@ def _repr_attributes(self): return attrs - # DEPRECATIONS - areaFx = deprecate_property( - "face_x_areas", "areaFx", removal_version="1.0.0", error=True - ) - areaFy = deprecate_property( - "face_y_areas", "areaFy", removal_version="1.0.0", error=True - ) - areaFz = deprecate_property( - "face_z_areas", "areaFz", removal_version="1.0.0", error=True - ) - edgeEx = deprecate_property( - "edge_x_lengths", "edgeEx", removal_version="1.0.0", error=True - ) - edgeEy = deprecate_property( - "edge_y_lengths", "edgeEy", removal_version="1.0.0", error=True - ) - edgeEz = deprecate_property( - "edge_z_lengths", "edgeEz", removal_version="1.0.0", error=True - ) - faceBoundaryInd = deprecate_property( - "face_boundary_indices", - "faceBoundaryInd", - removal_version="1.0.0", - error=True, - ) - cellBoundaryInd = deprecate_property( - "cell_boundary_indices", - "cellBoundaryInd", - removal_version="1.0.0", - error=True, - ) - def _slice_to_index(index_slice, end): """Generate indices from a slice. diff --git a/discretize/tests.py b/discretize/tests.py index e88db172a..34f5452b6 100644 --- a/discretize/tests.py +++ b/discretize/tests.py @@ -32,7 +32,6 @@ from discretize.tensor_mesh import TensorMesh from discretize.curvilinear_mesh import CurvilinearMesh from discretize.cylindrical_mesh import CylindricalMesh -from discretize.utils.code_utils import deprecate_function from . import TreeMesh as Tree @@ -1020,18 +1019,3 @@ def project_min_max(points, axis): return 0 if not do_asserts: return level - - -# DEPRECATIONS -setupMesh = deprecate_function( - setup_mesh, "setupMesh", removal_version="1.0.0", error=True -) -Rosenbrock = deprecate_function( - rosenbrock, "Rosenbrock", removal_version="1.0.0", error=True -) -checkDerivative = deprecate_function( - check_derivative, "checkDerivative", removal_version="1.0.0", error=True -) -getQuadratic = deprecate_function( - get_quadratic, "getQuadratic", removal_version="1.0.0", error=True -) diff --git a/discretize/tree_mesh.py b/discretize/tree_mesh.py index 6ae4c17e1..922b3b342 100644 --- a/discretize/tree_mesh.py +++ b/discretize/tree_mesh.py @@ -95,7 +95,6 @@ from discretize._extensions.tree_ext import _TreeMesh, TreeCell # NOQA F401 import numpy as np import scipy.sparse as sp -from discretize.utils.code_utils import deprecate_property from scipy.spatial import Delaunay @@ -957,19 +956,9 @@ def cell_levels_by_index(self, indices): return self._cell_levels_by_indexes(indices) def get_interpolation_matrix( # NOQA D102 - self, locs, location_type="cell_centers", zeros_outside=False, **kwargs + self, locs, location_type="cell_centers", zeros_outside=False ): # Documentation inherited from discretize.base.BaseMesh - if "locType" in kwargs: - raise TypeError( - "The locType keyword argument has been removed, please use location_type. " - "This will be removed in discretize 1.0.0" - ) - if "zerosOutside" in kwargs: - raise TypeError( - "The zerosOutside keyword argument has been removed, please use zeros_outside. " - "This will be removed in discretize 1.0.0" - ) location_type = self._parse_location_type(location_type) if self.dim == 2 and "z" in location_type: raise NotImplementedError("Unable to interpolate from Z edges/faces in 2D") @@ -1071,115 +1060,3 @@ def equals(self, other): # NOQA D102 def __reduce__(self): """Return the necessary items to reconstruct this object's state.""" return TreeMesh, (self.h, self.origin), self.__getstate__() - - cellGrad = deprecate_property( - "cell_gradient", "cellGrad", removal_version="1.0.0", error=True - ) - cellGradx = deprecate_property( - "cell_gradient_x", "cellGradx", removal_version="1.0.0", error=True - ) - cellGrady = deprecate_property( - "cell_gradient_y", "cellGrady", removal_version="1.0.0", error=True - ) - cellGradz = deprecate_property( - "cell_gradient_z", "cellGradz", removal_version="1.0.0", error=True - ) - cellGradStencil = deprecate_property( - "cell_gradient_stencil", - "cellGradStencil", - removal_version="1.0.0", - error=True, - ) - faceDivx = deprecate_property( - "face_x_divergence", "faceDivx", removal_version="1.0.0", error=True - ) - faceDivy = deprecate_property( - "face_y_divergence", "faceDivy", removal_version="1.0.0", error=True - ) - faceDivz = deprecate_property( - "face_z_divergence", "faceDivz", removal_version="1.0.0", error=True - ) - maxLevel = deprecate_property( - "max_used_level", "maxLevel", removal_version="1.0.0", error=True - ) - areaFx = deprecate_property( - "face_x_areas", "areaFx", removal_version="1.0.0", error=True - ) - areaFy = deprecate_property( - "face_y_areas", "areaFy", removal_version="1.0.0", error=True - ) - areaFz = deprecate_property( - "face_z_areas", "areaFz", removal_version="1.0.0", error=True - ) - edgeEx = deprecate_property( - "edge_x_lengths", "edgeEx", removal_version="1.0.0", error=True - ) - edgeEy = deprecate_property( - "edge_y_lengths", "edgeEy", removal_version="1.0.0", error=True - ) - edgeEz = deprecate_property( - "edge_z_lengths", "edgeEz", removal_version="1.0.0", error=True - ) - permuteCC = deprecate_property( - "permute_cells", "permuteCC", removal_version="1.0.0", error=True - ) - permuteF = deprecate_property( - "permute_faces", "permuteF", removal_version="1.0.0", error=True - ) - permuteE = deprecate_property( - "permute_edges", "permuteE", removal_version="1.0.0", error=True - ) - faceBoundaryInd = deprecate_property( - "face_boundary_indices", - "faceBoundaryInd", - removal_version="1.0.0", - error=True, - ) - cellBoundaryInd = deprecate_property( - "cell_boundary_indices", - "cellBoundaryInd", - removal_version="1.0.0", - error=True, - ) - _aveCC2FxStencil = deprecate_property( - "average_cell_to_total_face_x", - "_aveCC2FxStencil", - removal_version="1.0.0", - error=True, - ) - _aveCC2FyStencil = deprecate_property( - "average_cell_to_total_face_y", - "_aveCC2FyStencil", - removal_version="1.0.0", - error=True, - ) - _aveCC2FzStencil = deprecate_property( - "average_cell_to_total_face_z", - "_aveCC2FzStencil", - removal_version="1.0.0", - error=True, - ) - _cellGradStencil = deprecate_property( - "stencil_cell_gradient", - "_cellGradStencil", - removal_version="1.0.0", - error=True, - ) - _cellGradxStencil = deprecate_property( - "stencil_cell_gradient_x", - "_cellGradxStencil", - removal_version="1.0.0", - error=True, - ) - _cellGradyStencil = deprecate_property( - "stencil_cell_gradient_y", - "_cellGradyStencil", - removal_version="1.0.0", - error=True, - ) - _cellGradzStencil = deprecate_property( - "stencil_cell_gradient_z", - "_cellGradzStencil", - removal_version="1.0.0", - error=True, - ) diff --git a/discretize/utils/__init__.py b/discretize/utils/__init__.py index 9a1dcffc7..4d28c02a9 100644 --- a/discretize/utils/__init__.py +++ b/discretize/utils/__init__.py @@ -156,31 +156,3 @@ ) from discretize.utils.io_utils import download, load_mesh - -# DEPRECATIONS -from discretize.utils.code_utils import isScalar, asArray_N_x_Dim -from discretize.utils.matrix_utils import ( - sdInv, - getSubArray, - inv3X3BlockDiagonal, - inv2X2BlockDiagonal, - makePropertyTensor, - invPropertyTensor, - cross2d, -) -from discretize.utils.mesh_utils import ( - meshTensor, - closestPoints, - ExtractCoreMesh, -) -from discretize.utils.curvilinear_utils import ( - exampleLrmGrid, - volTetra, - indexCube, - faceInfo, -) -from discretize.utils.interpolation_utils import interpmat -from discretize.utils.coordinate_utils import ( - rotationMatrixFromNormals, - rotatePointsFromNormals, -) diff --git a/discretize/utils/code_utils.py b/discretize/utils/code_utils.py index 2eed4f881..ce00c0923 100644 --- a/discretize/utils/code_utils.py +++ b/discretize/utils/code_utils.py @@ -377,12 +377,3 @@ def dep_function(*args, **kwargs): doc = doc.replace("deprecated", "removed") dep_function.__doc__ = doc return dep_function - - -# DEPRECATIONS -isScalar = deprecate_function( - is_scalar, "isScalar", removal_version="1.0.0", error=True -) -asArray_N_x_Dim = deprecate_function( - as_array_n_by_dim, "asArray_N_x_Dim", removal_version="1.0.0", error=True -) diff --git a/discretize/utils/codeutils.py b/discretize/utils/codeutils.py deleted file mode 100644 index 52afe61ca..000000000 --- a/discretize/utils/codeutils.py +++ /dev/null @@ -1,6 +0,0 @@ -from discretize.utils.code_utils import * # NOQA F401,F403 - -raise ImportError( - "Importing from discretize.codeutils is deprecated behavoir. Please import " - "from discretize.utils. This message will be removed in version 1.0.0 of discretize.", -) diff --git a/discretize/utils/coordinate_utils.py b/discretize/utils/coordinate_utils.py index 2464e2512..13c698182 100644 --- a/discretize/utils/coordinate_utils.py +++ b/discretize/utils/coordinate_utils.py @@ -2,7 +2,7 @@ import numpy as np from discretize.utils.matrix_utils import mkvc -from discretize.utils.code_utils import as_array_n_by_dim, deprecate_function +from discretize.utils.code_utils import as_array_n_by_dim def cylindrical_to_cartesian(grid, vec=None): @@ -295,17 +295,3 @@ def rotate_points_from_normals(xyz, v0, v1, x0=np.r_[0.0, 0.0, 0.0]): X0 = np.ones([xyz.shape[0], 1]) * mkvc(x0) return (xyz - X0).dot(R.T) + X0 # equivalent to (R*(xyz - X0)).T + X0 - - -rotationMatrixFromNormals = deprecate_function( - rotation_matrix_from_normals, - "rotationMatrixFromNormals", - removal_version="1.0.0", - error=True, -) -rotatePointsFromNormals = deprecate_function( - rotate_points_from_normals, - "rotatePointsFromNormals", - removal_version="1.0.0", - error=True, -) diff --git a/discretize/utils/coordutils.py b/discretize/utils/coordutils.py deleted file mode 100644 index eb213ad61..000000000 --- a/discretize/utils/coordutils.py +++ /dev/null @@ -1,6 +0,0 @@ -from discretize.utils.coordinate_utils import * # NOQA F401,F403 - -raise ImportError( - "Importing from discretize.coordutils is deprecated behavoir. Please import " - "from discretize.utils. This message will be removed in version 1.0.0 of discretize.", -) diff --git a/discretize/utils/curvilinear_utils.py b/discretize/utils/curvilinear_utils.py index f65cd437b..ae8d22a0d 100644 --- a/discretize/utils/curvilinear_utils.py +++ b/discretize/utils/curvilinear_utils.py @@ -2,7 +2,6 @@ import numpy as np from discretize.utils.matrix_utils import mkvc, ndgrid, sub2ind -from discretize.utils.code_utils import deprecate_function def example_curvilinear_grid(nC, exType): @@ -300,7 +299,7 @@ def index_cube(nodes, grid_shape, n=None): return out -def face_info(xyz, A, B, C, D, average=True, normalize_normals=True, **kwargs): +def face_info(xyz, A, B, C, D, average=True, normalize_normals=True): r"""Return normal surface vectors and areas for a given set of faces. Let *xyz* be an (n, 3) array denoting a set of vertex locations. @@ -448,11 +447,6 @@ def face_info(xyz, A, B, C, D, average=True, normalize_normals=True, **kwargs): ... ) >>> plt.show() """ - if "normalizeNormals" in kwargs: - raise TypeError( - "The normalizeNormals keyword argument has been removed, please use normalize_normals. " - "This will be removed in discretize 1.0.0", - ) if not isinstance(average, bool): raise TypeError("average must be a boolean") if not isinstance(normalize_normals, bool): @@ -503,20 +497,3 @@ def normalize(x): area = (length(nA) + length(nB) + length(nC) + length(nD)) / 4 return N, area - - -exampleLrmGrid = deprecate_function( - example_curvilinear_grid, - "exampleLrmGrid", - removal_version="1.0.0", - error=True, -) -volTetra = deprecate_function( - volume_tetrahedron, "volTetra", removal_version="1.0.0", error=True -) -indexCube = deprecate_function( - index_cube, "indexCube", removal_version="1.0.0", error=True -) -faceInfo = deprecate_function( - face_info, "faceInfo", removal_version="1.0.0", error=True -) diff --git a/discretize/utils/curvutils.py b/discretize/utils/curvutils.py deleted file mode 100644 index f619f5d2a..000000000 --- a/discretize/utils/curvutils.py +++ /dev/null @@ -1,6 +0,0 @@ -from discretize.utils.curvilinear_utils import * # NOQA F401,F403 - -raise ImportError( - "Importing from discretize.curvutils is deprecated behavoir. Please import " - "from discretize.utils. This message will be removed in version 1.0.0 of discretize.", -) diff --git a/discretize/utils/interpolation_utils.py b/discretize/utils/interpolation_utils.py index 2c3c866e2..4e542b90d 100644 --- a/discretize/utils/interpolation_utils.py +++ b/discretize/utils/interpolation_utils.py @@ -3,7 +3,6 @@ import numpy as np import scipy.sparse as sp from discretize.utils.matrix_utils import mkvc, sub2ind -from discretize.utils.code_utils import deprecate_function try: from discretize._extensions import interputils_cython as pyx @@ -285,8 +284,3 @@ def volume_average(mesh_in, mesh_out, values=None, output=None): return mesh_out._vol_avg_from_tree(mesh_in, values, output) else: raise TypeError("Unsupported mesh types") - - -interpmat = deprecate_function( - interpolation_matrix, "interpmat", removal_version="1.0.0", error=True -) diff --git a/discretize/utils/interputils.py b/discretize/utils/interputils.py deleted file mode 100644 index d7738426e..000000000 --- a/discretize/utils/interputils.py +++ /dev/null @@ -1,6 +0,0 @@ -from discretize.utils.interpolation_utils import * # NOQA F401,F403 - -raise ImportError( - "Importing from discretize.interputils is deprecated behavoir. Please import " - "from discretize.utils. This message will be removed in version 1.0.0 of discretize.", -) diff --git a/discretize/utils/matrix_utils.py b/discretize/utils/matrix_utils.py index 563f2509f..bb35cf84a 100644 --- a/discretize/utils/matrix_utils.py +++ b/discretize/utils/matrix_utils.py @@ -2,11 +2,10 @@ import numpy as np import scipy.sparse as sp -from discretize.utils.code_utils import is_scalar, deprecate_function -import warnings +from discretize.utils.code_utils import is_scalar -def mkvc(x, n_dims=1, **kwargs): +def mkvc(x, n_dims=1): """Coerce a vector to the specified dimensionality. This function converts a :class:`numpy.ndarray` to a vector. In general, @@ -57,11 +56,6 @@ def mkvc(x, n_dims=1, **kwargs): Shape of output with n_dim = 2 : (6, 1) Shape of output with n_dim = 3 : (6, 1, 1) """ - if "numDims" in kwargs: - raise TypeError( - "The numDims keyword argument has been removed, please use n_dims. " - "This will be removed in discretize 1.0.0", - ) if isinstance(x, np.matrix): x = np.array(x) @@ -380,7 +374,7 @@ def ndgrid(*args, vector=True, order="F"): return meshed -def make_boundary_bool(shape, bdir="xyz", **kwargs): +def make_boundary_bool(shape, bdir="xyz"): r"""Return boundary indices of a tensor grid. For a tensor grid whose shape is given (1D, 2D or 3D), this function @@ -440,15 +434,6 @@ def make_boundary_bool(shape, bdir="xyz", **kwargs): [1, 6], [3, 6]]) """ - old_dir = kwargs.pop("dir", None) - if old_dir is not None: - warnings.warn( - "The `dir` keyword argument has been renamed to `bdir` to avoid shadowing the " - "builtin variable `dir`. This will be removed in discretize 1.0.0", - FutureWarning, - stacklevel=2, - ) - bdir = old_dir is_b = np.zeros(shape, dtype=bool, order="F") if "x" in bdir: is_b[[0, -1]] = True @@ -605,7 +590,16 @@ def get_subarray(A, ind): def inverse_3x3_block_diagonal( - a11, a12, a13, a21, a22, a23, a31, a32, a33, return_matrix=True, **kwargs + a11, + a12, + a13, + a21, + a22, + a23, + a31, + a32, + a33, + return_matrix=True, ): r"""Invert a set of 3x3 matricies from vectors containing their elements. @@ -712,15 +706,6 @@ def inverse_3x3_block_diagonal( >>> plt.spy(M) >>> plt.show() """ - if "returnMatrix" in kwargs: - warnings.warn( - "The returnMatrix keyword argument has been deprecated, please use return_matrix. " - "This will be removed in discretize 1.0.0", - FutureWarning, - stacklevel=2, - ) - return_matrix = kwargs["returnMatrix"] - a11 = mkvc(a11) a12 = mkvc(a12) a13 = mkvc(a13) @@ -764,7 +749,7 @@ def inverse_3x3_block_diagonal( ) -def inverse_2x2_block_diagonal(a11, a12, a21, a22, return_matrix=True, **kwargs): +def inverse_2x2_block_diagonal(a11, a12, a21, a22, return_matrix=True): r""" Invert a set of 2x2 matricies from vectors containing their elements. @@ -865,15 +850,6 @@ def inverse_2x2_block_diagonal(a11, a12, a21, a22, return_matrix=True, **kwargs) >>> plt.spy(M) >>> plt.show() """ - if "returnMatrix" in kwargs: - warnings.warn( - "The returnMatrix keyword argument has been deprecated, please use return_matrix. " - "This will be removed in discretize 1.0.0", - FutureWarning, - stacklevel=2, - ) - return_matrix = kwargs["returnMatrix"] - a11 = mkvc(a11) a12 = mkvc(a12) a21 = mkvc(a21) @@ -1243,7 +1219,7 @@ def make_property_tensor(mesh, tensor): return Sigma -def inverse_property_tensor(mesh, tensor, return_matrix=False, **kwargs): +def inverse_property_tensor(mesh, tensor, return_matrix=False): r"""Construct the inverse of the physical property tensor. For a given *mesh*, the input parameter *tensor* is a :class:`numpy.ndarray` @@ -1387,15 +1363,6 @@ def inverse_property_tensor(mesh, tensor, return_matrix=False, **kwargs): ... ) >>> plt.show() """ - if "returnMatrix" in kwargs: - warnings.warn( - "The returnMatrix keyword argument has been deprecated, please use return_matrix. " - "This will be removed in discretize 1.0.0", - FutureWarning, - stacklevel=2, - ) - return_matrix = kwargs["returnMatrix"] - propType = TensorType(mesh, tensor) if is_scalar(tensor): @@ -1785,42 +1752,3 @@ def __len__(self): def __repr__(self): return f"({self._val}, {self._val}, ...)" - - -################################################ -# DEPRECATED FUNCTIONS -################################################ - -sdInv = deprecate_function(sdinv, "sdInv", removal_version="1.0.0", error=True) - -getSubArray = deprecate_function( - get_subarray, "getSubArray", removal_version="1.0.0", error=True -) - -inv3X3BlockDiagonal = deprecate_function( - inverse_3x3_block_diagonal, - "inv3X3BlockDiagonal", - removal_version="1.0.0", - error=True, -) - -inv2X2BlockDiagonal = deprecate_function( - inverse_2x2_block_diagonal, - "inv2X2BlockDiagonal", - removal_version="1.0.0", - error=True, -) - -makePropertyTensor = deprecate_function( - make_property_tensor, - "makePropertyTensor", - removal_version="1.0.0", - error=True, -) - -invPropertyTensor = deprecate_function( - inverse_property_tensor, - "invPropertyTensor", - removal_version="1.0.0", - error=True, -) diff --git a/discretize/utils/matutils.py b/discretize/utils/matutils.py deleted file mode 100644 index 4f7e3cddf..000000000 --- a/discretize/utils/matutils.py +++ /dev/null @@ -1,6 +0,0 @@ -from discretize.utils.matrix_utils import * # NOQA F401,F403 - -raise ImportError( - "Importing from discretize.matutils is deprecated behavoir. Please import " - "from discretize.utils. This message will be removed in version 1.0.0 of discretize.", -) diff --git a/discretize/utils/mesh_utils.py b/discretize/utils/mesh_utils.py index ec9583893..cb8f078f0 100644 --- a/discretize/utils/mesh_utils.py +++ b/discretize/utils/mesh_utils.py @@ -8,7 +8,6 @@ from scipy.spatial import cKDTree, Delaunay from scipy import interpolate import discretize -from discretize.utils.code_utils import deprecate_function import warnings num_types = [int, float] @@ -186,7 +185,7 @@ def unpack_widths(value): return np.array(proposed) -def closest_points_index(mesh, pts, grid_loc="CC", **kwargs): +def closest_points_index(mesh, pts, grid_loc="CC"): """Find the indicies for the nearest grid location for a set of points. Parameters @@ -237,11 +236,6 @@ def closest_points_index(mesh, pts, grid_loc="CC", **kwargs): >>> ax.scatter(xy_nodes[ind_nodes, 0], xy_nodes[ind_nodes, 1], 50, 'b') >>> plt.show() """ - if "gridLoc" in kwargs: - raise TypeError( - "The gridLoc keyword argument has been removed, please use grid_loc. " - "This message will be removed in discretize 1.0.0", - ) warnings.warn( "The closest_points_index utilty function has been moved to be a method of " "a class object. Please access it as mesh.closest_points_index(). This will " @@ -1209,17 +1203,3 @@ def example_simplex_mesh(rect_shape): ] return points, simplices - - -meshTensor = deprecate_function( - unpack_widths, "meshTensor", removal_version="1.0.0", error=True -) -closestPoints = deprecate_function( - closest_points_index, "closestPoints", removal_version="1.0.0", error=True -) -ExtractCoreMesh = deprecate_function( - extract_core_mesh, "ExtractCoreMesh", removal_version="1.0.0", error=True -) -closest_points = deprecate_function( - closest_points_index, "closest_points", removal_version="1.0.0", error=True -) diff --git a/discretize/utils/meshutils.py b/discretize/utils/meshutils.py deleted file mode 100644 index 15d789a6b..000000000 --- a/discretize/utils/meshutils.py +++ /dev/null @@ -1,6 +0,0 @@ -from discretize.utils.mesh_utils import * # NOQA F401,F403 - -raise ImportError( - "Importing from discretize.meshutils is deprecated behavoir. Please import " - "from discretize.utils. This message will be removed in version 1.0.0 of discretize.", -) diff --git a/discretize/utils/meson.build b/discretize/utils/meson.build index 4bceaff47..136438d06 100644 --- a/discretize/utils/meson.build +++ b/discretize/utils/meson.build @@ -8,12 +8,6 @@ python_sources = [ 'io_utils.py', 'matrix_utils.py', 'mesh_utils.py', - 'codeutils.py', - 'coordutils.py', - 'curvutils.py', - 'interputils.py', - 'matutils.py', - 'meshutils.py', ] py.install_sources( diff --git a/docs/content/inner_products.rst b/docs/content/inner_products.rst index d46711761..fa4a7f4eb 100644 --- a/docs/content/inner_products.rst +++ b/docs/content/inner_products.rst @@ -190,7 +190,7 @@ Which is nice and easy to invert if necessary, however, in the fully anisotropic import discretize import numpy as np import matplotlib.pyplot as plt - mesh = discretize.TensorMesh([10,50,3]) + mesh = discretize.TensorMesh([10,50,3])R m1 = np.random.rand(mesh.nC) m2 = np.random.rand(mesh.nC,3) m3 = np.random.rand(mesh.nC,6)