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 in pymatgen.core.lattice.py? #24

Closed
mbkumar opened this issue May 16, 2013 · 4 comments
Closed

Bug in pymatgen.core.lattice.py? #24

mbkumar opened this issue May 16, 2013 · 4 comments

Comments

@mbkumar
Copy link
Contributor

mbkumar commented May 16, 2013

When trying to initialize Structure in core/structure.py, I am getting an error message.
Input to initializer:

  1. lattice of type "pymatgen.core.lattice.Lattice"
  2. species of type "List of strings"
  3. coords of type "List of numpy arrays of size 3"
  4. coords_are_cartesian=True
  5. site_properties=dict{"property_name":List of numbers}

Error Message:
File "voronoi_node_symmetry.py", line 34, in
voronoi_struct = Structure(voronoi_lattice, s, c, coords_are_cartesian=True, site_properties={"voronoi_data":p})
File "/Library/Python/2.7/site-packages/pymatgen/core/structure.py", line 297, in init
properties=prop))
File "/Library/Python/2.7/site-packages/pymatgen/core/sites.py", line 312, in init
self._fcoords = self._lattice.get_fractional_coords(coords)
File "/Library/Python/2.7/site-packages/pymatgen/core/lattice.py", line 104, in get_fractional_coords
return dot(cart_coords, self.inv_matrix)
ValueError: data type must provide an itemsize

@shyuep
Copy link
Member

shyuep commented May 16, 2013

Hi there,

I can't reproduce the error. You cannot just specify voronoi_data as site properties because there are only some properties allowed. But otherwise, I can't reproduce the error. Can you give me the exact forms of the variables voronoi_lattice, s and c? For example, the following works just fine:

Structure(Lattice.cubic(3), ["Fe"], [[0,0,0]], coords_are_cartesian=True)

@mbkumar
Copy link
Contributor Author

mbkumar commented May 16, 2013

May be what I am doing is wrong. In that case, let me know where I am wrong.
I am attaching the python script and the input data files.

Thanks,
Bharat

On 5/16/13 4:29 PM, Shyue Ping Ong wrote:

Hi there,

I can't reproduce the error. You cannot just specify voronoi_data as
site properties because there are only some properties allowed. But
otherwise, I can't reproduce the error. Can you give me the exact
forms of the variables voronoi_lattice, s and c? For example, the
following works just fine:

Structure(Lattice.cubic(3), ["Fe"], [[0,0,0]], coords_are_cartesian=True)


Reply to this email directly or view it on GitHub
#24 (comment).

4.2120 4.2120 4.2120
90.00 90.00 90.00 SPGR = 1 P 1 OPT = 1
8 0
0 Mg4 O4
1 Mg 0.0000 0.0000 0.0000 0 0 0 0 0 0 0 0 0.00
2 Mg 0.5000 0.5000 0.0000 0 0 0 0 0 0 0 0 0.00
3 Mg 0.5000 0.0000 0.5000 0 0 0 0 0 0 0 0 0.00
4 Mg 0.0000 0.5000 0.5000 0 0 0 0 0 0 0 0 0.00
5 O 0.5000 0.0000 0.0000 0 0 0 0 0 0 0 0 0.00
6 O 0.0000 0.5000 0.0000 0 0 0 0 0 0 0 0 0.00
7 O 0.0000 0.0000 0.5000 0 0 0 0 0 0 0 0 0.00
8 O 0.5000 0.5000 0.5000 0 0 0 0 0 0 0 0 0.00

@shyuep
Copy link
Member

shyuep commented May 16, 2013

Hi Bharat,

I don't see an input file. Maybe you can email them directly to me at shyuep@gmail.com?

Regards,
Shyue Ping

On Thursday, May 16, 2013 at 7:45 PM, mbkumar wrote:

May be what I am doing is wrong. In that case, let me know where I am wrong.
I am attaching the python script and the input data files.

Thanks,
Bharat

