Skip to content

Commit 305d019

Browse files
shepardxiaclaude
andcommitted
fix: update WeatherSystem tests for NumPy array refactor
Tests were using old `particles` list API. Updated to use `p_count` which tracks active particles in the pre-allocated NumPy arrays. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e5a6d51 commit 305d019

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/unit/test_renderer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ def test_change_weather_clears_particles(self):
112112
for _ in range(20):
113113
ws.tick()
114114

115-
particle_count = len(ws.particles)
115+
particle_count = ws.p_count
116116
assert particle_count > 0
117117

118118
# Change weather type
119119
ws.set_weather("snow", intensity=1.0)
120-
assert len(ws.particles) == 0
120+
assert ws.p_count == 0
121121

122122
def test_tick_spawns_particles(self):
123123
ws = WeatherSystem(20, 10)
@@ -127,7 +127,7 @@ def test_tick_spawns_particles(self):
127127
for _ in range(50):
128128
ws.tick()
129129

130-
assert len(ws.particles) > 0
130+
assert ws.p_count > 0
131131

132132
def test_no_particles_without_weather(self):
133133
ws = WeatherSystem(20, 10)
@@ -136,7 +136,7 @@ def test_no_particles_without_weather(self):
136136
for _ in range(10):
137137
ws.tick()
138138

139-
assert len(ws.particles) == 0
139+
assert ws.p_count == 0
140140

141141
def test_exclusion_zones(self):
142142
"""Particles should be removed from exclusion zones."""

0 commit comments

Comments
 (0)