Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rtools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FHI Theory
rtools
Commits
21caafb4
Commit
21caafb4
authored
Jun 12, 2020
by
Christian Kunkel
Browse files
Options
Downloads
Patches
Plain Diff
py3 compatibility for converters
parent
40d7b21a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
rtools/helpers/converters.py
+11
-3
11 additions, 3 deletions
rtools/helpers/converters.py
with
11 additions
and
3 deletions
rtools/helpers/converters.py
+
11
−
3
View file @
21caafb4
...
...
@@ -21,13 +21,21 @@ codes, e.h. ase2rdkit or ase2pybel.
Author: Christoph Schober, 2015
"""
import
StringIO
try
:
import
StringIO
as
io
except
ImportError
:
import
io
import
ase
import
ase.io
try
:
import
pybel
as
pb
except
ImportError
:
try
:
import
openbabel.pybel
as
pb
except
:
print
(
'
pybel is not installed, related methods will fail.
'
)
try
:
...
...
@@ -107,7 +115,7 @@ def xyz2ase(xyz_str):
"""
Convert a xyz file to an ASE atoms object via in-memory file (StringIO).
"""
xyzfile
=
StringIO
.
StringIO
()
xyzfile
=
io
.
StringIO
()
xyzfile
.
write
(
xyz_str
)
mol
=
ase
.
io
.
read
(
xyzfile
,
format
=
"
xyz
"
)
return
mol
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment