mirror of
https://gitlab.com/scemama/resultsFile.git
synced 2024-11-07 06:33:41 +01:00
First working release for Python3
This commit is contained in:
parent
806544a778
commit
698a592251
@ -1171,12 +1171,12 @@ class gamessFile(resultsFile.resultsFileX):
|
||||
|
||||
def get_num_alpha(self):
|
||||
if self._num_alpha is None:
|
||||
self._num_alpha = (self.num_elec + self.multiplicity-1)/2
|
||||
self._num_alpha = (self.num_elec + self.multiplicity-1)//2
|
||||
return self._num_alpha
|
||||
|
||||
def get_num_beta(self):
|
||||
if self._num_beta is None:
|
||||
self._num_beta = (self.num_elec - self.multiplicity+1)/2
|
||||
self._num_beta = (self.num_elec - self.multiplicity+1)//2
|
||||
return self._num_beta
|
||||
|
||||
def get_determinants_mo_type(self):
|
||||
|
@ -532,7 +532,7 @@ class gaussianFile(resultsFile.resultsFileX):
|
||||
self.find_next_string(" 1 2")
|
||||
posend[index] = []
|
||||
posend[index].append(self._pos)
|
||||
end = self._pos + (4+len(self.basis))/5 * ( len(self.basis) + 3 )
|
||||
end = self._pos + (4+len(self.basis))//5 * ( len(self.basis) + 3 )
|
||||
posend[index].append(end)
|
||||
if method.startswith("U"):
|
||||
self.find_string("Beta Molecular Orbital Coefficients")
|
||||
@ -541,7 +541,7 @@ class gaussianFile(resultsFile.resultsFileX):
|
||||
self.find_next_string(" 1 2")
|
||||
posend[index] = []
|
||||
posend[index].append(self._pos)
|
||||
end = self._pos + (4+len(self.basis))/5 * ( len(self.basis) + 3 )
|
||||
end = self._pos + (4+len(self.basis))//5 * ( len(self.basis) + 3 )
|
||||
posend[index].append(end)
|
||||
except IndexError:
|
||||
pass
|
||||
@ -552,7 +552,7 @@ class gaussianFile(resultsFile.resultsFileX):
|
||||
self.find_next_string(" 1 2")
|
||||
posend[index] = []
|
||||
posend[index].append(self._pos)
|
||||
end = self._pos + (4+len(self.basis))/5 * ( len(self.basis) + 2 )
|
||||
end = self._pos + (4+len(self.basis))//5 * ( len(self.basis) + 2 )
|
||||
posend[index].append(end)
|
||||
except IndexError:
|
||||
pass
|
||||
|
@ -218,7 +218,7 @@ class wfnFile(resultsFile.resultsFileX):
|
||||
|
||||
def get_num_beta(self):
|
||||
if self._num_beta is None:
|
||||
self._num_beta = self.num_elec/2
|
||||
self._num_beta = self.num_elec//2
|
||||
return self._num_beta
|
||||
|
||||
def get_determinants_mo_type(self):
|
||||
|
@ -620,12 +620,12 @@ class xmvbFile(resultsFile.resultsFileX):
|
||||
|
||||
def get_num_alpha(self):
|
||||
if self._num_alpha is None:
|
||||
self._num_alpha = self.num_elec/2 + (self.multiplicity-1)/2
|
||||
self._num_alpha = self.num_elec//2 + (self.multiplicity-1)//2
|
||||
return self._num_alpha
|
||||
|
||||
def get_num_beta(self):
|
||||
if self._num_beta is None:
|
||||
self._num_beta = self.num_elec/2 - (self.multiplicity-1)/2
|
||||
self._num_beta = self.num_elec//2 - (self.multiplicity-1)//2
|
||||
return self._num_beta
|
||||
|
||||
def get_determinants_mo_type(self):
|
||||
|
@ -298,6 +298,7 @@ class resultsFileX(object):
|
||||
for mo in mo_sets[motype]:
|
||||
newvec = []
|
||||
vec = mo.vector
|
||||
print(mo.vector)
|
||||
for i,w in zip(map,weight):
|
||||
newvec.append(vec[i]*w)
|
||||
mo.vector = newvec
|
||||
|
@ -1,51 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# resultsFile is a library which allows to read output files of quantum
|
||||
# chemistry codes and write input files.
|
||||
# Copyright (C) 2007 Anthony SCEMAMA
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Anthony Scemama
|
||||
# LCPQ - IRSAMC
|
||||
# Universite Paul Sabatier
|
||||
# 118, route de Narbonne
|
||||
# 31062 Toulouse Cedex 4
|
||||
# scemama@irsamc.ups-tlse.fr
|
||||
|
||||
|
||||
|
||||
from distutils.core import setup
|
||||
from distutils.extension import Extension
|
||||
from Cython.Distutils import build_ext
|
||||
|
||||
|
||||
"""
|
||||
./cython_setup build_ext --inplace
|
||||
"""
|
||||
|
||||
ext_modules = [Extension("lib_cython", ["lib_cython.pyx"])]
|
||||
|
||||
import os
|
||||
setup(name="resultsFile",
|
||||
version=os.getenv("VERSION","1.0"),
|
||||
author="Anthony Scemama",
|
||||
author_email="scemama@irsamc.ups-tlse.fr",
|
||||
license="gpl-license",
|
||||
description="Module for I/O on Quantum Chemistry files.",
|
||||
packages=["resultsFile","resultsFile.lib","resultsFile.Modules"],
|
||||
cmdclass = {'build_ext': build_ext},
|
||||
ext_modules = ext_modules
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user