Skip to content

Commit 6348d6d

Browse files
Merge pull request #1 from OctaDist/nightly-build
from Nightly build v.2.5.2.2
2 parents bc718f5 + 3cda97b commit 6348d6d

24 files changed

Lines changed: 1625 additions & 1309 deletions

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ python:
1010
- "3.7" # 3.7 development branch
1111

1212
install:
13-
- pip install octadist
13+
# - pip install octadist
14+
- pip install -i https://test.pypi.org/simple/ octadist
1415

1516
script:
1617
- cd example-py
1718
- python example_1.py
1819
- python example_2.py
1920
- python example_3.py
2021
- python example_4.py
21-
22+
- python example_5.py

README.md

Lines changed: 69 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,60 @@
11
[![Travis-CI Test](https://img.shields.io/travis/OctaDist/OctaDist-PyPI/master.svg
22
)](https://travis-ci.org/OctaDist/OctaDist-PyPI)
3-
[![Github release](https://img.shields.io/github/release/OctaDist/OctaDist-PyPI.svg
4-
)](https://github.com/OctaDist/OctaDist/releases)
5-
[![Code size](https://img.shields.io/github/languages/code-size/OctaDist/OctaDist-PyPI.svg)](https://github.com/OctaDist/OctaDist-PyPI)
6-
[![Repo size](https://img.shields.io/github/repo-size/OctaDist/OctaDist-PyPI.svg)](https://github.com/OctaDist/OctaDist-PyPI)
3+
![Python version](https://img.shields.io/pypi/pyversions/octadist.svg)
4+
![Python Wheel](https://img.shields.io/pypi/wheel/octadist.svg)
5+
![Code size](https://img.shields.io/github/languages/code-size/OctaDist/OctaDist-PyPI.svg)
6+
![Repo size](https://img.shields.io/github/repo-size/OctaDist/OctaDist-PyPI.svg)
77

8-
## OctaDist-PyPI
9-
Octahedral distortion calculator: A program for determining the structural distortion of the octahedral complexes. https://octadist.github.io/
8+
## OctaDist
9+
10+
Octahedral distortion calculator:
11+
A tool for calculating distortion parameters in coordination complexes.
12+
https://octadist.github.io/
1013

1114
<p align="center">
12-
<img alt="molecule" src="https://raw.githubusercontent.com/OctaDist/OctaDist/master/images/molecule.png" align=middle width="200pt" />
15+
<img alt="molecule"
16+
src="https://raw.githubusercontent.com/OctaDist/OctaDist-PyPI/master/images/molecule.png"
17+
align=middle
18+
width="200pt" />
1319
<p/>
1420

1521
This program is written entirely in Python 3 and tested on PyCharm (Community Edition).
1622

17-
## Installation
18-
- Install the latest version: `pip install octadist`
19-
- Upgrade to the latest version: `pip install --upgrade octadist`
20-
- Upgrade/downgrade to a specific version: `pip install --upgrade octadist==2.5.0`
23+
## Features
2124

22-
## Sample usage
23-
Example scripts are available at [here](https://github.com/OctaDist/OctaDist-PyPI/tree/master/example-py).
25+
OctaDist is designed as a smart tool used for studying the structural distortion in coordinate complexes.
26+
With the abilities of OctaDist, you can:
2427

25-
First of all, you have to import necessary modules for computing the octahedral distortion parameters, called `calc`:
28+
- identify the type of octahedral coordination complexes.
29+
- compute octahedral distortion parameters.
30+
- display 3D molecule and other stuff.
31+
- implement its functionality in your or other program.
2632

27-
```
28-
from octadist import calc
29-
```
3033

31-
Prepare list (or array) for atomic labels and coordinates:
34+
## Getting started
35+
36+
All details of OctaDist is available at [user manual](https://octadist.github.io/manual.html) on the website.
37+
38+
39+
## Installing
40+
41+
- Install the latest version:
42+
```
43+
pip install octadist
44+
```
45+
- Upgrade/downgrade to a specific version:
46+
```
47+
pip install --upgrade octadist==2.5.1
48+
```
49+
50+
## Running the test
51+
52+
Prepare two lists of atomic symbols and atomic coordinates, the latter can be stored in array:
3253

3354
```
3455
atom = ['Fe', 'O', 'O', 'N', 'N', 'N', 'N']
3556
36-
coor = [[2.298354000, 5.161785000, 7.971898000],
57+
coor = [[2.298354000, 5.161785000, 7.971898000], # <- Metal center atom
3758
[1.885657000, 4.804777000, 6.183726000],
3859
[1.747515000, 6.960963000, 7.932784000],
3960
[4.094380000, 5.807257000, 7.588689000],
@@ -42,50 +63,60 @@ coor = [[2.298354000, 5.161785000, 7.971898000],
4263
[2.886404000, 5.392925000, 9.848966000]]
4364
```
4465

45-
or you can open input file and extract the octahedral structure from input metal complex using a module called `coord`:
66+
Import necessary module for computing the octahedral distortion parameters, called `calc`:
4667

4768
```
48-
from octadist import coord, calc
69+
from octadist import calc
4970
```
5071

51-
For example, input file `full\path\of\your\input\file\Multiple-metals.xyz`
52-
(other example input files are available at [here](https://github.com/OctaDist/OctaDist-PyPI/tree/master/example-input)):
72+
Then calculate all parameters separately, for example:
5373

5474
```
55-
file = r"full\path\of\your\input\file\Multiple-metals.xyz"
56-
57-
atom, coor = coord.extract_octa(file)
75+
d_bond = octadist.calc_d_bond(coor) # Bond distance
76+
d_mean = octadist.calc_d_mean(coor) # Mean distance
77+
zeta = octadist.calc_zeta(coor) # Zeta
78+
delta = octadist.calc_delta(coor) # Delta
79+
angle = octadist.calc_bond_angle(coor) # Bond angle
80+
sigma = octadist.calc_sigma(coor) # Sigma
81+
theta = octadist.calc_theta(atom, coor) # Theta
5882
```
5983

60-
Then calculate all octahedral parameters
84+
or calculate them at once:
6185

6286
```
63-
d_mean, zeta, delta, sigma, theta = calc.calc_all(atom, coor)
87+
zeta, delta, sigma, theta = calc.calc_all(coor)
6488
```
6589

66-
and print all computed parameters:
90+
Then print all computed parameters:
6791

6892
```
69-
All computed parameters
70-
-----------------------
71-
Zeta = 0.22807256171728651
72-
Delta = 0.0004762517834704151
73-
Sigma = 47.926528379270124
74-
Theta = 122.688972774546
93+
Computed parameters
94+
-------------------
95+
Zeta = 0.228072561
96+
Delta = 0.000476251
97+
Sigma = 47.92652837
98+
Theta = 122.6889727
7599
```
76100

77-
Please cite this project when you use OctaDist for scientific publication.
101+
Example scripts and coordinate files are available at
102+
[example-py](https://github.com/OctaDist/OctaDist-PyPI/tree/master/example-py) and at
103+
[example-input](https://github.com/OctaDist/OctaDist-PyPI/tree/master/example-input).
104+
105+
## Citation
106+
107+
Please cite this project when you have used OctaDist for scientific publication.
78108

79109
```
80-
OctaDist - A program for determining the structural distortion of the octahedral complexes.
110+
OctaDist: A tool for calculating distortion parameters in coordination complexes.
81111
https://octadist.github.io
82112
```
83113

84-
85114
## Bug report
115+
86116
If you found issues in OctaDist, please report us at [here](https://github.com/OctaDist/OctaDist/issues).
87117

88118
## Project team
119+
89120
- [Rangsiman Ketkaew](https://sites.google.com/site/rangsiman1993) (Thammasat University) <br/>
90121
- E-mail: rangsiman1993@gmail.com <br/>
91122
- [Yuthana Tantirungrotechai](https://sites.google.com/site/compchem403/people/faculty/yuthana) (Thammasat University)

example-py/example_1.py

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
1+
###################################################
2+
# Example 1 for running the test on OctaDist PyPI #
3+
###################################################
4+
15
from octadist import calc
26

3-
#############
4-
# Example 1 #
5-
#############
7+
# The first atom must be metal center atom of octahedral structure.
8+
# If not, please see example_2.py for how to handle this issue.
69

7-
# Prepare two lists for atomic labels and coordinates (or array for the latter)
810
atom = ['Fe', 'O', 'O', 'N', 'N', 'N', 'N']
911

10-
coor = [[2.298354000, 5.161785000, 7.971898000],
12+
coor = [[2.298354000, 5.161785000, 7.971898000], # <- Metal atom
1113
[1.885657000, 4.804777000, 6.183726000],
1214
[1.747515000, 6.960963000, 7.932784000],
1315
[4.094380000, 5.807257000, 7.588689000],
1416
[0.539005000, 4.482809000, 8.460004000],
1517
[2.812425000, 3.266553000, 8.131637000],
1618
[2.886404000, 5.392925000, 9.848966000]]
1719

18-
# Calculate all octahedral parameters
19-
d_mean, zeta, delta, sigma, theta = calc.calc_all(atom, coor)
20+
zeta, delta, sigma, theta = calc.calc_all(coor)
2021

21-
# Show all computed parameters
22-
print("\nEx.1: All computed parameters")
23-
print("-----------------------------")
24-
print("Mean distance =", d_mean)
25-
print(" Zeta =", zeta)
26-
print(" Delta =", delta)
27-
print(" Sigma =", sigma)
28-
print(" Theta =", theta)
22+
print("\nAll computed parameters")
23+
print("-----------------------")
24+
print("Zeta =", zeta)
25+
print("Delta =", delta)
26+
print("Sigma =", sigma)
27+
print("Theta =", theta)
2928

29+
# All computed parameters
30+
# -----------------------
31+
# Zeta = 0.22807256171728651
32+
# Delta = 0.0004762517834704151
33+
# Sigma = 47.926528379270124
34+
# Theta = 122.688972774546

example-py/example_2.py

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,36 @@
1-
from octadist import coord, calc
1+
###################################################
2+
# Example 2 for running the test on OctaDist PyPI #
3+
###################################################
24

3-
#############
4-
# Example 2 #
5-
#############
5+
from octadist import calc, coord
66

7-
# Open and read input file
8-
file = r"../example-input/Multiple-metals.xyz"
7+
atom = ['O', 'O', 'Fe', 'N', 'N', 'N', 'N']
98

10-
# Extract atomic labels and coordinates of octahedral structure from metal complex
11-
atom, coor = coord.extract_octa(file)
9+
coor = [[1.885657000, 4.804777000, 6.183726000],
10+
[1.747515000, 6.960963000, 7.932784000],
11+
[2.298354000, 5.161785000, 7.971898000], # <- Metal atom
12+
[4.094380000, 5.807257000, 7.588689000],
13+
[0.539005000, 4.482809000, 8.460004000],
14+
[2.812425000, 3.266553000, 8.131637000],
15+
[2.886404000, 5.392925000, 9.848966000]]
1216

13-
# Calculate all octahedral parameters
14-
d_mean, zeta, delta, sigma, theta = calc.calc_all(atom, coor)
17+
# What if the first atom in atomic symbol and coordinates lists are not metal atom,
18+
# you can also use coord.extract_octa to rearrange the sequence of atom in list.
1519

16-
# Show all computed parameters
17-
print("\nEx.2: All computed parameters")
18-
print("-----------------------------")
19-
print("Mean distance =", d_mean)
20-
print(" Zeta =", zeta)
21-
print(" Delta =", delta)
22-
print(" Sigma =", sigma)
23-
print(" Theta =", theta)
20+
atom_octa, coor_octa = coord.extract_octa(atom, coor)
2421

22+
zeta, delta, sigma, theta = calc.calc_all(coor_octa)
23+
24+
print("\nAll computed parameters")
25+
print("-----------------------")
26+
print("Zeta =", zeta)
27+
print("Delta =", delta)
28+
print("Sigma =", sigma)
29+
print("Theta =", theta)
30+
31+
# All computed parameters
32+
# -----------------------
33+
# Zeta = 0.22807256171728651
34+
# Delta = 0.0004762517834704151
35+
# Sigma = 47.926528379270124
36+
# Theta = 122.688972774546

example-py/example_3.py

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
1+
###################################################
2+
# Example 3 for running the test on OctaDist PyPI #
3+
###################################################
4+
15
from octadist import coord, calc
26

3-
#############
4-
# Example 3 #
5-
#############
7+
# You can also import your input file, like this:
68

7-
# Open and read input file
89
file = r"../example-input/Multiple-metals.xyz"
910

10-
# If complex contains metal center more than one, you can specify the index of metal of interest.
11-
# For example, this complex contains three metal atoms: Fe, Ru, and Rd. I add second argument "2"
12-
# for computing the parameter for Ru metal center atom.
13-
atom, coor = coord.extract_octa(file, 2)
11+
# Then use coord.extract_file to extract all atomic symbols and coordinates,
12+
# and then use coord.extract_octa for taking the octahedral structure.
13+
14+
atom_full, coor_full = coord.extract_file(file)
15+
atom_octa, coor_octa = coord.extract_octa(atom_full, coor_full)
1416

15-
# Calculate all octahedral parameters
16-
d_mean, zeta, delta, sigma, theta = calc.calc_all(atom, coor)
17+
zeta, delta, sigma, theta = calc.calc_all(coor_octa)
1718

18-
# Show all computed parameters
19-
print("\nEx.3: All computed parameters")
20-
print("-----------------------------")
21-
print("Mean distance =", d_mean)
22-
print(" Zeta =", zeta)
23-
print(" Delta =", delta)
24-
print(" Sigma =", sigma)
25-
print(" Theta =", theta)
19+
print("\nAll computed parameters")
20+
print("-----------------------")
21+
print("Zeta =", zeta)
22+
print("Delta =", delta)
23+
print("Sigma =", sigma)
24+
print("Theta =", theta)
2625

26+
# All computed parameters
27+
# -----------------------
28+
# Zeta = 0.0030146365519487794
29+
# Delta = 1.3695007180404868e-07
30+
# Sigma = 147.3168033970211
31+
# Theta = 520.6407679851042

example-py/example_4.py

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
1-
from octadist import coord, draw
1+
###################################################
2+
# Example 4 for running the test on OctaDist PyPI #
3+
###################################################
24

3-
#############
4-
# Example 4 #
5-
#############
5+
from octadist import coord, calc
66

7-
# Open and read input file
87
file = r"../example-input/Multiple-metals.xyz"
98

10-
# Graphical display for octahedral complex
11-
full_atom, full_coor = coord.get_coord(file)
12-
draw.all_atom(full_atom, full_coor)
9+
atom_full, coor_full = coord.extract_file(file)
1310

11+
# If complex contains metal center more than one, you can specify the index metal
12+
# whose octahedral structure will be computed.
13+
# For example, this complex contains three metal atoms: Fe, Ru, and Rd.
14+
# I add "2" as a second argument for choosing Ru as metal of interest.
15+
16+
atom_octa, coor_octa = coord.extract_octa(atom_full, coor_full, 2)
17+
18+
zeta, delta, sigma, theta = calc.calc_all(coor_octa)
19+
20+
print("\nAll computed parameters")
21+
print("-----------------------")
22+
print("Zeta =", zeta)
23+
print("Delta =", delta)
24+
print("Sigma =", sigma)
25+
print("Theta =", theta)
26+
27+
# All computed parameters
28+
# -----------------------
29+
# Zeta = 0.001616439510534251
30+
# Delta = 3.5425830613072754e-08
31+
# Sigma = 1.26579367508117
32+
# Theta = 4.177042495798965

example-py/example_5.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
###################################################
2+
# Example 5 for running the test on OctaDist PyPI #
3+
###################################################
4+
5+
from octadist import coord, draw
6+
7+
file = r"../example-input/Multiple-metals.xyz"
8+
9+
# Graphical display for octahedral complex
10+
11+
atom_full, coor_full = coord.extract_file(file)
12+
draw.all_atom(atom_full, coor_full)
13+
14+
# Display and automatically save image as .png file with user-specified name
15+
16+
draw.all_atom(atom_full, coor_full, "complex_octadist")
17+
18+
# Output image, complex_octadist.png, is stored at ../images directory

images/complex_octadist.png

81.1 KB
Loading

images/molecule.ico

66.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)