Skip to content

search script NO_JIRA - #82

Merged
kback-ccdc merged 10 commits into
mainfrom
Void_NO_JIRA
Jul 21, 2025
Merged

search script NO_JIRA#82
kback-ccdc merged 10 commits into
mainfrom
Void_NO_JIRA

Conversation

@kback-ccdc

Copy link
Copy Markdown
Contributor

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

@github-actionsgithub-actionsBot left a comment

Copy link
Copy Markdown
Contributor

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

defrun_search(interface=None):


⚠️[flake8] <293> reported by reviewdog 🐶
blank line contains whitespace


🚫 [flake8] <266> reported by reviewdog 🐶
too many leading '#' for block comment

## open a GUI dialog asking for the search query.


⚠️[flake8] <291> reported by reviewdog 🐶
trailing whitespace

interface.show_script_error('''Nothing was given to search for. Please enter either one number


⚠️[flake8] <293> reported by reviewdog 🐶
blank line contains whitespace


🚫 [flake8] <222> reported by reviewdog 🐶
multiple spaces after operator

query_report+=f"Pore Total Surface Area (&#8491;^2) {tsa[0]}-{tsa[1]} <br>"


⚠️[flake8] <293> reported by reviewdog 🐶
blank line contains whitespace


🚫 [flake8] <222> reported by reviewdog 🐶
multiple spaces after operator

query_report+=f"Pore Total Geometric Volume (&#8491;^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 (&#8491;): {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 (&#8491;): {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>"


⚠️[flake8] <291> reported by reviewdog 🐶
trailing whitespace

"Pore Total Surface Area (\u212b^2)",


⚠️[flake8] <291> reported by reviewdog 🐶
trailing whitespace


⚠️[flake8] <291> reported by reviewdog 🐶
trailing whitespace

tsv_file.write_row([h.identifier,


⚠️[flake8] <293> reported by reviewdog 🐶
blank line contains whitespace


⚠️[flake8] <291> reported by reviewdog 🐶
trailing whitespace


⚠️[flake8] <291> reported by reviewdog 🐶
trailing whitespace

More information on the pore calculations is available here:


[flake8] <401> reported by reviewdog 🐶
'tkinter.Tk' imported but unused

fromtkinterimportTk, Text, TOP, BOTH, X, N, LEFT, RIGHT


[flake8] <401> reported by reviewdog 🐶
'tkinter.Text' imported but unused

fromtkinterimportTk, Text, TOP, BOTH, X, N, LEFT, RIGHT


[flake8] <401> reported by reviewdog 🐶
'tkinter.TOP' imported but unused

fromtkinterimportTk, Text, TOP, BOTH, X, N, LEFT, RIGHT


[flake8] <401> reported by reviewdog 🐶
'tkinter.N' imported but unused

fromtkinterimportTk, Text, TOP, BOTH, X, N, LEFT, RIGHT


[flake8] <401> reported by reviewdog 🐶
'tkinter.RIGHT' imported but unused

fromtkinterimportTk, 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 (Å)",


⚠️[flake8] <291> reported by reviewdog 🐶
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 (Å)",


⚠️[flake8] <291> reported by reviewdog 🐶
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


🚫 [flake8] <231> reported by reviewdog 🐶
missing whitespace after ','

[self.generate_entry(text, output) fortext,outputinzip(pore_query_dict.values(), self.outputs)]


⚠️[flake8] <293> reported by reviewdog 🐶
blank line contains whitespace


⚠️[flake8] <293> reported by reviewdog 🐶
blank line contains whitespace


⚠️[flake8] <293> reported by reviewdog 🐶
blank line contains whitespace


🚫 [flake8] <231> reported by reviewdog 🐶
missing whitespace after ':'

vars= {k:vfork,vinzip(pore_query_dict.keys(), app.outputs)}


🚫 [flake8] <231> reported by reviewdog 🐶
missing whitespace after ','

vars= {k:vfork,vinzip(pore_query_dict.keys(), app.outputs)}


🚫 [flake8] <722> reported by reviewdog 🐶
do not use bare 'except'


🚫 [flake8] <251> reported by reviewdog 🐶
unexpected spaces around keyword / parameter equals

defquery_string_to_tuple(query_string, default_upper_limit=9999.9):


🚫 [flake8] <251> reported by reviewdog 🐶
unexpected spaces around keyword / parameter equals

defquery_string_to_tuple(query_string, default_upper_limit=9999.9):


🚫 [flake8] <231> reported by reviewdog 🐶
missing whitespace after ','

elifquery_stringin ("0","0.0"):


⚠️[flake8] <293> reported by reviewdog 🐶
blank line contains whitespace


🚫 [flake8] <225> reported by reviewdog 🐶
missing whitespace around operator


⚠️[flake8] <291> reported by reviewdog 🐶
trailing whitespace


🚫 [flake8] <225> reported by reviewdog 🐶
missing whitespace around operator


⚠️[flake8] <293> reported by reviewdog 🐶
blank line contains whitespace


🚫 [flake8] <302> reported by reviewdog 🐶
expected 2 blank lines, found 1


🚫 [flake8] <302> reported by reviewdog 🐶
expected 2 blank lines, found 1

defrun_search(interface=None):


⚠️[flake8] <293> reported by reviewdog 🐶
blank line contains whitespace


🚫 [flake8] <266> reported by reviewdog 🐶
too many leading '#' for block comment

## open a GUI dialog asking for the search query.


⚠️[flake8] <291> reported by reviewdog 🐶
trailing whitespace

interface.show_script_error('''Nothing was given to search for. Please enter either one number


⚠️[flake8] <293> reported by reviewdog 🐶
blank line contains whitespace


🚫 [flake8] <222> reported by reviewdog 🐶
multiple spaces after operator

query_report+=f"Pore Total Surface Area (&#8491;^2) {tsa[0]}-{tsa[1]} <br>"


⚠️[flake8] <293> reported by reviewdog 🐶
blank line contains whitespace


🚫 [flake8] <222> reported by reviewdog 🐶
multiple spaces after operator

query_report+=f"Pore Total Geometric Volume (&#8491;^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 (&#8491;): {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 (&#8491;): {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>"


⚠️[flake8] <291> reported by reviewdog 🐶
trailing whitespace

"Pore Total Surface Area (\u212b^2)",


⚠️[flake8] <291> reported by reviewdog 🐶
trailing whitespace


⚠️[flake8] <291> reported by reviewdog 🐶
trailing whitespace

tsv_file.write_row([h.identifier,


⚠️[flake8] <293> reported by reviewdog 🐶
blank line contains whitespace


⚠️[flake8] <291> reported by reviewdog 🐶
trailing whitespace


⚠️[flake8] <291> reported by reviewdog 🐶
trailing whitespace

More information on the pore calculations is available here:

@pmbulit

Copy link
Copy Markdown
Member

@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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image I think this shouldn't apply to percolated dimensions

Copy link
Copy Markdown
Contributor

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

pmbulit
pmbulit previously requested changes Jul 18, 2025

@pmbulitpmbulit left a comment

Copy link
Copy Markdown
Member

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

@IsaacSugden
IsaacSugden dismissed pmbulit’s stale reviewJuly 18, 2025 16:34

basic Readme added, Pablo, please have a look and feel free to raise request again

ckingsbury-ccdcand others added 2 commits July 20, 2025 23:18
lines 201 - 204 , searches the right field now, and all have rounding included
@sonarqubecloud

Copy link
Copy Markdown

@IsaacSugdenIsaacSugden left a comment

Copy link
Copy Markdown
Contributor

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

@kback-ccdc
kback-ccdc merged commit 741178f into mainJul 21, 2025
6 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@kback-ccdc@pmbulit@IsaacSugden@ckingsbury-ccdc