18
18
import base64
19
19
import json
20
20
import numpy as np
21
+ import matplotlib .pyplot as plt
22
+ from matplotlib .patches import Rectangle
21
23
22
24
README_LINK = f"""{ Path (os .path .dirname (__file__ )) / "ReadMe.md" } """
23
25
README_LINK = "https://downloads.ccdc.cam.ac.uk/documentation/API/descriptive_docs/predicted_properties.html"
24
26
25
27
default_settings = {}
26
28
27
- import matplotlib .pyplot as plt
28
- from matplotlib .patches import Rectangle
29
-
30
29
31
30
def plot_hist (descs_data , astype = "fig" ):
32
31
data_hlt = {
@@ -92,19 +91,15 @@ def write_descs_report(settings=default_settings):
92
91
entry = semiconductor_entry_reader .entry (interface .identifier )
93
92
entry = interface .current_entry
94
93
properties = entry .predicted_properties
95
- print (properties )
96
- # output.write(entry.identifier)
97
- if (properties .semiconductor_properties == None ):
98
- # if "semiconductor_properties" not in dir(properties):
94
+ output = open ("output.txt" , "a" )
95
+ if (properties .semiconductor_properties is None ):
99
96
interface .write_report (title = "Data not found" )
100
97
output = open ("output.txt" , "a" )
101
- output .write ("%s, %s, %s, No data here \n " % (str (properties ),entry .identifier , str (properties .semiconductor_properties )))
102
- # output.write("")
98
+ output .write ("%s, %s, %s, No data here \n " % (str (properties ), entry .identifier , str (properties .semiconductor_properties )))
103
99
return None
104
100
105
101
descs_data = properties .semiconductor_properties
106
- output = open ("output.txt" , "a" )
107
- output .write ("%s, %s, %s, data here \n " % (str (properties ),entry .identifier , str (properties .semiconductor_properties )))
102
+ output .write ("%s, %s, %s, data here \n " % (str (properties ), entry .identifier , str (properties .semiconductor_properties )))
108
103
with open (interface .output_html_file , "w" ) as report :
109
104
110
105
tl = Template (
@@ -115,7 +110,7 @@ def write_descs_report(settings=default_settings):
115
110
)
116
111
report .write (
117
112
tl .render (
118
- ident = interface .identifier , data = descs_data , readme_link = README_LINK , image = plot_hist (descs_data , "buf" )
113
+ ident = interface .identifier , data = descs_data , readme_link = README_LINK , image = plot_hist (descs_data , "buf" )
119
114
)
120
115
)
121
116
0 commit comments