Skip to content

NO_JIRA Open source clean up - #93

Open
CRingroseCCDC wants to merge 1 commit into
mainfrom
structure_update
Open

NO_JIRA Open source clean up#93
CRingroseCCDC wants to merge 1 commit into
mainfrom
structure_update

Conversation

@CRingroseCCDC

Copy link
Copy Markdown
Contributor
  • Created file structure based on licence.
  • Updated some scripts for PEP8 compliance.
  • Changed any http links to https.
  • Improved comments and docstrings for clarity, particularly in popular/underused scripts.

Only scripts directory has been altered, except for link changes (http to https)

… for PEP8 compliance. Changed any http links to https. Improved comments and docstrings for clarity.

"""
This script will generate a generic Gaussian input file
Input: CSD Identifier as a string or .mol2

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.

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

# Crystal structure file
crystal_1 = CrystalReader(crystal_id)
crystal = crystal_1[0]
except:

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.

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

raise RuntimeError("Error in reading crystal structure input.\nPlease enter a CSD refcode or provide the path to your crystal structure file")
else:
try:
# CSD refcode

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.

🚫 [flake8] <115> reported by reviewdog 🐶
expected an indented block (comment)

try:
# CSD refcode
crystal = CrystalReader('CSD').crystal(crystal_id)
except:

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.

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

hkl = all_hkl[i]
rug_list = []

# check rugosity of crystal plane at 0, 0.25, 0.5, and 0.75 offset from origin

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.

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


"""
This script will generate a generic Gaussian input file
Input: CSD Identifier as a string or .mol2

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.

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

# Crystal structure file
crystal_1 = CrystalReader(crystal_id)
crystal = crystal_1[0]
except:

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.

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

raise RuntimeError("Error in reading crystal structure input.\nPlease enter a CSD refcode or provide the path to your crystal structure file")
else:
try:
# CSD refcode

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.

🚫 [flake8] <115> reported by reviewdog 🐶
expected an indented block (comment)

try:
# CSD refcode
crystal = CrystalReader('CSD').crystal(crystal_id)
except:

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.

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

hkl = all_hkl[i]
rug_list = []

# check rugosity of crystal plane at 0, 0.25, 0.5, and 0.75 offset from origin

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.

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

This is a short script to generate conformers with some rudimentary analysis for a single molecule.
There are also options to overlay the results to view in Hermes.

### Example output showing what the user can expect to see:

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.

[markdownlint]reported by reviewdog 🐶
MD001/heading-increment Heading levels should only increment by one level at a time [Expected: h2; Actual: h3]

This is a short script to generate conformers with some rudimentary analysis for a single molecule.
There are also options to overlay the results to view in Hermes.

### Example output showing what the user can expect to see:

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.

[markdownlint]reported by reviewdog 🐶
MD026/no-trailing-punctuation Trailing punctuation in heading [Punctuation: ':']


### Example output showing what the user can expect to see:

```

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.

[markdownlint]reported by reviewdog 🐶
MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]


Chris Ringrose - 22/11/24

For feedback or to report any issues please contact support@ccdc.cam.ac.uk

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.

[markdownlint]reported by reviewdog 🐶
MD046/code-block-style Code block style [Expected: fenced; Actual: indented]


## Instructions on Running

Script can be run with any multimolecule file e.g. sdf.

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.

[markdownlint]reported by reviewdog 🐶
MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]


```cmd
python find_binding_conformation.py pdb_example.txt
```

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.

[markdownlint]reported by reviewdog 🐶
MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```"]

python find_binding_conformation.py pdb_example.txt
```
## Author
## Authors

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.

[markdownlint]reported by reviewdog 🐶
MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Above] [Context: "## Authors"]

python find_binding_conformation.py pdb_example.txt
```
## Author
## Authors

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.

[markdownlint]reported by reviewdog 🐶
MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## Authors"]

