Commit 7c742484 authored by Marco Govoni's avatar Marco Govoni

Removed from future

parent e66ff98a
......@@ -7,4 +7,4 @@ clean:
rm -rf westpy.egg-info
rm -rf dist
rm -rf build
rm files.txt
rm files.txt
from __future__ import print_function
from westpy.units import *
from westpy.utils import *
from westpy.atom import *
......
from __future__ import print_function
class Atom(object):
"""Class for representing a single atom.
......@@ -28,4 +26,4 @@ class Atom(object):
el = element(symbol)
#
self.symbol = el.symbol
self.position = np.array(position, float) * units
self.position = np.array(position, dtype="f8") * units
from __future__ import print_function
class DataContainer() :
#
"""Class for representing an in-memory data container.
......
from __future__ import print_function
class ElectronicStructure() :
"""Class for representing an electronic structure calculation.
......
from __future__ import print_function
class Geometry(object) :
"""Class for representing a set of atoms in a periodic cell.
......@@ -121,9 +120,9 @@ class Geometry(object) :
"""
import numpy as np
#
self.cell["a1"] = np.array(a1, float) * units
self.cell["a2"] = np.array(a2, float) * units
self.cell["a3"] = np.array(a3, float) * units
self.cell["a1"] = np.array(a1, dtype="f8") * units
self.cell["a2"] = np.array(a2, dtype="f8") * units
self.cell["a3"] = np.array(a3, dtype="f8") * units
self.cell["volume"] = np.dot(self.cell["a1"], np.cross(self.cell["a2"], self.cell["a3"]))
self.cell["b1"] = 2.0 * np.pi * np.cross(self.cell["a2"], self.cell["a3"]) / self.cell["volume"]
self.cell["b2"] = 2.0 * np.pi * np.cross(self.cell["a3"], self.cell["a1"]) / self.cell["volume"]
......@@ -168,8 +167,7 @@ class Geometry(object) :
return
import numpy as np
from westpy import Atom, Bohr
M = np.matrix([self.cell['a1'], self.cell['a2'], self.cell['a3']]).tolist()
self.atoms.append(Atom(symbol, tuple(np.array(frac_coord)@M), units=Bohr))
self.atoms.append(Atom(symbol, tuple(frac_coord[0]*self.cell['a1']+frac_coord[1]*self.cell['a2']+frac_coord[2]*self.cell['a3']), units=Bohr))
self.isSet["atoms"] = True
......@@ -364,7 +362,7 @@ class Geometry(object) :
print(xyz)
xyzview.setStyle({style: {}})
#draw the box
a0 = np.array([0.0, 0.0, 0.0])
a0 = np.array([0.0, 0.0, 0.0],dtype="f8")
from_ = [a0, a1 + a2, a1 + a3, a2 + a3]
to_ = [[a1, a2, a3], [a1, a2, a1 + a2 + a3], [a1, a3, a1 + a2 + a3], [a2, a3, a1 + a2 + a3]]
for frm, li_to in zip(from_, to_):
......@@ -377,8 +375,3 @@ class Geometry(object) :
xyzview.zoomTo()
xyzview.show()
from __future__ import print_function
import requests
import json
from ast import literal_eval
......
from __future__ import print_function
class Session(object):
"""Class for setting up a session, connected to a remove server via rest APIs.
......
from __future__ import print_function
"""Westpy uses Hartree atomic units."""
......
from __future__ import print_function
""" Set of utilities."""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment