-
Couldn't load subscription status.
- Fork 23
search script NO_JIRA #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
flake8
🚫 [flake8] <302> reported by reviewdog 🐶
expected 2 blank lines, found 1
| def run_search(interface=None): |
blank line contains whitespace
🚫 [flake8] <266> reported by reviewdog 🐶
too many leading '#' for block comment
| ## open a GUI dialog asking for the search query. |
trailing whitespace
| interface.show_script_error('''Nothing was given to search for. Please enter either one number |
blank line contains whitespace
🚫 [flake8] <222> reported by reviewdog 🐶
multiple spaces after operator
| query_report += f"Pore Total Surface Area (Å^2) {tsa[0]}-{tsa[1]} <br>" |
blank line contains whitespace
🚫 [flake8] <222> reported by reviewdog 🐶
multiple spaces after operator
| query_report += f"Pore Total Geometric Volume (Å^3): {tgv[0]}-{tgv[1]} <br>" |
🚫 [flake8] <231> reported by reviewdog 🐶
missing whitespace after ','
| pld = query_string_to_tuple(void_search_dict["pore_limiting_diameter"],200.0) |
🚫 [flake8] <222> reported by reviewdog 🐶
multiple spaces after operator
| query_report += f"Pore Limiting Diameter (Å): {pld[0]}-{pld[1]} <br>" |
🚫 [flake8] <231> reported by reviewdog 🐶
missing whitespace after ','
| pmd = query_string_to_tuple(void_search_dict["max_pore_diameter"],200.0) |
🚫 [flake8] <222> reported by reviewdog 🐶
multiple spaces after operator
| query_report += f"Pore Maximum Diameter (Å): {pmd[0]}-{pmd[1]} <br>" |
🚫 [flake8] <231> reported by reviewdog 🐶
missing whitespace after ','
| npd = query_string_to_tuple(void_search_dict["num_percolated_dimensions"],3.1) |
🚫 [flake8] <222> reported by reviewdog 🐶
multiple spaces after operator
| query_report += f"Number of Percolated Dimensions: {npd[0]}-{npd[1]} <br>" |
trailing whitespace
| "Pore Total Surface Area (\u212b^2)", |
trailing whitespace
| 'Chemical Name(s)', |
trailing whitespace
| tsv_file.write_row([h.identifier, |
blank line contains whitespace
trailing whitespace
| title="Voids_search", |
trailing whitespace
| More information on the pore calculations is available here: |
[flake8] <401> reported by reviewdog 🐶
'tkinter.Tk' imported but unused
| from tkinter import Tk, Text, TOP, BOTH, X, N, LEFT, RIGHT |
[flake8] <401> reported by reviewdog 🐶
'tkinter.Text' imported but unused
| from tkinter import Tk, Text, TOP, BOTH, X, N, LEFT, RIGHT |
[flake8] <401> reported by reviewdog 🐶
'tkinter.TOP' imported but unused
| from tkinter import Tk, Text, TOP, BOTH, X, N, LEFT, RIGHT |
[flake8] <401> reported by reviewdog 🐶
'tkinter.N' imported but unused
| from tkinter import Tk, Text, TOP, BOTH, X, N, LEFT, RIGHT |
[flake8] <401> reported by reviewdog 🐶
'tkinter.RIGHT' imported but unused
| from tkinter import Tk, Text, TOP, BOTH, X, N, LEFT, RIGHT |
🚫 [flake8] <128> reported by reviewdog 🐶
continuation line under-indented for visual indent
| "total_geometric_volume": "Pore Total Geometric Volume (Å^3)", |
🚫 [flake8] <128> reported by reviewdog 🐶
continuation line under-indented for visual indent
| "pore_limiting_diameter": "Pore Limiting Diameter (Å)", |
trailing whitespace
| "pore_limiting_diameter": "Pore Limiting Diameter (Å)", |
🚫 [flake8] <128> reported by reviewdog 🐶
continuation line under-indented for visual indent
| "max_pore_diameter":"Pore Maximum Diameter (Å)", |
🚫 [flake8] <231> reported by reviewdog 🐶
missing whitespace after ':'
| "max_pore_diameter":"Pore Maximum Diameter (Å)", |
trailing whitespace
| "max_pore_diameter":"Pore Maximum Diameter (Å)", |
🚫 [flake8] <128> reported by reviewdog 🐶
continuation line under-indented for visual indent
| "num_percolated_dimensions":"Number of Percolated Dimensions"} |
🚫 [flake8] <231> reported by reviewdog 🐶
missing whitespace after ':'
| "num_percolated_dimensions":"Number of Percolated Dimensions"} |
🚫 [flake8] <302> reported by reviewdog 🐶
expected 2 blank lines, found 1
| class VoidDialog(Frame): |
🚫 [flake8] <231> reported by reviewdog 🐶
missing whitespace after ','
| [self.generate_entry(text, output) for text,output in zip(pore_query_dict.values(), self.outputs)] |
blank line contains whitespace
blank line contains whitespace
blank line contains whitespace
🚫 [flake8] <231> reported by reviewdog 🐶
missing whitespace after ':'
| vars = {k:v for k,v in zip(pore_query_dict.keys(), app.outputs)} |
🚫 [flake8] <231> reported by reviewdog 🐶
missing whitespace after ','
| vars = {k:v for k,v in zip(pore_query_dict.keys(), app.outputs)} |
🚫 [flake8] <722> reported by reviewdog 🐶
do not use bare 'except'
| except: |
🚫 [flake8] <251> reported by reviewdog 🐶
unexpected spaces around keyword / parameter equals
| def query_string_to_tuple(query_string, default_upper_limit = 9999.9): |
🚫 [flake8] <251> reported by reviewdog 🐶
unexpected spaces around keyword / parameter equals
| def query_string_to_tuple(query_string, default_upper_limit = 9999.9): |
🚫 [flake8] <231> reported by reviewdog 🐶
missing whitespace after ','
| elif query_string in ("0","0.0"): |
blank line contains whitespace
🚫 [flake8] <225> reported by reviewdog 🐶
missing whitespace around operator
| if ll!="": |
trailing whitespace
| lower_limit = 0.0 |
🚫 [flake8] <225> reported by reviewdog 🐶
missing whitespace around operator
| if ul!="": |
blank line contains whitespace
🚫 [flake8] <302> reported by reviewdog 🐶
expected 2 blank lines, found 1
| def convert_to_ascii(text): |
🚫 [flake8] <302> reported by reviewdog 🐶
expected 2 blank lines, found 1
| def run_search(interface=None): |
blank line contains whitespace
🚫 [flake8] <266> reported by reviewdog 🐶
too many leading '#' for block comment
| ## open a GUI dialog asking for the search query. |
trailing whitespace
| interface.show_script_error('''Nothing was given to search for. Please enter either one number |
blank line contains whitespace
🚫 [flake8] <222> reported by reviewdog 🐶
multiple spaces after operator
| query_report += f"Pore Total Surface Area (Å^2) {tsa[0]}-{tsa[1]} <br>" |
blank line contains whitespace
🚫 [flake8] <222> reported by reviewdog 🐶
multiple spaces after operator
| query_report += f"Pore Total Geometric Volume (Å^3): {tgv[0]}-{tgv[1]} <br>" |
🚫 [flake8] <231> reported by reviewdog 🐶
missing whitespace after ','
| pld = query_string_to_tuple(void_search_dict["pore_limiting_diameter"],200.0) |
🚫 [flake8] <222> reported by reviewdog 🐶
multiple spaces after operator
| query_report += f"Pore Limiting Diameter (Å): {pld[0]}-{pld[1]} <br>" |
🚫 [flake8] <231> reported by reviewdog 🐶
missing whitespace after ','
| pmd = query_string_to_tuple(void_search_dict["max_pore_diameter"],200.0) |
🚫 [flake8] <222> reported by reviewdog 🐶
multiple spaces after operator
| query_report += f"Pore Maximum Diameter (Å): {pmd[0]}-{pmd[1]} <br>" |
🚫 [flake8] <231> reported by reviewdog 🐶
missing whitespace after ','
| npd = query_string_to_tuple(void_search_dict["num_percolated_dimensions"],3.1) |
🚫 [flake8] <222> reported by reviewdog 🐶
multiple spaces after operator
| query_report += f"Number of Percolated Dimensions: {npd[0]}-{npd[1]} <br>" |
trailing whitespace
| "Pore Total Surface Area (\u212b^2)", |
trailing whitespace
| 'Chemical Name(s)', |
trailing whitespace
| tsv_file.write_row([h.identifier, |
blank line contains whitespace
trailing whitespace
| title="Voids_search", |
trailing whitespace
| More information on the pore calculations is available here: |
|
@kback-ccdc could you add a ReadMe.md to this folder so it follows the same requirements as the rest of the scripts on this repo and then also edit https://github.com/ccdc-opensource/csd-python-api-scripts/blob/main/scripts/ReadMe.md with a short description please? |
| elif query_string in ("0","0.0"): | ||
| ll, ul = 0.0, 0.1 | ||
| else: | ||
| ll, ul = float(query_string)*0.95, float(query_string)*1.05 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree - I'll add something. It's still going to be that way under the hood - just makes it easier than figuring out inclusive / exclusive ranges in sql, but the report will be clean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor request for now. If the ReadMe has additional info on expected behaviour I might have more comments
…ou check this is what you were try/excepting for, testing seems fine NO_JIRA
basic Readme added, Pablo, please have a look and feel free to raise request again
lines 201 - 204 , searches the right field now, and all have rounding included
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and fairly well tested by me. CK says he wants to add something for percolated dimensions at Pablo's request, but I'd be happy to merge before the webinar and add stuff like that later



Adding Chris Kingsbury's Void Search script to the opensource repo for next week's webinar