mcocdawc / chemcoord Goto Github PK
View Code? Open in Web Editor NEWA python module for manipulating cartesian and internal coordinates.
License: GNU Lesser General Public License v3.0
A python module for manipulating cartesian and internal coordinates.
License: GNU Lesser General Public License v3.0
In chemcoord.internal_coordinates._zmat_class_core.py
you've recently implemented _jit_calc_positions
as a static method for the ZmatCore
class. It might make sense then to have _jit_calc_singe_position
be a static method for that class as well, since they are related functions.
And on a minor related note, I think you probably intended to name the function _jit_cal_single_position, not _jit_calc_singe_position. That is, unless you wanted to slightly burn the molecule's position ;)
I have been running trials converting cartesian coordinate files to internal coordinate files. I've had success with most files, except for one file. The formatting of the xyz file appears to be the same as all the others, but I keep getting the error below:
NameError: name 'row_in_buildlist' is not defined
Any suggestions for what might be incorrect?
When I run this code (using the latest master version) to read an xyz file, transform it into a z-matrix representation and output the z-matrix:
import chemcoord as cc
test = cc.xyz_functions.read('some.xyz')
z = test.to_zmat()
z.write('ztest.zmat')
I get the following error:
File "ktest.py", line 13, in <module>
z.write('ztest.zmat')
File "/Users/sgill2/anaconda/lib/python2.7/site-packages/chemcoord/zmat_functions.py", line 501, in write
zmat_frame = self.change_numbering().zmat_frame
File "/Users/sgill2/anaconda/lib/python2.7/site-packages/chemcoord/zmat_functions.py", line 181, in change_numbering
new_index = range(1, zmat_frame.shape[0]+1)
NameError: global name 'zmat_frame' is not defined
This might be due to the zmat_frame not being set when making a Zmat object from a Cartesian object.
chemcoord_subs_output_bug.txt
If 1 or 2 entries of a zmatrix are replaced with a symbolic expression, the substitution back to a number is working as intended. As soon as a third entry is replaced the substitution crashes telling "can't convert expression to float". Long version of output is attached.
Code to reproduce:
import chemcoord as cc
import sympy
import numpy as np
import pandas as pd
import math as m
import time
water = cc.Cartesian.read_xyz('water_dimer.xyz', start_index=1)
zwater = water.get_zmat()
symb_zwater = zwater.copy()
sympy.init_printing()
a = sympy.Symbol('a')
b = sympy.Symbol('b')
c = sympy.Symbol('c')
symb_zwater.safe_loc[4, 'dihedral'] = a
symb_zwater.safe_loc[5, 'dihedral'] = b
symb_zwater.subs(a, 180)
# (until here everything works)
symb_zwater.safe_loc[6, 'dihedral'] = c
symb_zwater.subs(a, 180)
(here it crashes)
cc.show_versions()
chemcoord: 1.3.0
numpy: 1.13.3
scipy: 0.19.1
pandas: 0.20.3
numba: 0.35.0
sortedcontainers: 1.5.7
sympy: 1.1.1
pytest: 3.0.7
pip: 9.0.1
setuptools: 27.2.0
IPython: 5.3.0
sphinx: 1.5.6
molecule = cc.Cartesian.read_xyz(...)
molecule.dtypes
gives correctly ['O', 'f8', 'f8', 'f8']
But if a series would be returned from a dataframe the output is different:
molecule.loc[1].dtypes
gives ['O', 'O', 'O', 'O']
I'd like to ask for suggestions on how to improve my workflow, because at the moment I have to do too much manual work which I would like to automatize.
I want to create a set of conformers of chain-like organic molecules (esters) and save them as input Cartesians. Starting with propyl butanoate I want to systematically enlarge the alkyl chains.
ttttt.txt
Using an all-trans conformer as a starting point (all dihedrals = 180°), I want to change the value of the dihedrals of interest (5 in total) to 60°, 180° or 300°, respectively. For that I load the input Cartesian and set up an own zmatrix in order to know which dihedral I have to change:
ester = cc.Cartesian.read_xyz('ttttt.txt')
ester_frag = ester.fragmentate()
ester_c_table = pd.DataFrame([['origin', 'e_z', 'e_x'], [0, 'e_z', 'e_x'], [1, 0, 'e_x'], [2, 1, 0], [3, 2, 1], [4, 3, 2], [6, 4, 3], [7, 6, 4], [4, 3, 6], [8, 7, 6], [8, 7, 6], [8, 7, 6], [7, 6, 8], [7, 6, 8], [6, 4, 7], [6, 4, 7], [0, 1, 2], [0, 1, 2], [0, 1, 2], [1, 0, 2], [1, 0, 2], [2, 1, 3], [2, 1, 3]], columns=['b', 'a', 'd'], index=[0, 1, 2, 3, 4, 6, 7, 8, 5, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22])
ester_const_table = ester.get_construction_table(fragment_list=[(ester_frag[0], ester_c_table)])
zester = ester.get_zmat(ester_const_table)
Now the "backbone" dihedrals are replaced by symbols:
a, b, c, d, e = sympy.symbols('a, b, c, d, e')
symb_zester = zester.copy()
symb_zester.safe_loc[3, 'dihedral'] = a
symb_zester.safe_loc[4, 'dihedral'] = b
symb_zester.safe_loc[6, 'dihedral'] = c
symb_zester.safe_loc[7, 'dihedral'] = d
symb_zester.safe_loc[8, 'dihedral'] = e
Next a list of names for each conformer is created, which is used to generate the torsional angles afterwards. Enantiomeric pairs are deleted.
confs = {'t': 180, 'g+': 60, 'g-': 300}
name_list = [['t']*5]
for i in list(confs.keys()):
for j in list(confs.keys()):
for k in list(confs.keys()):
for l in list(confs.keys()):
name_list.append([i, j, 't', k, l])
for i in range(len(name_list)-1):
name_list[i] = ['u' if x=='g+' else x for x in name_list[i]]
name_list[i] = ['g+' if x=='g-' else x for x in name_list[i]]
name_list[i] = ['g-' if x=='u' else x for x in name_list[i]]
if (name_list[i] in name_list[(i+1):]):
name_list[i] = []
name_list2 = [x for x in name_list if x]
Depending on the letter code the torsional angle is substituted and saved as a Cartesian input file.
for i in range(len(name_list2)):
ester_tmp = symb_zester.subs(a, confs[name_list2[i][0]]).subs(b, confs[name_list2[i][1]]).subs(c, confs[name_list2[i][2]]).subs(d, confs[name_list2[i][3]]).subs(e, confs[name_list2[i][4]]).get_cartesian()
cc.Cartesian.to_xyz(ester_tmp, str(''.join(name_list2[i]) + '.xyz'))
del ester_tmp
If I used a completely automatically generated zmatrix I wouldn't see any possibility to predict which number the torsional angles of interest will have. Therefore I need to set up the first few atoms of the zmatrix manually. In order to do so I need to visualize the molecule, realize which C atom is connected to which and properly define the connectivity. However, when at first I let the hydrogens be defined automatically, I realized that not all of them were moved correctly together with their corresponding C atoms, because their dihedrals had unfortunate assignments. The result was, that some of them crashed into the carbons.
Therefore I had to explicitly define the connectivity of each and every H atom.
Now this manual work is very tedious and very badly scalable for larger molecules. It would be great if it was possible to make my attempt more generally applicable.
I would be very glad for any suggestions for improvement!
Read_zmat has to insert absolute references if they are not present in the file.
Take care of the equivalence classes of angles.
-1 ~ 359
...
Create a method iupacify
to get the IUPAC definition.
Get a short_sub
method to get the shortes movement in angles.
In your Tutorial.ipynb you use the following code to read in an xyz file:
import chemcoord as cc
cc.read('some.xyz')
However this method doesn't seem to exist when I try to run it locally. I ended up using the following code instead to read in the xyz file:
cc.xyz_functions.read_xyz('some.xyz')
As explained in the tutorial, the default viewer can be changed to e.g. pymol with
cc.settings['defaults']['viewer'] = 'pymol'
However, running water.view() results in "file not found", because gv is not installed on my system.
Exception in thread Thread-1461:
Traceback (most recent call last):
File "/home/maxim/Programme/anaconda3/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/home/maxim/Programme/anaconda3/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/home/maxim/Programme/anaconda3/lib/python3.6/site-packages/chemcoord/cartesian_coordinates/_cartesian_clase
subprocess.check_call([viewer, give_filename(i)])
File "/home/maxim/Programme/anaconda3/lib/python3.6/subprocess.py", line 286, in check_call
retcode = call(*popenargs, **kwargs)
File "/home/maxim/Programme/anaconda3/lib/python3.6/subprocess.py", line 267, in call
with Popen(*popenargs, **kwargs) as p:
File "/home/maxim/Programme/anaconda3/lib/python3.6/subprocess.py", line 707, in init
restore_signals, start_new_session)
File "/home/maxim/Programme/anaconda3/lib/python3.6/subprocess.py", line 1326, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'gv.exe'
water.view(viewer='pymol')
works as supposed.
cc.show_versions()
python: 3.6.1.final.0
python-bits: 64
OS: Linux
OS-release: 4.13.2-1.g68f4aee-default
machine: x86_64
processor: x86_64
LC_ALL: None
LANG: de_DE.UTF-8
LOCALE: de_DE.UTF-8
chemcoord: 1.3.0
numpy: 1.12.1
scipy: 0.19.0
pandas: 0.20.1
numba: 0.33.0
sortedcontainers: 1.5.7
sympy: 1.0
pytest: 3.0.7
pip: 9.0.1
setuptools: 27.2.0
IPython: 5.3.0
sphinx: 1.5.6
Since approximately 2017-10-20 the library environment on Travis changed.
This means that installing scipy via pip in the python 2.7 environment does not work anymore, because it cannot find BLAS... libraries.
I switched off the python 2.7 testing for now.
There are two possibilities to solve this issue:
For now I will wait.
I'd like to specify the ordering of atoms in a zmatrix, but unfortunately there is no tutorial on this issue yet. According to the documentation get_zmat can be provided with a construction_table, but how does this table should look like? get_construction_table requires a fragment list, which in turn consists of "fragment" and its construction table, which resembles a closed circle. Also there is no description of how "fragment" should look like.
Maybe an explicit working example could help, like e.g. for the water dimer from the tutorial, where oxygen 2 (atom nr. 4) is the first atom in the zmat, oxygen 1 (atom nr. 1) is the second one, while all of the hydrogens are entered automatically.
Write a small dev-doc to explain design decisions like in #36
With staticmethods!
When using give_cartesian()
(previously to_xyz()
) the function takes the convention of setting the first atom in the build list to be centered at the origin. In the cases where you are converting back and forth between xyz and zmat representations though, it might be helpful to keep the xyz coordinates more consistent with the original coordinates, which may not be centered at the origin. You can effectively do this by specifying the coordinates of the first three atoms.
I'd propose to add an additional optional argument to give_carrtesian()
that takes up to a 3x3 numpy array that corresponds to the x,y,z coordinates of the first three build list atoms. If this argument is specified then the add_first/second/third_atom() would draw from these coordinates instead.
(Of course, if these atom positions don't satisfy the zmat bonds/angles then the resulting representation will be messed up, so checking the bonds and angles given by the first three atoms and throwing an warning or error if they are not consistent would probably be good too.)
I've written up some code that mostly does this already (in the old chemcoord framework at least), and would be happy to share it if you would find it helpful.
Make also automated test for OSX and Windows.
Get at least 90% code quality
The testing infrastructure is implemented using pytest combined with travis-CI.
Only the test cases are missing. I will happily accept pull request which implement more tests
cc.Cartesian.read_xyz('temp.xyz')
problem with reading in Cartesian coordinates, as for some reason with pip install of chemcoord and dependency sortedcontainers it fails with:
"/usr/local/lib/python3.6/dist-packages/chemcoord/cartesian_coordinates/_cartesian_class_core.py", line 486, in <dictcomp>
for key in bond_dict}
TypeError: __init__() got an unexpected keyword argument 'load'
removing "load=20" from
seems to solve the issue...
cc.show_versions()
chemcoord: 2.0.3
numpy: 1.13.3
scipy: 0.19.1
pandas: 0.20.3
numba: 0.36.2
sortedcontainers: 1.5.9
sympy: 1.1.1
pytest: 3.3.1
pip: 9.0.1
setuptools: 38.2.4
IPython: 6.2.1
sphinx: None
Write wrappers for libmsym to detect point groups and/or symmetrise molecules.
Especially write extended cartesian class that preserves point group.
Create a show version function
Implement concat functions similar to https://pandas.pydata.org/pandas-docs/stable/merging.html in xyz_functions and zmat_functions.
Zmat.to_xyz()'s doc string says it returns a zmat when it should probably say that it returns a Cartesian.
https://github.com/mcocdawc/chemcoord/blob/master/chemcoord/zmat_functions.py#L194-L208
['bond', 'angle', 'dihedral']
columns.safe_loc
This is a minor thing, but there is some sort of formatting issue for the Zmat.to_xyz() function in the sphinx docs.
Remove location
method and replace with .loc[:, ['x', 'y', 'z']]
Sometimes: .loc[:, ['x', 'y', 'z']].values
will be necessary. Testing required!
Implement analytical gradients for the conversion of zmatrices to cartesians
If #20 is finished:
Currently the Cartesian.read_xyz() function has a pythonic_index boolean argument to specify if indexing starts at 0 or 1. A more general form of this pythonic_index argument could allow any integer to be used as the starting index.
This could be handy in the case where you're looking at a fragment of a larger system; it would allow the indices between both to remain consistent.
Friends,
Friends,
I appreciate the effort on "chemcord library". I am facing a particular situation where i need to manipulate some dihedrals. I simply used chemcoor as follows,
#Opened my Zmatrix as pandas Dataframe, and substituted the dihedral angle
zm = cc.Zmat.read_zmat('Startz.com').frame
zm.loc[8,'dihedral']=83.5
The issue is to output the pandas frame again as modified Zmatrix. I dnt see any relevant function in chemcoord to do the same, am i missing something ?. Is there any way to output zmatrix directly besides converting it to xyz ?.
Thanks,
Bala
version 1
conda create --name test_chemcoord -c mcocdawc chemcoord
version 2
conda create --name test_chemcoord
source activate test_chemcoord
conda install -c mcacdawc chemcoord
version 3
conda create --name test_chemcoord
conda install --name test_chemcoord -c mcocdawc chemcoord
All three give the error:
Fetching package metadata .............
Solving package specifications:
PackageNotFoundError: Packages missing in current channels:
- chemcoord -> pymatgen
We have searched for the packages in the following channels:
- https://conda.anaconda.org/mcocdawc/linux-64
- https://conda.anaconda.org/mcocdawc/noarch
- https://repo.continuum.io/pkgs/main/linux-64
- https://repo.continuum.io/pkgs/main/noarch
- https://repo.continuum.io/pkgs/free/linux-64
- https://repo.continuum.io/pkgs/free/noarch
- https://repo.continuum.io/pkgs/r/linux-64
- https://repo.continuum.io/pkgs/r/noarch
- https://repo.continuum.io/pkgs/pro/linux-64
- https://repo.continuum.io/pkgs/pro/noarch
The dependency for pymatgen
is not resolved via conda install
.
The installation and usage works flawlessly with pip install chemcoord
, though:
In the root environment conda list
outputs among others chemcoord 2.0.2 <pip>
.
cc.show_versions()
chemcoord: 2.0.2
numpy: 1.13.1
scipy: 0.19.1
pandas: 0.20.3
numba: 0.35.0+10.g143f70e90
sortedcontainers: 1.5.7
sympy: 1.1.1
pytest: 3.2.1
pip: 9.0.1
setuptools: 36.5.0.post20170921
IPython: 6.1.0
sphinx: 1.6.3
Perhaps give shorter names:
['b', 'a', 'd'] instead of ['bond_with', 'angle_with', 'dihedral_with']
I've noticed that using a construction table affects the orientation of the molecule.
Running this with an .xyz file:
#using construction table
a = cc.Cartesian.read_xyz('temp_lig.xyz')
con_table = a.get_construction_table()
amat = a.give_zmat(con_table)
a_new = amat.give_cartesian()
#without construction table
b = cc.Cartesian.read_xyz('temp_lig.xyz')
bmat = a.give_zmat()
b_new = bmat.give_cartesian()
#sort by index so changes are easier to see
a.frame.sort_index(inplace=True)
a_new.frame.sort_index(inplace=True)
b_new.frame.sort_index(inplace=True)
#print indices
print('with table', a_new)
print('without table', b_new)
print('original', a)
gives this output:
('with table', atom x y z
0 C 1.405694 0.000000 3.121268e-16
1 C -0.722546 -0.022564 -1.199021e+00
2 C 0.000000 0.000000 -2.094014e-17
3 C 2.093148 0.000000 -1.242141e+00
4 C -0.012100 0.021114 -2.384300e+00
5 C 2.198825 0.114581 1.295700e+00
6 C 1.377021 -0.022161 -2.369916e+00
7 C -2.198020 -0.181051 -1.136326e+00
8 O 3.360923 -0.110837 1.383469e+00
9 O -2.778165 0.273612 -1.373163e-01
10 N 3.469261 0.109952 -1.312600e+00
11 N 1.532948 0.532160 2.352971e+00
12 O -0.606740 -0.088480 -3.632845e+00
13 C -3.093873 -0.743054 -2.276435e+00
14 H -0.529548 -0.212795 9.251305e-01
15 H 1.789389 -0.006685 -3.375545e+00
16 H 3.954729 0.010438 -4.279461e-01
17 H 4.054319 -0.243329 -2.061664e+00
18 H 1.915817 0.396867 3.276653e+00
19 H 0.533060 0.613685 2.244989e+00
20 H 0.039734 -0.243805 -4.344617e+00
21 H -3.093218 0.096732 -2.974448e+00
22 H -2.753066 -1.647802 -2.784120e+00
23 H -4.094748 -1.014331 -1.934205e+00)
('without table', atom x y z
0 C 1.405694 0.000000 3.121268e-16
1 C -0.722546 1.199233 8.949939e-16
2 C 0.000000 0.000000 -2.094014e-17
3 C 2.093148 1.241921 2.337100e-02
4 C -0.012100 2.383481 6.597100e-02
5 C 2.198825 -1.297626 9.018200e-02
6 C 1.377021 2.369913 2.243300e-02
7 C -2.198020 1.139531 -1.596390e-01
8 O 3.360923 -1.381139 -1.368470e-01
9 O -2.778165 0.132144 2.761470e-01
10 N 3.469261 1.310299 1.346290e-01
11 N 1.532948 -2.362567 4.877940e-01
12 O -0.606740 3.633867 -2.011200e-02
13 C -3.093873 2.290013 -7.000910e-01
14 H -0.529548 -0.920963 -2.301640e-01
15 H 1.789389 3.375073 5.682700e-02
16 H 3.954729 0.427674 1.848800e-02
17 H 4.054319 2.065877 -2.044960e-01
18 H 1.915817 -3.283540 3.351460e-01
19 H 0.533060 -2.256138 5.713370e-01
20 H 0.039734 4.348435 -1.620170e-01
21 H -3.093218 2.972101 1.526790e-01
22 H -2.753066 2.814631 -1.595127e+00
23 H -4.094748 1.952947 -9.777590e-01)
('original', atom x y z
0 C 1.405694 0.000000 0.000000
1 C -0.722546 1.199233 0.000000
2 C 0.000000 0.000000 0.000000
3 C 2.093148 1.241921 0.023371
4 C -0.012100 2.383481 0.065971
5 C 2.198825 -1.297626 0.090182
6 C 1.377021 2.369913 0.022433
7 C -2.198020 1.139531 -0.159639
8 O 3.360923 -1.381139 -0.136847
9 O -2.778165 0.132144 0.276147
10 N 3.469261 1.310299 0.134629
11 N 1.532948 -2.362567 0.487794
12 O -0.606740 3.633867 -0.020112
13 C -3.093873 2.290013 -0.700091
14 H -0.529548 -0.920963 -0.230164
15 H 1.789389 3.375073 0.056827
16 H 3.954729 0.427674 0.018488
17 H 4.054319 2.065877 -0.204496
18 H 1.915817 -3.283540 0.335146
19 H 0.533060 -2.256138 0.571337
20 H 0.039734 4.348435 -0.162017
21 H -3.093218 2.972101 0.152679
22 H -2.753066 2.814631 -1.595127
23 H -4.094748 1.952947 -0.977759)
It might be hard to see from the numbers, but using the construction_table
causes the orientation to change, while leaving the actual molecular internal coordinates unperturbed, suggesting this is caused by some issue regarding the [-4,-3,-2,-1] basis atoms.
For a more visual example, here's the molecule visualized, with blue being the original .xyz and red representing the new .xyz . Purple is from the red and blue overlapping.
I get the following ImportError when I try to import the Chemcoord library. Looks like there is a circular import happening.
I have installed Chemcoord via pip.
Please advice
Python 2.7.11 (default, Jan 18 2016, 12:56:57)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import chemcoord as cc
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/site-packages/chemcoord/init.py", line 12, in
from . import xyz_functions
File "/usr/local/lib/python2.7/site-packages/chemcoord/xyz_functions.py", line 9, in
from . import zmat_functions
File "/usr/local/lib/python2.7/site-packages/chemcoord/zmat_functions.py", line 8, in
from . import xyz_functions
ImportError: cannot import name xyz_functions
When I was running the following code (in both python 2.7 and 3.5):
import chemcoord as cc
a = cc.Cartesian.read_xyz('some.xyz')
amat = a.give_zmat()
b = amat.give_cartesian()
I got the following (abbreviated) error traceback:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/samgill/anaconda/lib/python2.7/site-packages/chemcoord/internal_coordinates/_zmat_class_give_cartesian.py", line 74, in give_cartesian
positions[row] = _jit_calculate_position(refs, zmat_values, row)
File "/Users/samgill/anaconda/lib/python2.7/site-packages/numba/dispatcher.py", line 277, in _compile_for_args
return self.compile(tuple(real_args))
File "/Users/samgill/anaconda/lib/python2.7/site-packages/numba/dispatcher.py", line 495, in compile
cres = self._compiler.compile(args, return_type)
File "/Users/samgill/anaconda/lib/python2.7/site-packages/numba/dispatcher.py", line 76, in compile
flags=flags, locals=self.locals)
File "/Users/samgill/anaconda/lib/python2.7/site-packages/numba/compiler.py", line 696, in compile_extra
return pipeline.compile_extra(func)
File "/Users/samgill/anaconda/lib/python2.7/site-packages/numba/compiler.py", line 369, in compile_extra
return self.compile_bytecode(bc, func_attr=self.func_attr)
File "/Users/samgill/anaconda/lib/python2.7/site-packages/numba/compiler.py", line 378, in compile_bytecode
return self._compile_bytecode()
File "/Users/samgill/anaconda/lib/python2.7/site-packages/numba/compiler.py", line 662, in _compile_bytecode
res = pm.run(self.status)
File "/Users/samgill/anaconda/lib/python2.7/site-packages/numba/compiler.py", line 257, in run
raise patched_exception
numba.errors.UntypedAttributeError: Caused By:
Traceback (most recent call last):
File "/Users/samgill/anaconda/lib/python2.7/site-packages/numba/compiler.py", line 249, in run
stage()
File "/Users/samgill/anaconda/lib/python2.7/site-packages/numba/compiler.py", line 466, in stage_nopython_frontend
self.locals)
File "/Users/samgill/anaconda/lib/python2.7/site-packages/numba/compiler.py", line 807, in type_inference_stage
infer.propagate()
File "/Users/samgill/anaconda/lib/python2.7/site-packages/numba/typeinfer.py", line 613, in propagate
raise errors[0]
UntypedAttributeError: Caused By:
Traceback (most recent call last):
File "/Users/samgill/anaconda/lib/python2.7/site-packages/numba/compiler.py", line 249, in run
stage()
File "/Users/samgill/anaconda/lib/python2.7/site-packages/numba/compiler.py", line 466, in stage_nopython_frontend
self.locals)
File "/Users/samgill/anaconda/lib/python2.7/site-packages/numba/compiler.py", line 807, in type_inference_stage
infer.propagate()
File "/Users/samgill/anaconda/lib/python2.7/site-packages/numba/typeinfer.py", line 613, in propagate
raise errors[0]
UntypedAttributeError: Unknown attribute "norm" of type Module(<module 'numpy.linalg' from '/Users/samgill/anaconda/lib/python2.7/site-packages/numpy/linalg/__init__.pyc'>)
File "../../../anaconda/lib/python2.7/site-packages/chemcoord/utilities/algebra_utilities.py", line 34
Failed at nopython (nopython frontend)
Unknown attribute "norm" of type Module(<module 'numpy.linalg' from '/Users/samgill/anaconda/lib/python2.7/site-packages/numpy/linalg/__init__.pyc'>)
File "../../../anaconda/lib/python2.7/site-packages/chemcoord/utilities/algebra_utilities.py", line 34
This suggested that it had something to do with numba. In Python3 when I updated my numba package (from 0.26.0 to 0.33.0) this error went away. However in Python2.7 I couldn't update to numba 0.33.0 with conda due to a conflict in requirements:
UnsatisfiableError: The following specifications were found to be in conflict:
- chaco -> enable -> numpy 1.9*
- numba 0.33.0* -> llvmlite 0.18.*
Use "conda info <package>" to see the dependencies for each package.
By removing the chaco and enable packages to remove this conflict I was able to update to the latest version of numba and this error went away.
I'm mostly mentioning this because I saw that in your tests test_back_forth.py
your latest commit said that there was a Python2.7 bug. After doing the above fix I ran test_back_forth.py
in Python2.7 without it spitting out errors; I don't know if that's the same bug you've been seeing though.
Detect linearity in reference when converting zmat -> cartesian
and throw UndefinedCoordinateSystem
exception
If the test.py is included to read using pythonic_index=True, for instance:
molecule1 = cc.read(molecule_in, filetype='xyz', pythonic_index=True)
the first test case fails.
MIL-53.xyz: transformation didn't work
Cd-S-lattice.xyz: transformation worked
I'm not too sure why this is at the moment.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.