Skip to content

Commit 0e5aa6d

Browse files
committed
reviewdog suggested changes PPM-192
1 parent d06518a commit 0e5aa6d

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Descs Data Plot Readme
2-
only works for 2024.3 onwards, please see https://downloads.ccdc.cam.ac.uk/documentation/API/descriptive_docs/predicted_properties.html
2+
3+
Only works for 2024.3 onwards, please see <https://downloads.ccdc.cam.ac.uk/documentation/API/descriptive_docs/predicted_properties.html>
34
for more details on the properties.
4-
Will display the properties for the structure currently loaded in the Mercury window
5+
Download the whole directory and place it in the ccdc-sfotware/mercury/scripts/ folder to make use of it, it
6+
will display the properties for the structure currently loaded in the Mercury window when launched from the csd-python-api dropdown in
7+
Mercury

scripts/show_semiconductor_properties/show_semiconductor_properties.py

+7-12
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@
1818
import base64
1919
import json
2020
import numpy as np
21+
import matplotlib.pyplot as plt
22+
from matplotlib.patches import Rectangle
2123

2224
README_LINK = f"""{Path(os.path.dirname(__file__)) / "ReadMe.md"}"""
2325
README_LINK = "https://downloads.ccdc.cam.ac.uk/documentation/API/descriptive_docs/predicted_properties.html"
2426

2527
default_settings = {}
2628

27-
import matplotlib.pyplot as plt
28-
from matplotlib.patches import Rectangle
29-
3029

3130
def 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

Comments
 (0)