```
## Author
## Authors
_'Brandl, Giangreco, Higueruelo, Schaerfer and Sykes'_

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.

[markdownlint]reported by reviewdog 🐶
MD036/no-emphasis-as-heading Emphasis used instead of a heading [Context: "'Brandl, Giangreco, Higueruelo..."]

## Authors
_'Brandl, Giangreco, Higueruelo, Schaerfer and Sykes'_


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.

[markdownlint]reported by reviewdog 🐶
MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]

This is a short script to generate conformers with some rudimentary analysis for a single molecule.
There are also options to overlay the results to view in Hermes.

### Example output showing what the user can expect to see:

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.

[markdownlint-fix]reported by reviewdog 🐶

Suggested change
### Example output showing what the user can expect to see:
### Example output showing what the user can expect to see


## Instructions on Running

Script can be run with any multimolecule file e.g. sdf.

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.

[markdownlint-fix]reported by reviewdog 🐶

Suggested change
Script can be run with any multimolecule file e.g. sdf.
Script can be run with any multimolecule file e.g. sdf.

Comment on lines 21 to 23
* -h, --help; Show this help message and exit
* -m {absolute,relative}, --mode; Limit mode: absolute (fixed threshold) or relative (threshold based on
molecule with fewest unusual torsions). WARNING: Relative mode may behave unexpectedly with conformers from

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.

[markdownlint-fix]reported by reviewdog 🐶

Suggested change
* -h, --help; Show this help message and exit
* -m {absolute,relative}, --mode; Limit mode: absolute (fixed threshold) or relative (threshold based on
molecule with fewest unusual torsions). WARNING: Relative mode may behave unexpectedly with conformers from
- -h, --help; Show this help message and exit
- -m {absolute,relative}, --mode; Limit mode: absolute (fixed threshold) or relative (threshold based on
molecule with fewest unusual torsions). WARNING: Relative mode may behave unexpectedly with conformers from

@@ -3,21 +3,28 @@
This is a short script to filter molecular poses in a multi-molecule file based on the torsion probabilities.

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.

[markdownlint-fix]reported by reviewdog 🐶

Suggested change
This is a short script to filter molecular poses in a multi-molecule file based on the torsion probabilities.
This is a short script to filter molecular poses in a multi-molecule file based on the torsion probabilities.

Script can be run with any multimolecule file e.g. sdf.

positional arguments:
* input file; Input file (multi-molecule file).

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.

[markdownlint-fix]reported by reviewdog 🐶

Suggested change
* input file; Input file (multi-molecule file).
* input file; Input file (multi-molecule file).


C. Kingsbury 2024

For feedback or to report any issues please contact [support@ccdc.cam.ac.uk](mailto:support@ccdc.cam.ac.uk) No newline at end of file

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.

[markdownlint-fix]reported by reviewdog 🐶

Suggested change
For feedback or to report any issues please contact [support@ccdc.cam.ac.uk](mailto:support@ccdc.cam.ac.uk)
For feedback or to report any issues please contact [support@ccdc.cam.ac.uk](mailto:support@ccdc.cam.ac.uk)


## Instructions on Running
Using the [activated CSD Python API environment](../../README.md#running-scripts-through-the-csd-python-api-miniconda-installed)
Using the [activated CSD Python API environment](../../../README.md#running-scripts-through-the-csd-python-api-miniconda-installed)

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.

[markdownlint-fix]reported by reviewdog 🐶

Suggested change
Using the [activated CSD Python API environment](../../../README.md#running-scripts-through-the-csd-python-api-miniconda-installed)
Using the [activated CSD Python API environment](../../../README.md#running-scripts-through-the-csd-python-api-miniconda-installed)

python find_binding_conformation.py pdb_example.txt
```
## Author
## Authors

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.

[markdownlint-fix]reported by reviewdog 🐶

Suggested change
## Authors
## Authors

