Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Resolve warnings by defining PropertyLayer dtypes #1987

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions tests/test_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def test_remove_middle(self):

class TestPropertyLayer(unittest.TestCase):
def setUp(self):
self.layer = PropertyLayer("test_layer", 10, 10, 0)
self.layer = PropertyLayer("test_layer", 10, 10, 0, dtype=int)

# Initialization Test
def test_initialization(self):
Expand Down Expand Up @@ -379,11 +379,11 @@ def test_aggregate_property_ufunc(self):
# Edge Case: Negative or Zero Dimensions
def test_initialization_negative_dimensions(self):
with self.assertRaises(ValueError):
PropertyLayer("test_layer", -10, 10, 0)
PropertyLayer("test_layer", -10, 10, 0, dtype=int)

def test_initialization_zero_dimensions(self):
with self.assertRaises(ValueError):
PropertyLayer("test_layer", 0, 10, 0)
PropertyLayer("test_layer", 0, 10, 0, dtype=int)

# Edge Case: Out-of-Bounds Cell Access
def test_set_cell_out_of_bounds(self):
Expand Down Expand Up @@ -611,8 +611,8 @@ def test_distance_squared_torus(self):
class TestSingleGridWithPropertyGrid(unittest.TestCase):
def setUp(self):
self.grid = SingleGrid(10, 10, False)
self.property_layer1 = PropertyLayer("layer1", 10, 10, 0)
self.property_layer2 = PropertyLayer("layer2", 10, 10, 1)
self.property_layer1 = PropertyLayer("layer1", 10, 10, 0, dtype=int)
self.property_layer2 = PropertyLayer("layer2", 10, 10, 1.0, dtype=float)
self.grid.add_property_layer(self.property_layer1)
self.grid.add_property_layer(self.property_layer2)

Expand All @@ -627,7 +627,7 @@ def test_remove_property_layer(self):

def test_add_property_layer_mismatched_dimensions(self):
with self.assertRaises(ValueError):
self.grid.add_property_layer(PropertyLayer("layer3", 5, 5, 0))
self.grid.add_property_layer(PropertyLayer("layer3", 5, 5, 0, dtype=int))

def test_add_existing_property_layer(self):
with self.assertRaises(ValueError):
Expand Down