On 5/16/13 4:29 PM, Shyue Ping Ong wrote:

Hi there,

I can't reproduce the error. You cannot just specify voronoi_data as
site properties because there are only some properties allowed. But
otherwise, I can't reproduce the error. Can you give me the exact
forms of the variables voronoi_lattice, s and c? For example, the
following works just fine:

Structure(Lattice.cubic(3), ["Fe"], [[0,0,0]], coords_are_cartesian=True)


Reply to this email directly or view it on GitHub
#24 (comment).

4.2120 4.2120 4.2120
90.00 90.00 90.00 SPGR = 1 P 1 OPT = 1
8 0
0 Mg4 O4
1 Mg 0.0000 0.0000 0.0000 0 0 0 0 0 0 0 0 0.00
2 Mg 0.5000 0.5000 0.0000 0 0 0 0 0 0 0 0 0.00
3 Mg 0.5000 0.0000 0.5000 0 0 0 0 0 0 0 0 0.00
4 Mg 0.0000 0.5000 0.5000 0 0 0 0 0 0 0 0 0.00
5 O 0.5000 0.0000 0.0000 0 0 0 0 0 0 0 0 0.00
6 O 0.0000 0.5000 0.0000 0 0 0 0 0 0 0 0 0.00
7 O 0.0000 0.0000 0.5000 0 0 0 0 0 0 0 0 0.00
8 O 0.5000 0.5000 0.5000 0 0 0 0 0 0 0 0 0.00


Reply to this email directly or view it on GitHub (#24 (comment)).

@mbkumar
Copy link
Contributor Author

mbkumar commented May 17, 2013

I'll send them tomorrow morning.

Bharat

On Thu, 16 May 2013 18:56:18 -0500, Shyue Ping Ong
notifications@github.com wrote:

Hi Bharat,

I don't see an input file. Maybe you can email them directly to me at
shyuep@gmail.com?

Regards,
Shyue Ping

On Thursday, May 16, 2013 at 7:45 PM, mbkumar wrote:

May be what I am doing is wrong. In that case, let me know where I am
wrong.
I am attaching the python script and the input data files.

Thanks,
Bharat

On 5/16/13 4:29 PM, Shyue Ping Ong wrote:

Hi there,

I can't reproduce the error. You cannot just specify voronoi_data as
site properties because there are only some properties allowed. But
otherwise, I can't reproduce the error. Can you give me the exact
forms of the variables voronoi_lattice, s and c? For example, the
following works just fine:

Structure(Lattice.cubic(3), ["Fe"], [[0,0,0]],
coords_are_cartesian=True)


Reply to this email directly or view it on GitHub

#24 (comment).

4.2120 4.2120 4.2120
90.00 90.00 90.00 SPGR = 1 P 1 OPT = 1
8 0
0 Mg4 O4
1 Mg 0.0000 0.0000 0.0000 0 0 0 0 0 0 0 0 0.00
2 Mg 0.5000 0.5000 0.0000 0 0 0 0 0 0 0 0 0.00
3 Mg 0.5000 0.0000 0.5000 0 0 0 0 0 0 0 0 0.00
4 Mg 0.0000 0.5000 0.5000 0 0 0 0 0 0 0 0 0.00
5 O 0.5000 0.0000 0.0000 0 0 0 0 0 0 0 0 0.00
6 O 0.0000 0.5000 0.0000 0 0 0 0 0 0 0 0 0.00
7 O 0.0000 0.0000 0.5000 0 0 0 0 0 0 0 0 0.00
8 O 0.5000 0.5000 0.5000 0 0 0 0 0 0 0 0 0.00


Reply to this email directly or view it on GitHub
(#24 (comment)).


Reply to this email directly or view it on GitHub:
#24 (comment)

@shyuep shyuep closed this as completed May 17, 2013
gmatteo added a commit that referenced this issue Nov 30, 2014
some typo's and pep8 fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants