Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.0 #313

Draft
wants to merge 32 commits into
base: main
Choose a base branch
from
Draft

1.0.0 #313

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b394a64
remove all deprecations
jcapriot Apr 19, 2022
c4231fd
fix test
jcapriot Apr 20, 2022
22c8d73
Merge branch 'main' into 1.0.0_alpha
jcapriot Aug 18, 2022
0edfd37
fix merge
jcapriot Aug 18, 2022
8706be7
don't import CylMesh
jcapriot Aug 18, 2022
74f0d7e
Merge branch 'main' into 1.0.0_alpha
jcapriot Nov 17, 2022
64f7b8c
Merge branch 'main' into 1.0.0_alpha
jcapriot Jan 27, 2023
3f0b7e6
Merge branch 'main' into 1.0.0_alpha
jcapriot Jan 27, 2023
bb1bf3c
Run black
jcapriot Jan 27, 2023
5ec5f9d
Style updates
jcapriot Jan 27, 2023
8d610c7
Merge branch 'main' into 1.0.0_alpha
jcapriot Jan 27, 2023
1330247
Remove calls to deprecated functions in discretize
jcapriot Jan 28, 2023
4d97a2d
Update examples and tutorials for deprecated functions.
jcapriot Jan 28, 2023
baebda8
Update deprecations for tests
jcapriot Jan 28, 2023
f3f8540
Merge branch 'main' into 1.0.0_alpha
jcapriot Jan 28, 2023
9e0b8ec
black formatting
jcapriot Jan 28, 2023
ebedd19
omf deprecations
jcapriot Jan 28, 2023
083e71d
Remove axis_* properties and references.
jcapriot Jan 31, 2023
7a1caab
Merge branch 'main' into 1.0.0_alpha
jcapriot Apr 13, 2023
d8e7c05
update the test tests
jcapriot Apr 13, 2023
3ec8c09
Merge branch 'main' into 1.0.0_alpha
jcapriot Apr 26, 2023
803a77b
Merge branch 'main' into 1.0.0_alpha
jcapriot Apr 28, 2023
acd7ffb
Merge branch 'main' into 1.0.0_alpha
jcapriot May 30, 2023
4bf4dc6
Merge branch 'main' into 1.0.0_alpha
jcapriot Jun 4, 2023
bf096c2
Merge branch 'main' into 1.0.0_alpha
jcapriot Jul 17, 2023
f264a3e
Merge branch 'main' into 1.0.0_alpha
jcapriot Jul 17, 2023
ea61efe
Add 1.0.0 alpha to tested CI
jcapriot Jul 17, 2023
f8f336f
remove branch test
jcapriot Jul 18, 2023
3a01960
Merge branch 'main' into 1.0.0_alpha
jcapriot Jul 18, 2023
883f9b3
Merge branch 'main' into 1.0.0_alpha
jcapriot Oct 31, 2023
01fd7e1
remove references to removed scripts
jcapriot Nov 6, 2023
c66f892
Merge branch 'main' into 1.0.0_alpha
jcapriot Aug 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions discretize/Tests/__init__.py

This file was deleted.

9 changes: 0 additions & 9 deletions discretize/Tests/meson.build

This file was deleted.

14 changes: 0 additions & 14 deletions discretize/View.py

This file was deleted.

2 changes: 1 addition & 1 deletion discretize/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
80 changes: 2 additions & 78 deletions discretize/base/base_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
)
160 changes: 0 additions & 160 deletions discretize/base/base_regular_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -820,7 +754,6 @@ def reshape(
x_type="cell_centers",
out_type="cell_centers",
return_format="V",
**kwargs,
):
"""Reshape tensor quantities.

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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."
)
Loading