Skip to content
Merged
Show file tree
Hide file tree
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
Binary file modified gnm/shape/data/versions/v3_0/gnm_head.npz
Binary file not shown.
8 changes: 4 additions & 4 deletions gnm/shape/gnm_base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(
self,
version: gnm_specs.GNMVersion,
variant: gnm_specs.GNMVariant,
) -> None:
):
self.version = version
self.variant = variant

Expand All @@ -66,18 +66,18 @@ def _from_model_data(

class GNMBaseTest(absltest.TestCase):

def setUp(self) -> None:
def setUp(self):
super().setUp()
self.gnm = DummyGNM(
version=_TEST_FULL_VERSION,
variant=_TEST_VARIANT,
)

def test_properties(self) -> None:
def test_properties(self):
self.assertEqual(self.gnm.major_version, _TEST_MAJOR_VERSION)
self.assertEqual(self.gnm.body_part, _TEST_BODY_PART)

def test_from_gnm(self) -> None:
def test_from_gnm(self):
new_gnm = DummyGNM.from_gnm(self.gnm)
self.assertIsInstance(new_gnm, DummyGNM)
self.assertEqual(new_gnm.version, _TEST_FULL_VERSION)
Expand Down
10 changes: 5 additions & 5 deletions gnm/shape/gnm_xnp_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,25 @@

class GNMXnpTest(absltest.TestCase):

def test_annotations_match_schema(self) -> None:
def test_annotations_match_schema(self):
expected_attributes = set(gnm_data_schema.GNM_DATA_ATTRIBUTES)
actual_attributes = set(gnm_xnp.GNM.__annotations__.keys())
self.assertEqual(actual_attributes, expected_attributes)

def test_dataclass_fields_match_schema(self) -> None:
def test_dataclass_fields_match_schema(self):
expected_attributes = set(gnm_data_schema.GNM_DATA_ATTRIBUTES)
actual_fields = {f.name for f in dataclasses.fields(gnm_xnp.GNM)}
self.assertEqual(actual_fields, expected_attributes)

def test_cannot_instantiate_abstract_gnm(self) -> None:
def test_cannot_instantiate_abstract_gnm(self):
with self.assertRaises(TypeError):
gnm_xnp.GNM() # pytype: disable=not-instantiable,missing-parameter # pylint: disable=abstract-class-instantiated

def test_from_model_data_raises_not_implemented(self) -> None:
def test_from_model_data_raises_not_implemented(self):
with self.assertRaises(NotImplementedError):
gnm_xnp.GNM._from_model_data({}) # pylint: disable=protected-access

def test_cannot_instantiate_concrete_gnm_via_constructor(self) -> None:
def test_cannot_instantiate_concrete_gnm_via_constructor(self):
with self.assertRaises(TypeError):
gnm_numpy.GNM() # pytype: disable=not-instantiable,missing-parameter

Expand Down
4 changes: 2 additions & 2 deletions gnm/shape/visualization/render_gnm_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _write_gif(
name: str,
images: np.ndarray,
fps: int = 10,
) -> None:
):
"""Writes an animated GIF to the undeclared outputs directory."""
outputs_dir = epath.Path(outputs_dir)
gif_path = outputs_dir / f'{name}.gif'
Expand All @@ -52,7 +52,7 @@ def _write_images(
outputs_dir: epath.Path | str,
name: str,
images: np.ndarray,
) -> None:
):
"""Writes a row of images to the undeclared outputs directory."""
png_path = (
outputs_dir / f'{name}.png' # pyrefly: ignore[unsupported-operation]
Expand Down
Loading