```
## Author
## Authors
_'Brandl, Giangreco, Higueruelo, Schaerfer and Sykes'_

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.

[markdownlint-fix]reported by reviewdog 🐶

Suggested change
_'Brandl, Giangreco, Higueruelo, Schaerfer and Sykes'_

## Authors
_'Brandl, Giangreco, Higueruelo, Schaerfer and Sykes'_


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.

[markdownlint-fix]reported by reviewdog 🐶

Suggested change
_'Brandl, Giangreco, Higueruelo, Schaerfer and Sykes'_

@sonarqubecloud

Copy link
Copy Markdown

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.

[markdownlint-fix]reported by reviewdog 🐶

* -l, --limit; Maximum number of unusual torsions for a passing molecule (default: 0)
* -d, --local-density; Local density threshold for classifying a torsion as unusual (default: 10.0)
* --incl-organometallics; Include organometallic compounds in the search (default: organic compounds only)
* --generalisation; Turn on generalisation for searches
* --successfn; Output file for molecules that pass the filter (default: successes.mol)
* --failurefn; Output file for molecules that fail the filter (default: failures.mol)
* -u, --unusual-torsions; Output CSV file for unusual torsion details (default: unusual_torsions.csv)

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR performs an “open source clean up” across the repository, primarily reorganising the scripts/ tree into clearer categories, adding/refreshing per-script documentation, and standardising embedded URLs from http to https across scripts, notebooks, and examples.

Changes:

  • Reorganise scripts into a clearer folder structure (e.g. scripts/core, scripts/discovery, scripts/materials, etc.) and add/update many script-level ReadMe.md files.
  • Update numerous URLs from http to https across scripts, notebooks, config/docs, and example assets.
  • Refactor/PEP8 cleanups in several scripts and introduce some new utilities/examples (e.g. GOLD multiprocessing example, conformer filtering tools).

Reviewed changes

Copilot reviewed 78 out of 121 changed files in this pull request and generated 4 comments.

Show a summary per file
FileDescription
scripts/show_semiconductor_properties/ReadMe.mdRemoved old README (content moved under scripts/core/show_semiconductor_properties/).
scripts/ReadMe.mdReorganises top-level scripts index into categories.
scripts/particle/surface_charge/surface_charge.pyUpdates licence URL to https.
scripts/particle/surface_charge/surface_charge_calculator.pyUpdates licence URL to https.
scripts/particle/surface_charge/ReadMe.mdAdjusts CLI usage snippet formatting.
scripts/particle/surface_charge/assets/adding_location.pngAdds/updates image asset.
scripts/particle/particle_rugosity/ReadMe.mdNew README for particle rugosity script.
scripts/particle/particle_rugosity/particle_rugosity.pyNew/relocated particle rugosity script.
scripts/particle/november_2023_morphology_webinar/ReadMe.mdMinor formatting cleanup.
scripts/particle/november_2023_morphology_webinar/morphology_plot.pyUpdates licence URL to https.
scripts/particle/november_2023_morphology_webinar/exploring_surface_properties.pyUpdates licence URL to https and whitespace cleanup.
scripts/particle/november_2023_morphology_webinar/calculate_morphologies_tabulate_output.pyConsolidates imports + licence URL https.
scripts/particle_rugosity/particle_rugosity.pyRemoves old location of particle rugosity script.
scripts/new_script_readme_template/script_example.pyUpdates licence URL to https.
scripts/multi_component_hydrogen_bond_propensity/mol2smiles.pyRemoves script from this location (cleanup/restructure).
scripts/materials/packing_similarity_dendrogram/ReadMe.mdAdds a new detailed README for packing dendrogram tool.
scripts/materials/packing_similarity_dendrogram/packing_similarity_dendogram.pyUpdates licence URL to https.
scripts/materials/multi_component_hydrogen_bond_propensity/ReadMe.mdAdds README for multi-component HBP script.
scripts/materials/multi_component_hydrogen_bond_propensity/multi_component_hydrogen_bond_propensity_report.pyDocstring/comment cleanups + licence URL https.
scripts/discovery/gold_multi/target/ligand.mol2Adds example ligand input for GOLD multiprocessing demo.
scripts/discovery/gold_multi/ReadMe.mdAdds documentation for GOLD multiprocessing example.
scripts/discovery/gold_multi/gold.confAdds example GOLD configuration.
scripts/discovery/gold_multi/gold_multi.pyRefactors and reformats GOLD multiprocessing script.
scripts/discovery/gold_multi/.gitignoreAdds ignore rules for generated output while keeping target/.
scripts/discovery/find_binding_conformation/ReadMe.mdFixes relative README link and author heading.
scripts/discovery/find_binding_conformation/pdb_example.txtAdds example PDB IDs input file.
scripts/discovery/find_binding_conformation/find_binding_conformation.pyRefactors formatting + updates ligand-expo URL to https.
scripts/create_gaussian_input/create_gaussian_input.pyRemoves old script path (moved under scripts/core/create_gaussian_input/).
scripts/core/voids_search/voids_search.pyUpdates licence URL to https.
scripts/core/voids_search/Readme.mdAdds README for voids search tool.
scripts/core/show_semiconductor_properties/show_semiconductor_properties.pyLicence URL https + whitespace cleanup.
scripts/core/show_semiconductor_properties/semiconductor_template.htmlUpdates embedded namespace URLs (and other links).
scripts/core/show_semiconductor_properties/ReadMe.mdAdds README under new location.
scripts/core/show_semiconductor_properties/hist_data.jsonAdds histogram data file for semiconductor report.
scripts/core/refcodes_with_properties/test_entry_property_calculator.pyLicence URL https.
scripts/core/refcodes_with_properties/refcodes_with_properties.pyDocstring cleanup + is None usage.
scripts/core/refcodes_with_properties/ReadMe.mdAdds README for refcodes-with-properties tool.
scripts/core/refcodes_with_properties/more_elaborate_control.txtAdds example control file.
scripts/core/refcodes_with_properties/example_control_file.txtAdds example control file.
scripts/core/refcodes_with_properties/entry_property_calculator.pyRefactor filter registration and improve readability.
scripts/core/mof_solvent_removal_2017_chem_mater_publication/ReadMe.mdAdds README for MOF solvent removal scripts.
scripts/core/mof_solvent_removal_2017_chem_mater_publication/Mercury_MOF_solvent_removal.pyLicence URL https.
scripts/core/mof_solvent_removal_2017_chem_mater_publication/Command_prompt_MOF_solvent_removal.pyLicence URL https.
scripts/core/hydrogen_bond_propensity/ReadMe.mdAdds README for HBP report script.
scripts/core/hydrogen_bond_propensity/hydrogen_bond_propensity_report.pyDocstring cleanup + rename normalise function usage.
scripts/core/filter_poses/ReadMe.mdUpdates README sections/formatting.
scripts/core/filter_poses/filter_poses.pyAdds new pose-filtering tool.
scripts/core/create_gaussian_input/ReadMe.mdAdds README for Gaussian input generator.
scripts/core/create_gaussian_input/create_gaussian_input.pyAdds new location for Gaussian input generator script.
scripts/core/create_castep_input/ReadMe.mdAdds README for CASTEP input generator.
scripts/core/create_castep_input/create_castep_input.pyLicence URL https.
scripts/core/create_castep_input/assets/select_script.pngAdds/updates image asset.
scripts/core/create_castep_input/assets/file_output.pngAdds/updates image asset.
scripts/core/create_castep_input/assets/add_script_location.pngAdds/updates image asset.
scripts/core/conformer_filter_density/ReadMe.mdAdds licensing section + formatting fixes.
scripts/core/conformer_filter_density/conformer_filter_density.pyAdds new conformer torsion-density filtering tool.
scripts/core/conformer_demo/ReadMe.mdRewrites README into structured sections.
scripts/core/conformer_demo/conformer_demo.pyLicence URL https + formatting cleanup.
scripts/assorted_utilities/concat_mol2/ReadMe.mdAdds README for concat mol2 utility.
scripts/assorted_utilities/concat_mol2/concat_mol2.pyLicence URL https + minor typing/boolean simplification.
notebooks/Discovery/12_Ensemble_docking/ensemble_docking.ipynbUpdates licence URL to https.
notebooks/Discovery/11_Working_With_Proteins/3kk6.cifUpdates embedded URLs to https.
notebooks/Discovery/11_Working_With_Proteins/11_Working_With_Proteins.ipynbUpdates licence URL to https.
notebooks/Discovery/10_Editing_molecules/Editing_molecules.ipynbUpdates licence URL to https.
notebooks/Discovery/09_Covalent_Docking/10_Prochiral_Michael_Acceptors.ipynbUpdates licence URL to https.
notebooks/Discovery/09_Covalent_Docking/02b_Covalent_Complexes-substructure.ipynbUpdates licence URL to https.
notebooks/Discovery/09_Covalent_Docking/02a_Covalent_Complexes-atom.ipynbUpdates licence URL to https.
notebooks/Discovery/09_Covalent_Docking/01_Ligand_Preparation_for_Covalent_Docking.ipynbUpdates licence URL to https.
notebooks/Discovery/08_Docking/05_Parameter_tests.ipynbUpdates licence URL to https.
notebooks/Discovery/08_Docking/04_Docking_interactive_conf.ipynbUpdates licence URL to https.
notebooks/Discovery/08_Docking/03_Docking_interactive.ipynbUpdates licence URL to https.
notebooks/Discovery/08_Docking/02_Docking_background_conf.ipynbUpdates licence URL to https.
notebooks/Discovery/08_Docking/01_Docking_foreground.ipynbUpdates licence URL to https.
notebooks/Discovery/08_Docking/00b_Input_for_GOLD-RDKit.ipynbUpdates licence URL + RDKit links to https.
notebooks/Discovery/08_Docking/00a_Input_for_GOLD.ipynbUpdates licence URL + RDKit link to https.
notebooks/Discovery/07_Cavities/pdbe_get.ps1Updates PDBe download URL to https.
notebooks/Discovery/07_Cavities/Cavities.ipynbUpdates licence URL to https.
notebooks/Discovery/06_Interaction_maps/Interaction_maps.ipynbUpdates licence URL to https.
notebooks/Discovery/05_Molecular_interactions/Molecular_interactions.ipynbUpdates licence URL to https.
notebooks/Discovery/04_Conformer_generation/Conformer_generation.ipynbUpdates licence URL to https.
notebooks/Discovery/03_Molecular_geometries/Molecular_geometries.ipynbUpdates licence URL to https (+ empty code cell).
notebooks/Discovery/02_Protein_Ligand/02_API_Protein-Ligand_search_for_FAD.ipynbUpdates licence URL to https.
notebooks/Discovery/02_Protein_Ligand/01_Protein_Ligand_Searching.ipynbUpdates licence URL to https.
notebooks/Discovery/01_CSD_Search/03_MCS_searching_the_CSD.ipynbUpdates licence URL to https.
notebooks/Discovery/01_CSD_Search/02_Similarity_searching_the_CSD.ipynbUpdates licence URL to https.
notebooks/Discovery/01_CSD_Search/01_Substructure_searching_the_CSD.ipynbUpdates licence URL to https.
notebooks/Discovery/00_Background/00_Background.ipynbUpdates licence URL + RDKit link to https.
notebooks/ccdc_notebook_utilities/run_hermes.pyUpdates licence URL to https.
notebooks/ccdc_notebook_utilities/create_logger.pyUpdates licence URL to https.
notebooks/ccdc_notebook_utilities/init.pyUpdates licence URL to https.
notebooks/API_Training_Exercises/01_Simple_Report.ipynbUpdates licence URL to https.
api_paper_2024/example_5/visualiser.pyUpdates licence URL to https.
api_paper_2024/example_5/shape_classification.pyUpdates licence URL to https.
api_paper_2024/example_5/particle_shape.pyUpdates licence URL to https.
api_paper_2024/example_4/voronoi.pyUpdates licence URL to https.
api_paper_2024/example_4/mercury_molecular_voronoi.pyUpdates licence URL to https.
api_paper_2024/example_4/mercury_metal_voronoi.pyUpdates licence URL to https.
api_paper_2024/example_2/url_requesting.pyUpdates licence URL to https.
api_paper_2024/example_2/references.pyUpdates licence URL to https.
api_paper_2024/example_2/language_processing.pyUpdates DOI URL to https.
api_paper_2024/example_2/about_entry.pyUpdates licence URL to https.
.yamllint.ymlUpdates documentation links to https.
Comments suppressed due to low confidence (4)

scripts/discovery/gold_multi/gold_multi.py:141

  • logger.error(..., file=sys.stderr) will raise TypeError because the logging API does not accept a file argument (that’s for print). If you want stderr output, configure the logger's StreamHandler to use sys.stderr, or drop the file= argument here.
    scripts/discovery/gold_multi/gold_multi.py:211
  • The combined bestranking.lst is being written using f-strings of Python lists (preamble_and_header and bestranking), which will output their repr (brackets/quotes) instead of the original file format. This will break downstream consumption in Hermes. Join the lines with newlines (as before) and ensure exactly one trailing newline.
    scripts/core/show_semiconductor_properties/semiconductor_template.html:65
  • The SVG/XML namespace attributes were changed from http:// to https://. For SVG these values are namespaces, not fetchable URLs, and the correct values are http://www.w3.org/2000/svg and http://www.w3.org/1999/xlink. Using https:// can cause the SVG to be treated as invalid in some renderers.
    scripts/discovery/gold_multi/gold_multi.py:102
  • do_batch calls chdir(batch.dir) but never restores the original working directory. Pool workers can execute multiple batches sequentially, so later batches may create/chdir into paths relative to the previous chunk dir (since batch.dir is based on a potentially relative settings.output_directory). Use absolute paths and/or restore cwd in a try/finally.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +23 to +27
def file_writer(molecule, name):
"""Writes a standard Gaussian input file for all molecules contained in the structure files."""
if not mol.all_atoms_have_sites:
raise RuntimeError(f'{entry_id} has some atoms without coordinates')
mol.normalise_hydrogens()
Comment on lines +57 to +61
# check rugosity of crystal plane at 0, 0.25, 0.5, and 0.75 offset from origin
for split in range(1, 5):
os = all_d_hkl[i] / split
surface = Surface(crystal, hkl, offset=os)
rug_list.append(surface.descriptors.rugosity)
Comment on lines +30 to +31
except:
raise RuntimeError("Error in reading crystal structure input.\nPlease enter a CSD refcode or provide the path to your crystal structure file")
Comment on lines +36 to +37
except:
raise RuntimeError("Error in reading crystal structure input.\nPlease enter a CSD refcode or provide the path to your crystal structure file")

@Alex-AMCAlex-AMC 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.

Nice. Thank you for sorting all that. I've had an initial view will come back to it again ... but I thought some early feedback would be important here.

I like the different sections I think it focuses the mind and gives the context. I don't think we need to worry about saying it's based on licesing as people don't typically know what licence they have, they just know what tools they can use.

For the script/ReadMe.md I wonder if it would be nicer to have tables of scripts as opposed to a long list 🤔

@mccabe-ccdcmccabe-ccdc left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Obviously, a big thanks for taking on this task.

I've had a quickish scan. It's large, so if possible I would break down the changes into more atomic PRs. This makes it much easier to get a feel for what was done and makes each PR smaller and simpler. It's also good as a clearer overall record of what was done and easier to unravel any problems that might arise as a result of the changes.

What I mean is for example:
1 PR for http -> https
1 PR for reordering imports (and btw I'm not sure about the motivation for those re-orderings)
1 PR for changing ''' to """ and note if this is due to a PEP recommendation to justify it
1 PR for whitespace adjustments
etc. etc.

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

@CRingroseCCDC@Alex-AMC@mccabe-ccdc