Files
Calabi-Yau-Period-Geometry/tests/test_smoke.py
T
Julian Piribauer ece770ab48
CI / lint (push) Failing after 3s
CI / test (push) Skipped
Setting up a pipeline
2026-07-24 21:03:04 +02:00

33 lines
960 B
Python

import os
import pytest
from sage.all import * # noqa: F401,F403
load(os.path.join(os.path.dirname(__file__), "..", "sage", "toric_topdata.sage"))
def test_polytope_rejects_too_few_points():
with pytest.raises(ValueError):
Polytope([[0, 0], [1, 0]]) # 2 points in dimension 2: not enough
def test_mirror_quintic_topdata():
# Vertices e_1, ..., e_4, -e_1-...-e_4 -- the worked example from
# ToricPolytope's own docstring.
points = [
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1],
[-1, -1, -1, -1],
]
polytope = ToricPolytope(points, model_name="ci_smoke_test_quintic")
assert polytope.dimension == 4
assert len(polytope.triangulations) >= 1
polytope.topdata()
assert polytope.cy_dimension == 3
assert polytope.no_divs == 1 # P^4 has Picard rank 1
assert polytope.intersection_numbers_CY == {(0, 0, 0): 5} # classical quintic self-intersection