1818import base64
1919import json
2020import numpy as np
21+ import matplotlib .pyplot as plt
22+ from matplotlib .patches import Rectangle
2123
2224README_LINK = f"""{ Path (os .path .dirname (__file__ )) / "ReadMe.md" } """
2325README_LINK = "https://downloads.ccdc.cam.ac.uk/documentation/API/descriptive_docs/predicted_properties.html"
2426
2527default_settings = {}
2628
27- import matplotlib .pyplot as plt
28- from matplotlib .patches import Rectangle
29-
3029
3130def plot_hist (descs_data , astype = "fig" ):
3231 data_hlt = {
@@ -92,19 +91,15 @@ def write_descs_report(settings=default_settings):
9291 entry = semiconductor_entry_reader .entry (interface .identifier )
9392 entry = interface .current_entry
9493 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 ):
9996 interface .write_report (title = "Data not found" )
10097 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 )))
10399 return None
104100
105101 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 )))
108103 with open (interface .output_html_file , "w" ) as report :
109104
110105 tl = Template (
@@ -115,7 +110,7 @@ def write_descs_report(settings=default_settings):
115110 )
116111 report .write (
117112 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" )
119114 )
120115 )
121116
0 commit comments