Topological String Theory on Compact Calabi–Yau: Modularity and Boundary Conditions