nlesc-nano / CAT

A collection of tools designed for the automatic construction, and subsequent analysis, of chemical compounds.
Other
16 stars 2 forks source link

BUG: Fix the `anchor.kind = "mean"` keyword being broken #252

Closed BvB93 closed 2 years ago

BvB93 commented 2 years ago

cc @juliette1996

The anchor.kind = "mean" keyword would previously put the ligand in the correct translation and rotation, but would fail to use this information when actually combining the core and ligands into a single quantum dot.

Examples

An example of a superimposed core and it's QD, both carboxyl oxygens being used as mean anchor: mean

codecov[bot] commented 2 years ago

Codecov Report

Merging #252 (0cbd408) into master (b4792ec) will increase coverage by 0.20%. The diff coverage is 53.84%.

@@            Coverage Diff             @@
##           master     #252      +/-   ##
==========================================
+ Coverage   68.21%   68.41%   +0.20%     
==========================================
  Files          51       51              
  Lines        4241     4227      -14     
  Branches      791      788       -3     
==========================================
- Hits         2893     2892       -1     
+ Misses       1176     1161      -15     
- Partials      172      174       +2     
Impacted Files Coverage Δ
CAT/attachment/ligand_attach.py 78.44% <40.00%> (+3.36%) :arrow_up:
CAT/attachment/core_anchoring.py 75.00% <100.00%> (ø)
CAT/attachment/ligand_anchoring.py 84.74% <100.00%> (ø)
CAT/data_handling/mol_import.py 73.72% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b4792ec...0cbd408. Read the comment docs.

BvB93 commented 2 years ago

Mm, a bit confused about the (unrelated) failing tests here. Will investigate further.

 _______________ ERROR at setup of TestCoreAnchor.test_bonds[HCl] _______________
tests/test_ligand_attach.py:209: in run_cat
    qd_df, _, _ = prep(arg)
CAT/base.py:120: in prep
    core_df = prep_core(core_df)
CAT/base.py:219: in prep_core
    idx_tuples = [set_core_anchors(i, anchor_tup, allignment_tup, subset) for i in core_df[MOL]]
CAT/base.py:219: in <listcomp>
    idx_tuples = [set_core_anchors(i, anchor_tup, allignment_tup, subset) for i in core_df[MOL]]
CAT/attachment/core_anchoring.py:51: in set_core_anchors
    anchor_idx = np.fromiter(anchors, count=len(anchors), dtype=np.int64)
E   ValueError: invalid literal for int() with base 10: 'mro'
BvB93 commented 2 years ago

Eh, the pre-release test-run is currently failing due to some upstream issues (xref https://github.com/SCM-NV/PLAMS/issues/117), but besides that everything finally seems to be up and running.