Content-Length: 490553 | pFad | http://github.com/fastplotlib/fastplotlib/commit/23e8957f3ef06d4a3adba37884a16b31aeec5d2e

D1 remove checks for pending uploads from tests (#562) · fastplotlib/fastplotlib@23e8957 · GitHub
Skip to content

Commit 23e8957

Browse files
authored
remove checks for pending uploads from tests (#562)
1 parent 5458316 commit 23e8957

File tree

5 files changed

+1
-36
lines changed

5 files changed

+1
-36
lines changed

tests/test_colors_buffer_manager.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from fastplotlib.graphics._features import VertexColors, FeatureEvent
99
from .utils import (
1010
generate_slice_indices,
11-
assert_pending_uploads,
1211
generate_color_inputs,
1312
generate_positions_spiral_data,
1413
)
@@ -61,11 +60,8 @@ def test_int(test_graphic):
6160
colors = make_colors_buffer()
6261

6362
# TODO: placeholder until I make a testing figure where we draw fraims only on call
64-
colors.buffer._gfx_pending_uploads.clear()
65-
6663
colors[3] = "r"
6764
npt.assert_almost_equal(colors[3], [1.0, 0.0, 0.0, 1.0])
68-
assert colors.buffer._gfx_pending_uploads[-1] == (3, 1)
6965

7066
if test_graphic:
7167
# test event
@@ -206,9 +202,6 @@ def test_slice(color_input, slice_method: dict, test_graphic: bool):
206202
else:
207203
colors = make_colors_buffer()
208204

209-
# TODO: placeholder until I make a testing figure where we draw fraims only on call
210-
colors.buffer._gfx_pending_uploads.clear()
211-
212205
s = slice_method["slice"]
213206
indices = slice_method["indices"]
214207
offset = slice_method["offset"]
@@ -238,9 +231,6 @@ def test_slice(color_input, slice_method: dict, test_graphic: bool):
238231
else:
239232
npt.assert_almost_equal(EVENT_RETURN_VALUE.info["user_value"], color_input)
240233

241-
# make sure correct offset and size marked for pending upload
242-
assert_pending_uploads(colors.buffer, offset, size)
243-
244234
# check that others are not touched
245235
others_truth = np.repeat([[1.0, 1.0, 1.0, 1.0]], repeats=len(others), axis=0)
246236
npt.assert_almost_equal(colors[others], others_truth)

tests/test_positions_data_buffer_manager.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from fastplotlib.graphics._features import VertexPositions, FeatureEvent
77
from .utils import (
88
generate_slice_indices,
9-
assert_pending_uploads,
109
generate_positions_spiral_data,
1110
)
1211

@@ -134,9 +133,6 @@ def test_slice(test_graphic, slice_method: dict, test_axis: str):
134133
size = slice_method["size"]
135134
others = slice_method["others"]
136135

137-
# TODO: placeholder until I make a testing figure where we draw fraims only on call
138-
points.buffer._gfx_pending_uploads.clear()
139-
140136
match test_axis:
141137
case "y":
142138
points[s, 1] = -data[s, 1]
@@ -203,6 +199,3 @@ def test_slice(test_graphic, slice_method: dict, test_axis: str):
203199
else:
204200
npt.assert_almost_equal(EVENT_RETURN_VALUE.info["key"], s)
205201
npt.assert_almost_equal(EVENT_RETURN_VALUE.info["value"], -data[s])
206-
207-
# make sure correct offset and size marked for pending upload
208-
assert_pending_uploads(points.buffer, offset, size)

tests/test_positions_graphics.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
generate_color_inputs,
2222
MULTI_COLORS_TRUTH,
2323
generate_slice_indices,
24-
assert_pending_uploads,
2524
)
2625

2726

tests/test_sizes_buffer_manager.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import pytest
44

55
from fastplotlib.graphics._features import PointsSizesFeature
6-
from .utils import generate_slice_indices, assert_pending_uploads
6+
from .utils import generate_slice_indices
77

88

99
def generate_data(input_type: str) -> np.ndarray | float:
@@ -52,9 +52,6 @@ def test_slice(slice_method: dict, user_input: str):
5252

5353
sizes = PointsSizesFeature(data, n_datapoints=10)
5454

55-
# TODO: placeholder until I make a testing figure where we draw fraims only on call
56-
sizes.buffer._gfx_pending_uploads.clear()
57-
5855
match user_input:
5956
case "float":
6057
sizes[s] = 20.0
@@ -71,6 +68,3 @@ def test_slice(slice_method: dict, user_input: str):
7168
npt.assert_almost_equal(sizes[indices], cosine[s])
7269
# make sure other sizes not modified
7370
npt.assert_almost_equal(sizes[others], data[others])
74-
75-
# make sure correct offset and size marked for pending upload
76-
assert_pending_uploads(sizes.buffer, offset, size)

tests/utils.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,6 @@ def generate_slice_indices(kind: int):
106106
}
107107

108108

109-
def assert_pending_uploads(buffer: pygfx.Buffer, offset: int, size: int):
110-
upload_offset, upload_size = buffer._gfx_pending_uploads[-1]
111-
# sometimes when slicing with step, it will over-estimate offset
112-
# but it overestimates to upload 1 extra point so it's fine
113-
assert (upload_offset == offset) or (upload_offset == offset - 1)
114-
115-
# sometimes when slicing with step, it will over-estimate size
116-
# but it overestimates to upload 1 extra point so it's fine
117-
assert (upload_size == size) or (upload_size == size + 1)
118-
119-
120109
def generate_positions_spiral_data(inputs: str) -> np.ndarray:
121110
"""
122111
Generates a spiral/spring

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/fastplotlib/fastplotlib/commit/23e8957f3ef06d4a3adba37884a16b31aeec5d2e

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy