vitroid / GenIce

A swiss army knife to generate proton-disordered ice structures.
MIT License
61 stars 20 forks source link

[Bug] GenIce2 cannot generate some ices #12

Closed rusl2019 closed 2 years ago

rusl2019 commented 2 years ago

Hello dr. Masakazu Matsumoto, I would like to report a bug when generating some ices.

Here's a list of the ices:

When I generate ice2, I get the output:

ruslan@neptunus:~/Documents/genice-test$ genice2 ice2 --rep 3 3 3 --seed 1234 --format gromacs --water ice --depol=optimal > conf.gro

INFO main: end.
INFO main: 403 ms
Traceback (most recent call last):
  File "/home/ruslan/.local/bin/genice2", line 8, in <module>
    sys.exit(main())
  File "/home/ruslan/.local/lib/python3.8/site-packages/genice2/decorators.py", line 14, in _time_it
    return func(*args, **kwargs)
  File "/home/ruslan/.local/lib/python3.8/site-packages/genice2/decorators.py", line 34, in _banner
    return func(*args, **kwargs)
  File "/home/ruslan/.local/lib/python3.8/site-packages/genice2/cli/genice.py", line 201, in main
    lat = GenIce(safe_import("lattice", lattice_type).Lattice(**lattice_options),
  File "/home/ruslan/.local/lib/python3.8/site-packages/genice2/lattices/ice2.py", line 60, in __init__
    self.waters, self.fixed = CIF.waters_and_pairs(self.cell, atomd, sops)
  File "/home/ruslan/.local/lib/python3.8/site-packages/genice2/CIF.py", line 125, in waters_and_pairs
    for i, j in pl.pairs_iter(oxygens,
TypeError: pairs_iter() got an unexpected keyword argument 'rc'

ruslan@neptunus:~/Documents/genice-test$ 

I also tried some tests using the cif and zeolite plugins, getting the following output:

INFO Extra lattice plugin: zeolite INFO EDI INFO Input: EDI.cif WARNING could not convert "T1" into element name! WARNING could not convert "T2" into element name! INFO Loaded a CIF file with 5 atom coordinates and 8 symmetry operations. INFO Created a unit cell consisting of 15 atoms. INFO Fractional coordinates: INFO T2 0.000 0.000 0.500 INFO T1 0.000 0.732 0.882 INFO T1 0.732 0.000 0.118 INFO T1 0.000 0.268 0.882 INFO T1 0.268 0.000 0.118 INFO O 0.000 0.500 0.882 INFO O 0.190 0.810 0.000 INFO O 0.810 0.810 0.000 INFO O 0.810 0.190 0.000 INFO O 0.000 0.810 0.645 INFO O 0.810 0.000 0.355 INFO O 0.000 0.190 0.645 INFO O 0.500 0.000 0.118 INFO O 0.190 0.190 0.000 INFO O 0.190 0.000 0.355 INFO Cell volume: 307.48434116 (calc.), 0 (data) INFO init: Constructor of GenIce. INFO
INFO Command line: /home/ruslan/.local/bin/genice2 zeolite[EDI] --rep 3 3 3 --seed 1234 --format gromacs --water ice --depol=optimal INFO No rotmatrices in lattice INFO Cell dimension: INFO a = 6.926 INFO b = 6.926 INFO c = 6.41 INFO A = 90.0 INFO B = 90.0 INFO C = 90.0 INFO HB connectivity is not defined. INFO init: end. INFO init: 3 ms INFO main: end. INFO main: 1355 ms Traceback (most recent call last): File "/home/ruslan/.local/lib/python3.8/site-packages/genice2/genice.py", line 534, in init self.bondlen = lat.bondlen AttributeError: 'Lattice' object has no attribute 'bondlen'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/ruslan/.local/bin/genice2", line 8, in sys.exit(main()) File "/home/ruslan/.local/lib/python3.8/site-packages/genice2/decorators.py", line 14, in _time_it return func(*args, kwargs) File "/home/ruslan/.local/lib/python3.8/site-packages/genice2/decorators.py", line 34, in _banner return func(args, kwargs) File "/home/ruslan/.local/lib/python3.8/site-packages/genice2/cli/genice.py", line 201, in main lat = GenIce(safe_import("lattice", lattice_type).Lattice(lattice_options), File "/home/ruslan/.local/lib/python3.8/site-packages/genice2/decorators.py", line 14, in _time_it return func(args, kwargs) File "/home/ruslan/.local/lib/python3.8/site-packages/genice2/decorators.py", line 34, in _banner return func(*args, **kwargs) File "/home/ruslan/.local/lib/python3.8/site-packages/genice2/genice.py", line 540, in init p = pl.pairs_iter(self.waters, TypeError: pairs_iter() got an unexpected keyword argument 'rc' INFO Completed.

ruslan@neptunus:~/Documents/genice-test$


- plugin `cif`
```bash
ruslan@neptunus:~/Documents/genice-test$ genice2 cif[EDI.cif] --rep 3 3 3 --seed 1234 --format gromacs --water ice --depol=optimal > conf.gro

INFO Extra lattice plugin: cif
INFO EDI.cif
INFO Input: EDI.cif
WARNING could not convert "T1" into element name!
WARNING could not convert "T2" into element name!
INFO Loaded a CIF file with 5 atom coordinates and 8 symmetry operations.
INFO Created a unit cell consisting of 15 atoms.
INFO Fractional coordinates:
INFO         T2  0.000  0.000  0.500
INFO         T1  0.000  0.732  0.882
INFO         T1  0.732  0.000  0.118
INFO         T1  0.000  0.268  0.882
INFO         T1  0.268  0.000  0.118
INFO          O  0.000  0.500  0.882
INFO          O  0.190  0.810  0.000
INFO          O  0.810  0.810  0.000
INFO          O  0.810  0.190  0.000
INFO          O  0.000  0.810  0.645
INFO          O  0.810  0.000  0.355
INFO          O  0.000  0.190  0.645
INFO          O  0.500  0.000  0.118
INFO          O  0.190  0.190  0.000
INFO          O  0.190  0.000  0.355
INFO Cell volume: 307.48434116 (calc.), 0 (data)
INFO __init__: Constructor of GenIce.
INFO   
INFO   Command line: /home/ruslan/.local/bin/genice2 cif[EDI.cif] --rep 3 3 3 --seed 1234 --format gromacs --water ice --depol=optimal
INFO No rotmatrices in lattice
INFO Cell dimension:
INFO   a = 6.926
INFO   b = 6.926
INFO   c = 6.41
INFO   A = 90.0
INFO   B = 90.0
INFO   C = 90.0
INFO HB connectivity is not defined.
INFO __init__: end.
INFO __init__: 2 ms
INFO main: end.
INFO main: 332 ms
Traceback (most recent call last):
  File "/home/ruslan/.local/lib/python3.8/site-packages/genice2/genice.py", line 534, in __init__
    self.bondlen = lat.bondlen
AttributeError: 'Lattice' object has no attribute 'bondlen'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ruslan/.local/bin/genice2", line 8, in <module>
    sys.exit(main())
  File "/home/ruslan/.local/lib/python3.8/site-packages/genice2/decorators.py", line 14, in _time_it
    return func(*args, **kwargs)
  File "/home/ruslan/.local/lib/python3.8/site-packages/genice2/decorators.py", line 34, in _banner
    return func(*args, **kwargs)
  File "/home/ruslan/.local/lib/python3.8/site-packages/genice2/cli/genice.py", line 201, in main
    lat = GenIce(safe_import("lattice", lattice_type).Lattice(**lattice_options),
  File "/home/ruslan/.local/lib/python3.8/site-packages/genice2/decorators.py", line 14, in _time_it
    return func(*args, **kwargs)
  File "/home/ruslan/.local/lib/python3.8/site-packages/genice2/decorators.py", line 34, in _banner
    return func(*args, **kwargs)
  File "/home/ruslan/.local/lib/python3.8/site-packages/genice2/genice.py", line 540, in __init__
    p = pl.pairs_iter(self.waters,
TypeError: pairs_iter() got an unexpected keyword argument 'rc'
INFO Completed.

ruslan@neptunus:~/Documents/genice-test$ 

GenIce version and Platform

rusl2019 commented 2 years ago

This issue is already finished by changing the variable rc when using the pairlist module in files genice.py and CIF.py.

Thank you so much for providing this powerful tool to generate ice structures. Hopefully, I can help to develop this tool.

vitroid commented 2 years ago

Thank you very much for reporting the bugs, and sorry for replying late. It is a bug caused by the changes in PairList module. I made a careless change which caused the incompatibilities. The bug was fixed.