Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pymolfile
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nomad-lab
pymolfile
Commits
56f1a324
Commit
56f1a324
authored
Oct 31, 2017
by
Berk Onat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pymolfile installer updated
parent
3ae2ac9b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4641 additions
and
67 deletions
+4641
-67
pymolfile/molfile/libpymolfile.py
pymolfile/molfile/libpymolfile.py
+163
-0
pymolfile/molfile/libpymolfile_wrap.cpp
pymolfile/molfile/libpymolfile_wrap.cpp
+4465
-0
setup.py
setup.py
+13
-67
No files found.
pymolfile/molfile/libpymolfile.py
0 → 100644
View file @
56f1a324
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
"""
:Author: Berk Onat <b.onat@warwick.ac.uk>
:Year: 2017
:Licence: UIUC LICENSE
"""
from
sys
import
version_info
as
_swig_python_version_info
if
_swig_python_version_info
>=
(
2
,
7
,
0
):
def
swig_import_helper
():
import
importlib
pkg
=
__name__
.
rpartition
(
'.'
)[
0
]
mname
=
'.'
.
join
((
pkg
,
'_libpymolfile'
)).
lstrip
(
'.'
)
try
:
return
importlib
.
import_module
(
mname
)
except
ImportError
:
return
importlib
.
import_module
(
'_libpymolfile'
)
_libpymolfile
=
swig_import_helper
()
del
swig_import_helper
elif
_swig_python_version_info
>=
(
2
,
6
,
0
):
def
swig_import_helper
():
from
os.path
import
dirname
import
imp
fp
=
None
try
:
fp
,
pathname
,
description
=
imp
.
find_module
(
'_libpymolfile'
,
[
dirname
(
__file__
)])
except
ImportError
:
import
_libpymolfile
return
_libpymolfile
try
:
_mod
=
imp
.
load_module
(
'_libpymolfile'
,
fp
,
pathname
,
description
)
finally
:
if
fp
is
not
None
:
fp
.
close
()
return
_mod
_libpymolfile
=
swig_import_helper
()
del
swig_import_helper
else
:
import
_libpymolfile
del
_swig_python_version_info
try
:
_swig_property
=
property
except
NameError
:
pass
# Python < 2.2 doesn't have 'property'.
try
:
import
builtins
as
__builtin__
except
ImportError
:
import
__builtin__
def
_swig_setattr_nondynamic
(
self
,
class_type
,
name
,
value
,
static
=
1
):
if
(
name
==
"thisown"
):
return
self
.
this
.
own
(
value
)
if
(
name
==
"this"
):
if
type
(
value
).
__name__
==
'SwigPyObject'
:
self
.
__dict__
[
name
]
=
value
return
method
=
class_type
.
__swig_setmethods__
.
get
(
name
,
None
)
if
method
:
return
method
(
self
,
value
)
if
(
not
static
):
if
_newclass
:
object
.
__setattr__
(
self
,
name
,
value
)
else
:
self
.
__dict__
[
name
]
=
value
else
:
raise
AttributeError
(
"You cannot add attributes to %s"
%
self
)
def
_swig_setattr
(
self
,
class_type
,
name
,
value
):
return
_swig_setattr_nondynamic
(
self
,
class_type
,
name
,
value
,
0
)
def
_swig_getattr
(
self
,
class_type
,
name
):
if
(
name
==
"thisown"
):
return
self
.
this
.
own
()
method
=
class_type
.
__swig_getmethods__
.
get
(
name
,
None
)
if
method
:
return
method
(
self
)
raise
AttributeError
(
"'%s' object has no attribute '%s'"
%
(
class_type
.
__name__
,
name
))
def
_swig_repr
(
self
):
try
:
strthis
=
"proxy of "
+
self
.
this
.
__repr__
()
except
__builtin__
.
Exception
:
strthis
=
""
return
"<%s.%s; %s >"
%
(
self
.
__class__
.
__module__
,
self
.
__class__
.
__name__
,
strthis
,)
try
:
_object
=
object
_newclass
=
1
except
__builtin__
.
Exception
:
class
_object
:
pass
_newclass
=
0
def
molfile_plugin_list
(
maxsize
:
'int'
)
->
"PyObject *"
:
"""molfile_plugin_list(maxsize) -> PyObject *"""
return
_libpymolfile
.
molfile_plugin_list
(
maxsize
)
def
molfile_init
()
->
"int"
:
"""molfile_init() -> int"""
return
_libpymolfile
.
molfile_init
()
def
molfile_finish
()
->
"int"
:
"""molfile_finish() -> int"""
return
_libpymolfile
.
molfile_finish
()
def
get_plugin
(
molcapsule
:
'PyObject *'
,
plug_no
:
'int'
)
->
"PyObject *"
:
"""get_plugin(molcapsule, plug_no) -> PyObject *"""
return
_libpymolfile
.
get_plugin
(
molcapsule
,
plug_no
)
def
molfile_plugin_info
(
molcapsule
:
'PyObject *'
,
plugin_no
:
'int'
)
->
"PyObject *"
:
"""molfile_plugin_info(molcapsule, plugin_no) -> PyObject *"""
return
_libpymolfile
.
molfile_plugin_info
(
molcapsule
,
plugin_no
)
def
open_file_read
(
molcapsule
:
'PyObject *'
,
fname
:
'char *'
,
ftype
:
'char *'
,
natoms
:
'int'
)
->
"PyObject *"
:
"""open_file_read(molcapsule, fname, ftype, natoms) -> PyObject *"""
return
_libpymolfile
.
open_file_read
(
molcapsule
,
fname
,
ftype
,
natoms
)
def
close_file_read
(
molpack
:
'PyObject *'
)
->
"PyObject *"
:
"""close_file_read(molpack) -> PyObject *"""
return
_libpymolfile
.
close_file_read
(
molpack
)
def
read_fill_structure
(
molpack
:
'PyObject *'
,
prototype
:
'PyObject *'
)
->
"PyObject *"
:
"""read_fill_structure(molpack, prototype) -> PyObject *"""
return
_libpymolfile
.
read_fill_structure
(
molpack
,
prototype
)
def
read_fill_bonds
(
molpack
:
'PyObject *'
)
->
"PyObject *"
:
"""read_fill_bonds(molpack) -> PyObject *"""
return
_libpymolfile
.
read_fill_bonds
(
molpack
)
def
read_fill_angles
(
molpack
:
'PyObject *'
)
->
"PyObject *"
:
"""read_fill_angles(molpack) -> PyObject *"""
return
_libpymolfile
.
read_fill_angles
(
molpack
)
def
read_fill_next_timestep
(
molpack
:
'PyObject *'
)
->
"PyObject *"
:
"""read_fill_next_timestep(molpack) -> PyObject *"""
return
_libpymolfile
.
read_fill_next_timestep
(
molpack
)
def
are_plugins_same
(
molpack_a
:
'PyObject *'
,
molpack_b
:
'PyObject *'
)
->
"PyObject *"
:
"""are_plugins_same(molpack_a, molpack_b) -> PyObject *"""
return
_libpymolfile
.
are_plugins_same
(
molpack_a
,
molpack_b
)
def
are_filehandles_same
(
molpack_a
:
'PyObject *'
,
molpack_b
:
'PyObject *'
)
->
"PyObject *"
:
"""are_filehandles_same(molpack_a, molpack_b) -> PyObject *"""
return
_libpymolfile
.
are_filehandles_same
(
molpack_a
,
molpack_b
)
# This file is compatible with both classic and new-style classes.
pymolfile/molfile/libpymolfile_wrap.cpp
0 → 100644
View file @
56f1a324
This source diff could not be displayed because it is too large. You can
view the blob
instead.
setup.py
View file @
56f1a324
...
...
@@ -10,39 +10,21 @@ import subprocess
from
distutils.version
import
LooseVersion
try
:
from
setuptools.command.build_ext
import
build_ext
#from setuptools.command.build_ext import build_ext as _build_ext
from
setuptools
import
Distribution
,
setup
,
Extension
,
Command
,
find_packages
from
setuptools
import
setup
,
Extension
,
Command
,
find_packages
from
setuptools.command.install
import
install
#
from Cython.Build import cythonize
#from Cython.Distutils import build_ext as _
build_ext
from
Cython.Build
import
cythonize
from
Cython.Distutils
import
build_ext
except
:
from
distutils.command.build_ext
import
build_ext
#from distutils.command.build_ext import build_ext as _build_ext
from
distutils
import
Distribution
,
setup
,
Extension
,
Command
,
find_packages
from
distutils
import
setup
,
Extension
,
Command
,
find_packages
from
distutils.command.install
import
install
#
from Cython.Build import cythonize
#from Cython.Distutils import build_ext as _
build_ext
from
Cython.Build
import
cythonize
from
Cython.Distutils
import
build_ext
try
:
from
setuptools.command.build_clib
import
build_clib
as
_build_clib
except
:
from
distutils.command.build_clib
import
build_clib
as
_build_clib
#def use_system():
# install_type = os.environ.get("SODIUM_INSTALL")
#
# if install_type == "system":
# # If we are forcing system installs, don't compile the bundled one
# return True
# else:
# # By default we just use the bundled copy
# return False
#class Distribution(Distribution):
# def has_c_libraries(self):
# return not use_system()
class
CMakeExtension
(
Extension
):
def
__init__
(
self
,
name
,
sourcedir
=
''
):
Extension
.
__init__
(
self
,
name
,
sources
=
[])
...
...
@@ -88,21 +70,6 @@ class build_clib(_build_clib):
print
()
# Add an empty line for cleaner output
#def build_ext(_build_ext):
# def run(self):
# buildflag = True
# if buildflag:
# #if self.distribution.has_c_libraries():
# build_clib = self.get_finalized_command("build_clib")
# self.include_dirs.append(
# os.path.join(build_clib.build_clib, "include"),
# )
# self.library_dirs.insert(0,
# os.path.join(build_clib.build_clib, "lib"),
# )
# for ext in self.extensions:
# return _build_ext.run(ext)
def
get_ext_filename_without_platform_suffix
(
filename
):
name
,
ext
=
os
.
path
.
splitext
(
filename
)
ext_suffix
=
sysconfig
.
get_config_var
(
'EXT_SUFFIX'
)
...
...
@@ -132,7 +99,6 @@ CLASSIFIERS = [
"Programming Language :: C"
,
"Programming Language :: C++"
,
"Programming Language :: Python"
,
"Programming Language :: Python :: 2"
,
"Programming Language :: Python :: 3"
,
"Topic :: Scientific/Engineering :: Physics"
,
"Topic :: Scientific/Engineering :: Chemistry"
,
...
...
@@ -203,32 +169,23 @@ def get_numpy_include():
return
numpy_include
# from SimpleTraj setup.py (https://github.com/arose/simpletraj)
# Needed for large-file seeking under 32bit systems (migth need for indexing and access).
largefile_macros
=
[
(
"_LARGEFILE_SOURCE"
,
None
),
(
"_LARGEFILE64_SOURCE"
,
None
),
(
"_FILE_OFFSET_BITS"
,
"64"
)
]
if
__name__
==
'__main__'
:
libpymolfile_module
=
Extension
(
'pymolfile/molfile/libpymolfile'
,
'pymolfile/molfile/
_
libpymolfile'
,
sources
=
[
'pymolfile/molfile/libpymolfile.i'
,
'pymolfile/molfile/pymolfile.cxx'
,
#'build/molfile_plugins/compile/lib/',
#'build/external/tng/lib/',
],
swig_opts
=
[
'-py3'
,
'-Wall'
,
'-c++'
],
library_dirs
=
[
'build/external/tng/lib'
,
'build/molfile_plugins/compile/lib/'
],
libraries
=
[
'netcdf'
,
'
tng_io'
,
'expat
'
],
libraries
=
[
'netcdf'
,
'
expat'
,
'tcl
'
],
include_dirs
=
[
get_numpy_include
(),
#get_cmake_includes(),
'pymolfile/molfile'
,
'pymolfile/molfile/molfile_plugins/include'
,
'pymolfile/molfile/molfile_plugins/molfile_plugin/include'
,
...
...
@@ -236,20 +193,13 @@ if __name__ == '__main__':
'build/external/tng/include'
,
],
extra_compile_args
=
[
'-fPIC'
,
'-shared'
,
'-O2'
,
'-w'
#'-DNDEBUG', '-DUNIX', '-D__UNIX', '-m64',
#'-fPIC', '-O2', '-w', '-fmessage-length=0'
'-fPIC'
,
'-shared'
,
'-O0'
,
'-g'
,
'-w'
],
extra_link_args
=
[
'build/molfile_plugins/compile/lib/libmolfile_plugin.a'
'build/molfile_plugins/compile/lib/libmolfile_plugin.a'
,
'build/external/tng/lib/libtng_io.a'
,
],
#define_macros = largefile_macros
)
#if sys.version_info > (3,):
# command_extension={'build_ext': BuildExtWithoutPlatformSuffix}
#else:
command_extension
=
{}
#command_extension=dict(build_ext=CMakeBuild)
setup
(
name
=
"pymolfile"
,
...
...
@@ -262,19 +212,15 @@ if __name__ == '__main__':
url
=
"https://gitlab.mpcdf.mpg.de/berko/pymolfile"
,
zip_safe
=
False
,
packages
=
find_packages
(),
#library_dirs=[
# 'build/external/tng/lib'
#],
libraries
=
[(
'molfile_plugin'
,
{
'sources'
:
[
'build/molfile_plugins/compile/lib/libmolfile_plugin.a'
]})],
cmdclass
=
{
'build_clib'
:
build_clib
,
'build_ext'
:
BuildExtWithoutPlatformSuffix
,
'build_ext'
:
build_ext
,
},
#distclass=Distribution,
ext_modules
=
[
#CMakeExtension('molfile', sourcedir='pymolfile/molfile/'),
libpymolfile_module
,
],
package_data
=
{
'pymolfile'
:
[
'LICENSE'
,
'pymolfile/molfile/libpymolfile.py'
]},
py_modules
=
[
"pymolfile"
],
requires
=
[
"numpy"
],
setup_requires
=
[
"numpy"
],
...
...
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