Skip to content

Commit ad4211e

Browse files
Jammy2211Jammy2211
authored andcommitted
black
1 parent 33eb087 commit ad4211e

File tree

3 files changed

+5
-41
lines changed

3 files changed

+5
-41
lines changed

autoarray/structures/triangles/abstract.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import numpy as np
44

55
from autoarray import Grid2D
6-
from autoarray.structures.triangles.shape import Shape
76

87
HEIGHT_FACTOR = 3**0.5 / 2
98

autoarray/structures/triangles/array.py

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
@register_pytree_node_class
15-
class ArrayTriangles:
15+
class ArrayTriangles(AbstractTriangles):
1616
def __init__(
1717
self,
1818
indices,
@@ -118,44 +118,6 @@ def add_vertex(v):
118118
max_containing_size=max_containing_size,
119119
)
120120

121-
@classmethod
122-
def for_grid(
123-
cls,
124-
grid: Grid2D,
125-
**kwargs,
126-
) -> "AbstractTriangles":
127-
"""
128-
Create a grid of equilateral triangles from a regular grid.
129-
130-
Parameters
131-
----------
132-
grid
133-
The regular grid to convert to a grid of triangles.
134-
135-
Returns
136-
-------
137-
The grid of triangles.
138-
"""
139-
140-
scale = grid.pixel_scale
141-
142-
y = grid[:, 0]
143-
x = grid[:, 1]
144-
145-
y_min = y.min()
146-
y_max = y.max()
147-
x_min = x.min()
148-
x_max = x.max()
149-
150-
return cls.for_limits_and_scale(
151-
y_min,
152-
y_max,
153-
x_min,
154-
x_max,
155-
scale,
156-
**kwargs,
157-
)
158-
159121
@property
160122
def indices(self):
161123
return self._indices

autoarray/structures/triangles/coordinate_array.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
from abc import ABC
2+
13
import numpy as np
24
import jax.numpy as jnp
35
import jax
46

57
from autoarray.structures.triangles.abstract import HEIGHT_FACTOR
8+
from autoarray.structures.triangles.abstract import AbstractTriangles
69
from autoarray.structures.triangles.array import ArrayTriangles
710
from autoarray.numpy_wrapper import register_pytree_node_class
811
from autoconf import cached_property
@@ -11,7 +14,7 @@
1114

1215

1316
@register_pytree_node_class
14-
class CoordinateArrayTriangles:
17+
class CoordinateArrayTriangles(AbstractTriangles, ABC):
1518

1619
def __init__(
1720
self,

0 commit comments

Comments
 (0)