Reading from and writing to CIF files.
cif/
cif/ directory. Used so examples can refer to files such as cif/MEP.cif.4_from_cif.py
UnitCell.5_to_cif.py
4_from_cif.py |
4_from_cif.sh |
4_from_cif.yaml |
=== “4_from_cif.py”
```python
from genice3.genice import GenIce3
from genice3.plugin import Exporter
from logging import basicConfig, INFO
# corresponding command:
# genice3 'CIF[file=cif/MEP.cif, osite=T]' --exporter gromacs
basicConfig(level=INFO)
genice = GenIce3()
genice.set_unitcell("CIF", file="cif/MEP.cif", osite="T")
Exporter("gromacs").dump(genice)
```
=== “4_from_cif.sh”
```bash
#!/bin/bash
# Generated from 4_from_cif.yaml
python3 -m genice3.cli.genice CIF \
--file cif/MEP.cif \
--osite T
```
=== “4_from_cif.yaml”
```yaml
# Run with GenIce3: genice3 --config 4_from_cif.yaml
# Generated from 4_from_cif.sh
unitcell: CIF
file: cif/MEP.cif
osite: T
```
5_to_cif.py |
5_to_cif.sh |
5_to_cif.yaml |
=== “5_to_cif.py”
```python
from genice3.genice import GenIce3
from genice3.plugin import Exporter
from logging import basicConfig, INFO
# corresponding command:
# genice3 A15 -e cif
basicConfig(level=INFO)
genice = GenIce3()
genice.set_unitcell("A15")
Exporter("cif").dump(genice)
```
=== “5_to_cif.sh”
```bash
#!/bin/bash
# Generated from 5_to_cif.yaml
python3 -m genice3.cli.genice A15 \
--exporter cif
```
=== “5_to_cif.yaml”
```yaml
# Run with GenIce3: genice3 --config 5_to_cif.yaml
# Generated from 5_to_cif.sh
unitcell: A15
exporter: cif
```