@@ -109,8 +109,8 @@ def test_single_ax_auto_cs_unresolvable_raises(sdata_multi_cs):
109109
110110
111111def test_cs_name_with_apostrophe_does_not_crash ():
112- # Regression test for #602: .query(f"cs == '{cs}'") raised TokenError for names
113- # containing single quotes (e.g. "patient's_sample") .
112+ # Regression test for #602: .query(f"cs == '{cs}'") raised TokenError for cs names
113+ # containing single quotes.
114114 data = np .zeros ((1 , 10 , 10 ), dtype = np .float64 )
115115 img = Image2DModel .parse (data , dims = ("c" , "y" , "x" ))
116116 sdata = SpatialData (images = {"img" : img })
@@ -122,7 +122,6 @@ def test_cs_name_with_apostrophe_does_not_crash():
122122
123123def test_get_cs_contents_is_linear ():
124124 # Regression test for #602: pd.concat inside loop was O(n²).
125- # Build two SpatialData objects: n=10 and n=50 coordinate systems.
126125 def build (n : int ) -> SpatialData :
127126 data = np .zeros ((1 , 4 , 4 ), dtype = np .float64 )
128127 images = {}
@@ -137,7 +136,6 @@ def build(n: int) -> SpatialData:
137136 t10 = timeit .timeit (lambda : _get_cs_contents (sd10 ), number = 20 ) / 20
138137 t50 = timeit .timeit (lambda : _get_cs_contents (sd50 ), number = 20 ) / 20
139138 ratio = t50 / t10
140- # O(n) → ratio ≈ 5×; O(n²) → ratio ≈ 25×. Allow generous headroom for CI variance.
141139 assert ratio < 15 , (
142140 f"_get_cs_contents appears quadratic: n=10 { t10 * 1e3 :.1f} ms, n=50 { t50 * 1e3 :.1f} ms, ratio={ ratio :.1f} x"
143141 )
0 commit comments