Skip to content

Commit 12ca9ed

Browse files
committed
Add temporary test script
1 parent 38aa8e0 commit 12ca9ed

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

tmp/__validator.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# %%
2+
import easydiffraction as ed
3+
import numpy as np
4+
5+
# %%
6+
project = ed.Project()
7+
8+
# %%
9+
model_path = ed.download_data(id=1, destination='data')
10+
project.sample_models.add(cif_path=model_path)
11+
12+
# %%
13+
expt_path = ed.download_data(id=2, destination='data')
14+
project.experiments.add(cif_path=expt_path)
15+
16+
# %%
17+
#sample = project.sample_models.get(id=1)
18+
#sample = project.sample_models.get(name='Fe2O3')
19+
sample = project.sample_models['lbco']
20+
21+
# %%
22+
print()
23+
print("=== Testing cell.length_a ===")
24+
sample.cell.length_a = 3
25+
print(sample.cell.length_a, type(sample.cell.length_a.value))
26+
sample.cell.length_a = np.int64(4)
27+
print(sample.cell.length_a, type(sample.cell.length_a.value))
28+
sample.cell.length_a = np.float64(5.5)
29+
print(sample.cell.length_a, type(sample.cell.length_a.value))
30+
###sample.cell.length_a = "6.0"
31+
###sample.cell.length_a = -7.0
32+
###sample.cell.length_a = None
33+
print(sample.cell.length_a, type(sample.cell.length_a.value))
34+
35+
# %%
36+
print()
37+
print("=== Testing space_group ===")
38+
sample.space_group.name_h_m = 'P n m a'
39+
print(sample.space_group.name_h_m)
40+
print(sample.space_group.it_coordinate_system_code)
41+
###sample.space_group.name_h_m = 'P x y z'
42+
print(sample.space_group.name_h_m)
43+
###sample.space_group.name_h_m = 4500
44+
print(sample.space_group.name_h_m)
45+
sample.space_group.it_coordinate_system_code = 'cab'
46+
print(sample.space_group.it_coordinate_system_code)
47+
48+
# %%
49+
print()
50+
print("=== Testing atom_sites ===")
51+
sample.atom_sites.add(label2='O5', type_symbol='O')
52+
53+
# %%
54+
sample.show_as_cif()

0 commit comments

Comments
 (0)