Skip to content

Commit afe2d9a

Browse files
committed
fix more test warnings
1 parent 371d870 commit afe2d9a

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/tikzplotlib/_cleanfigure.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,18 +1280,17 @@ def _cross_lines(X1, X2, X3, X4):
12801280
:param X4: X4
12811281
:type X4: np.ndarray
12821282
"""
1283-
n = X2.shape[0]
1284-
Lambda = np.zeros((n, 2))
12851283
detA = -(X2[:, 0] - X1[:, 0]) * (X4[1] - X3[1]) + (X2[:, 1] - X1[:, 1]) * (
12861284
X4[0] - X3[0]
12871285
)
12881286

12891287
id_detA = detA != 0
12901288

1289+
n = X2.shape[0]
1290+
Lambda = np.zeros((n, 2))
12911291
if id_detA.any():
1292-
rhs = -X1.reshape((-1, 2)) + X3.reshape(
1293-
(-1, 2)
1294-
) # NOTE: watch out for broadcasting
1292+
# NOTE: watch out for broadcasting
1293+
rhs = -X1.reshape((-1, 2)) + X3.reshape((-1, 2))
12951294
Rotate = np.array([[0, -1], [1, 0]])
12961295
Lambda[id_detA, 0] = (rhs[id_detA, :] @ Rotate @ (X4 - X3).T) / detA[id_detA]
12971296
Lambda[id_detA, 1] = (

tests/test_cleanfigure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,8 @@ def test_xlog(self):
554554
plt.close("all")
555555

556556
def test_loglog(self):
557-
x = np.exp(np.logspace(0.0, 2.0, 100))
558-
y = np.exp(np.logspace(0.0, 2.0, 100))
557+
x = np.exp(np.logspace(0.0, 1.5, 100))
558+
y = np.exp(np.logspace(0.0, 1.5, 100))
559559

560560
with plt.rc_context(rc=RC_PARAMS):
561561
_, ax = plt.subplots(1)

0 commit comments

Comments
 (0)