|
1 | 1 | """Module containing the TreeMesh implementation.""" |
2 | 2 |
|
| 3 | +import warnings |
| 4 | + |
3 | 5 | # ___ ___ ___ ___ ___ ___ |
4 | 6 | # /\ \ /\ \ /\ \ /\ \ /\ \ /\ \ |
5 | 7 | # /::\ \ /::\ \ \:\ \ /::\ \ /::\ \ /::\ \ |
@@ -169,7 +171,7 @@ class TreeMesh( |
169 | 171 |
|
170 | 172 | diagonal_balance : bool, optional |
171 | 173 | Whether to balance cells along the diagonal of the tree during construction. |
172 | | - This will effect all calls to refine the tree. |
| 174 | + This will affect all calls to refine the tree. |
173 | 175 |
|
174 | 176 | Examples |
175 | 177 | -------- |
@@ -233,9 +235,20 @@ class TreeMesh( |
233 | 235 | _items = {"h", "origin", "cell_state"} |
234 | 236 |
|
235 | 237 | # inheriting stuff from BaseTensorMesh that isn't defined in _QuadTree |
236 | | - def __init__(self, h=None, origin=None, diagonal_balance=False, **kwargs): |
| 238 | + def __init__(self, h=None, origin=None, diagonal_balance=None, **kwargs): |
237 | 239 | if "x0" in kwargs: |
238 | 240 | origin = kwargs.pop("x0") |
| 241 | + |
| 242 | + if diagonal_balance is None: |
| 243 | + diagonal_balance = False |
| 244 | + warnings.warn( |
| 245 | + "In discretize v1.0 the TreeMesh will change the default value of " |
| 246 | + "diagonal_balance to True, which will likely slightly change meshes you have" |
| 247 | + "previously created. If you need to keep the current behavoir, explicitly set " |
| 248 | + "diagonal_balance=False.", |
| 249 | + FutureWarning, |
| 250 | + stacklevel=2, |
| 251 | + ) |
239 | 252 | super().__init__(h=h, origin=origin, diagonal_balance=diagonal_balance) |
240 | 253 |
|
241 | 254 | cell_state = kwargs.pop("cell_state", None) |
@@ -926,7 +939,7 @@ def face_z_divergence(self): # NOQA D102 |
926 | 939 |
|
927 | 940 | def point2index(self, locs): # NOQA D102 |
928 | 941 | # Documentation inherited from discretize.base.BaseMesh |
929 | | - return self.get_containing_cell_indexes(locs) |
| 942 | + return self.get_containing_cells(locs) |
930 | 943 |
|
931 | 944 | def cell_levels_by_index(self, indices): |
932 | 945 | """Fast function to return a list of levels for the given cell indices. |
|
0 commit comments