Spaces:
Sleeping
Sleeping
Merge branch 'main' of https://huggingface.co/spaces/alexsoleg/cartnet-demo into main
Browse files
main.py
CHANGED
@@ -34,21 +34,15 @@ def main():
|
|
34 |
atoms = read(filename, format="cif")
|
35 |
cif = ReadCif(filename)
|
36 |
cif_data = cif.first_block()
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
# elif "_cell_measurement_temperature" in cif_data.keys():
|
47 |
-
# temperature = float(cif_data["_cell_measurement_temperature"].split("(")[0])
|
48 |
-
# else:
|
49 |
-
# raise ValueError("Temperature not found in the CIF file. \
|
50 |
-
# Please provide a temperature in the field _diffrn_ambient_temperature o in the field _cell_measurement_temperature from the CIF file.")
|
51 |
-
# st.success("CIF file successfully read.")
|
52 |
|
53 |
data = Data()
|
54 |
data.x = torch.tensor(atoms.get_atomic_numbers(), dtype=torch.int32)
|
|
|
34 |
atoms = read(filename, format="cif")
|
35 |
cif = ReadCif(filename)
|
36 |
cif_data = cif.first_block()
|
37 |
+
|
38 |
+
if "_diffrn_ambient_temperature" in cif_data.keys():
|
39 |
+
temperature = float(cif_data["_diffrn_ambient_temperature"].split("(")[0])
|
40 |
+
elif "_cell_measurement_temperature" in cif_data.keys():
|
41 |
+
temperature = float(cif_data["_cell_measurement_temperature"].split("(")[0])
|
42 |
+
else:
|
43 |
+
raise ValueError("Temperature not found in the CIF file. \
|
44 |
+
Please provide a temperature in the field _diffrn_ambient_temperature o in the field _cell_measurement_temperature from the CIF file.")
|
45 |
+
st.success("CIF file successfully read.")
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
data = Data()
|
48 |
data.x = torch.tensor(atoms.get_atomic_numbers(), dtype=torch.int32)
|