Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
west-public
westpy
Commits
7c742484
Commit
7c742484
authored
Jun 30, 2020
by
Marco Govoni
Browse files
Removed from future
parent
e66ff98a
Changes
10
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
7c742484
...
...
@@ -7,4 +7,4 @@ clean:
rm
-rf
westpy.egg-info
rm
-rf
dist
rm
-rf
build
rm
files.txt
rm
files.txt
westpy/__init__.py
View file @
7c742484
from
__future__
import
print_function
from
westpy.units
import
*
from
westpy.utils
import
*
from
westpy.atom
import
*
...
...
westpy/atom.py
View file @
7c742484
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
westpy/dataContainer.py
View file @
7c742484
from
__future__
import
print_function
class
DataContainer
()
:
#
"""Class for representing an in-memory data container.
...
...
westpy/electronicStructure.py
View file @
7c742484
from
__future__
import
print_function
class
ElectronicStructure
()
:
"""Class for representing an electronic structure calculation.
...
...
westpy/geometry.py
View file @
7c742484
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
()
westpy/groundState.py
View file @
7c742484
from
__future__
import
print_function
import
requests
import
json
from
ast
import
literal_eval
...
...
westpy/session.py
View file @
7c742484
from
__future__
import
print_function
class
Session
(
object
):
"""Class for setting up a session, connected to a remove server via rest APIs.
...
...
westpy/units.py
View file @
7c742484
from
__future__
import
print_function
"""Westpy uses Hartree atomic units."""
...
...
westpy/utils.py
View file @
7c742484
from
__future__
import
print_function
""" Set of utilities."""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment