Comments (4)
I can reproduce this with a few modifications. I think your suggested fix is good (it's actually somewhat confusing how this was working before).
Could you post the output of conda list
? I'm mostly curious what version of Pydantic you have installed.
from cmiles.
Thanks for looking into this. I think this only broke recently, since the geometry in the qcmols seems now to be parsed as (natoms, 3) np.ndarray.
I found at least two more lines that may suffer from the same issue (current master branch):
- cmiles/_cmiles_oe.py line 42
# Add geometry
if molecule.NumAtoms() != geometry.shape[0]/3:
raise ValueError("Number of atoms in molecule does not match length of position array")
- cmiles/_cmiles_rd.py line 29
geometry = geometry.reshape(int(len(geometry)/3), 3)
My version of Pydantic is 1.8.1, see attached file.
from cmiles.
Could you look at the changes in #59 and see if those will fix your issues? I think I found the same changes you did 👍
from cmiles.
I can confirm this fixes #55. The fix also works with qcmols from OptimizationDatasets. For instance:
import qcportal as ptl
import cmiles
qc_client = ptl.FractalClient("https://api.qcarchive.molssi.org:443/")
ds = qc_client.get_collection('OptimizationDataset', "FDA Optimization Dataset 1")
qcrecord = ds.get_record("C[NH2+]C[C@@H](c1ccc(c(c1)O)O)O-0",
specification="default")
qcmol = qcrecord.get_final_molecule()
oemol = cmiles.utils.load_molecule(qcmol.dict(), toolkit="openeye")
rdmol = cmiles.utils.load_molecule(qcmol.dict(), toolkit="rdkit")
The oemol is returned successfully, however the rdmol fails due to another reason not related to this issue I think RuntimeError: Could not sanitize molecule
. I'll open another issue for this.
from cmiles.
Related Issues (20)
- Spurious missing stereo warnings
- Fix `has_stereo_defined` for rdkit HOT 1
- Detect overdefined stereo
- conda package HOT 1
- cmiles.utils.to_canonical_label failure HOT 2
- Could get_molecule_ids() support OEMol and RDMol input?
- Standardize molecule support through openforcefield.topology.Molecule?
- Generating a QCSchema JSON from an OEMol?
- WARNING: Proton(s) added/removed
- Generating CMILES ids for an OEMol?
- Hydrogens move and stereochemistry flip when reading qcschema molecule HOT 1
- Failing tests HOT 3
- Better parsing of molecule inputs
- Ideas for future refactor
- Discrepancies in re-generated reference data HOT 1
- How to update reference files for new versions of RDKit
- RDKit 2020.09.3 changes
- OpenEye toolkits 2020.2.0 changes
- Explicit valence issue with rdkit HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmiles.