Skip to content

Commit 8f7ffa2

Browse files
committed
oops, deleted too many tests.
1 parent e8f0856 commit 8f7ffa2

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

tests/test_encoder.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from perceiver_pytorch import Perceiver
33

44
from ocean_emulators.constants import Lat, Lon
5-
from ocean_emulators.models.modules.encoder import PerceiverEncoder
5+
from ocean_emulators.models.modules.encoder import PerceiverEncoder, patch_from
66

77
LATENT_DIM = 4
88

@@ -84,3 +84,21 @@ def test_makes_patches__more_variables():
8484
patches = encoder(prog, boundary, make_resolution(prog))
8585

8686
assert patches.shape == (1, embed_dim, 1, 2)
87+
88+
89+
def test_patch_from__full_globe():
90+
# Full globe extent should equal grid dimensions
91+
patch_h, patch_w = patch_from(
92+
patch_extent=(180.0, 360.0), input_height=4, input_width=8
93+
)
94+
assert patch_h == 4
95+
assert patch_w == 8
96+
97+
98+
def test_patch_from__half_extent():
99+
# Half the extent should give half the patch size
100+
patch_h, patch_w = patch_from(
101+
patch_extent=(90.0, 180.0), input_height=4, input_width=8
102+
)
103+
assert patch_h == 2
104+
assert patch_w == 4

0 commit comments

Comments
 (0)