Skip to content
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

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

Merged
merged 4 commits into from
May 27, 2022
Merged

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

merged 4 commits into from
May 27, 2022

Conversation

BvB93
Copy link
Member

@BvB93 BvB93 commented May 27, 2022

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

@BvB93 BvB93 added the bug Something isn't working label May 27, 2022
@BvB93 BvB93 linked an issue May 27, 2022 that may be closed by this pull request
@codecov
Copy link

codecov bot commented May 27, 2022

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%) ⬆️
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
Copy link
Member Author

BvB93 commented May 27, 2022

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'

…chors

The PLAMS `to_rdmol` function (or a dependency thereof) seems to insert a `{"mro: {}}` dict into a field used by CAT, causing issues down the line.
Avoid the issue by using `.get` instead of `__getitem__`.
The coordinates need updating; the optimum has been altered by an (unknown) upstream dependency
@BvB93
Copy link
Member Author

BvB93 commented May 27, 2022

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

@BvB93 BvB93 merged commit 064a64a into master May 27, 2022
@BvB93 BvB93 deleted the mean branch May 27, 2022 12:59
@BvB93 BvB93 added this to the CAT 0.11.0 milestone May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

optional.ligand.anchor.mean
1 participant