Skip to content

Commit

Permalink
Use a looser tolerance on pitch for HexGrid roughly equal check
Browse files Browse the repository at this point in the history
We don't need a super strict check to make sure the grids are roughly
equal. The ideal of the method is to check that one index location in
one grid would be in approximately the same spatial location in the
other grid. Otherwise we can't accurately rotate the position within the
grid.

This problem came up in some shuffling work where two assemblies had
ever so slightly different pitches, on the order of hundreths of a
percent. The strict `other.pitch == self.pitch` failed even though, for
the purposes of this method, the two grids are "roughly equal"
  • Loading branch information
drewj-tp committed Jan 20, 2025
1 parent 3431c44 commit 931fab0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions armi/reactor/grids/hexagonal.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections import deque
from math import sqrt
from math import sqrt, isclose
from typing import List, Optional, Tuple

import numpy as np
Expand Down Expand Up @@ -639,6 +639,6 @@ def _roughlyEqual(self, other) -> bool:
return True
return (
isinstance(other, HexGrid)
and other.pitch == self.pitch
and isclose(self.pitch, other.pitch)
and other.cornersUp == self.cornersUp
)

0 comments on commit 931fab0

Please sign in to comment.