-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_lightcone_animations_coordinates.py
More file actions
51 lines (41 loc) · 1.47 KB
/
test_lightcone_animations_coordinates.py
File metadata and controls
51 lines (41 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python
'''
Created on 28 Apr 2021
@author: Christoph Minz
@license: BSD 3-Clause
'''
from __future__ import annotations
from typing import List
import unittest
import lightcone_animations_coordinates as LAC
import numpy as np
from causets.causet import Causet
from causets.embeddedcauset import EmbeddedCauset
import causets.causetplotting as cplt
from matplotlib import pyplot as plt
class TestCauset(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_2lattice(self):
name: str
perm: List[int]
coords: List[List[float]]
name, perm, coords = LAC.get_latticeD3_slabfinf(0.3)
C: EmbeddedCauset = EmbeddedCauset(coordinates=coords)
# cplt.plot(C, dims=[1, 2, 0], labels=True,
# axislim={'xlim': [-1.0, 1.0], 'ylim': [-1.0, 1.0],
# 'zlim': [-1.0, 1.0]})
cplt.plotDiagram([C.find(i) for i in perm], perm,
labels=True, links={'linewidth': 1.5, 'alpha': 0.5},
axislim={'xlim': [-1.0, 1.0], 'ylim': [-1.0, 1.0]})
plt.show()
# print links:
L: np.ndarray = C.LinkFutureMatrix(C.sortedByLabels())
n: int = L.shape[1]
s: str = ''.join([f'{i + 1}/{j + 1},' for i in range(n)
for j in range(n) if L[i, j]])
print(s)
if __name__ == '__main__':
unittest.main()