Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
pip install 'pylint==3.2.7'
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py') --rcfile .pylintrc --fail-under=7.0
pylint $(git ls-files '*.py') --rcfile .pylintrc
2 changes: 2 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ method-rgx=(([a-z][a-zA-Z0-9]*)|([A-Z][a-zA-Z0-9]+))$
module-rgx=(([a-z][a-z0-9]*)|([A-Z][a-zA-Z0-9]+))$

[MASTER]
fail-under=7.0
persistent=no
ignore-patterns=(.)*_test\.py,test_(.)*\.py
2 changes: 1 addition & 1 deletion TurtleMol/avogadroPlugin/definiteBox.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def runCommand():

strucIO = io.StringIO(iparams['structureFile'])

struc = pd.read_csv(strucIO, delim_whitespace=',',
struc = pd.read_csv(strucIO, sep=r'\s+',
skiprows=2, names=["Atom", "X", "Y", "Z"])


Expand Down
2 changes: 1 addition & 1 deletion TurtleMol/avogadroPlugin/definiteMesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def runCommand():

strucIO = io.StringIO(iparams['structureFile'])

struc = pd.read_csv(strucIO, delim_whitespace=',',
struc = pd.read_csv(strucIO, sep=r'\s+',
skiprows=2, names=["Atom", "X", "Y", "Z"])


Expand Down
2 changes: 1 addition & 1 deletion TurtleMol/avogadroPlugin/definiteSphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def runCommand():

strucIO = io.StringIO(iparams['structureFile'])

struc = pd.read_csv(strucIO, delim_whitespace=',',
struc = pd.read_csv(strucIO, sep=r'\s+',
skiprows=2, names=["Atom", "X", "Y", "Z"])


Expand Down
2 changes: 1 addition & 1 deletion TurtleMol/avogadroPlugin/densityBox.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def runCommand():

strucIO = io.StringIO(iparams['structureFile'])

struc = pd.read_csv(strucIO, delim_whitespace=',',
struc = pd.read_csv(strucIO, sep=r'\s+',
skiprows=2, names=["Atom", "X", "Y", "Z"])


Expand Down
2 changes: 1 addition & 1 deletion TurtleMol/avogadroPlugin/densityMesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def runCommand():

strucIO = io.StringIO(iparams['structureFile'])

struc = pd.read_csv(strucIO, delim_whitespace=',',
struc = pd.read_csv(strucIO, sep=r'\s+',
skiprows=2, names=["Atom", "X", "Y", "Z"])


Expand Down
2 changes: 1 addition & 1 deletion TurtleMol/avogadroPlugin/densitySphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def runCommand():

strucIO = io.StringIO(iparams['structureFile'])

struc = pd.read_csv(strucIO, delim_whitespace=',',
struc = pd.read_csv(strucIO, sep=r'\s+',
skiprows=2, names=["Atom", "X", "Y", "Z"])


Expand Down
2 changes: 1 addition & 1 deletion TurtleMol/avogadroPlugin/fillBox.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def runCommand():

strucIO = io.StringIO(iparams['structureFile'])

struc = pd.read_csv(strucIO, delim_whitespace=',',
struc = pd.read_csv(strucIO, sep=r'\s+',
skiprows=2, names=["Atom", "X", "Y", "Z"])


Expand Down
2 changes: 1 addition & 1 deletion TurtleMol/avogadroPlugin/fillMesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def runCommand():

strucIO = io.StringIO(iparams['structureFile'])

struc = pd.read_csv(strucIO, delim_whitespace=',',
struc = pd.read_csv(strucIO, sep=r'\s+',
skiprows=2, names=["Atom", "X", "Y", "Z"])


Expand Down
2 changes: 1 addition & 1 deletion TurtleMol/avogadroPlugin/fillSphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def runCommand():

strucIO = io.StringIO(iparams['structureFile'])

struc = pd.read_csv(strucIO, delim_whitespace=',',
struc = pd.read_csv(strucIO, sep=r'\s+',
skiprows=2, names=["Atom", "X", "Y", "Z"])


Expand Down
2 changes: 1 addition & 1 deletion TurtleMol/readWriteFiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def readStrucFile(filePath):
'''Reads structure file'''
# Reads XYZ
if str(filePath[-3:]).lower() == 'xyz':
return pd.read_csv(filePath, delim_whitespace=True,
return pd.read_csv(filePath, sep=r'\s+',
skiprows=2, names=["Atom", "X", "Y", "Z"]), None, None
# Reads PDB
if str(filePath[-3:]).lower() == 'pdb':
Expand Down
6 changes: 4 additions & 2 deletions tests/test_BaseStruc.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ def testBaseStruc():
if name not in iparamsCube:
iparamsCube[name] = dparams[name]

struc, unitCell = readStrucFile(iparamsSphere['structureFile'])
struc, unitCell, connectivity = readStrucFile(iparamsSphere['structureFile'])

if iparamsSphere['baseStrucFile']:
baseStruc, baseUnitCell = readStrucFile(iparamsSphere['baseStrucFile'])
baseStruc, baseUnitCell, baseConnectivity = readStrucFile(
iparamsSphere['baseStrucFile']
)
else:
baseStruc = None

Expand Down
6 changes: 3 additions & 3 deletions tests/test_atomFill.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ def testAtomFill():
if name not in iparamsCube:
iparamsCube[name] = dparams[name]

struc, unitCell = readStrucFile(iparamsSphere['structureFile'])
struc, unitCell, connectivity = readStrucFile(iparamsSphere['structureFile'])

if iparamsSphere['baseStrucFile']:
baseStruc = readStrucFile(iparamsSphere['baseStrucFile'])
baseStruc, _, _ = readStrucFile(iparamsSphere['baseStrucFile'])
else:
baseStruc = None

Expand All @@ -45,4 +45,4 @@ def testAtomFill():

outStrucSphere, strucTypeSphere = drawMolSphere(struc, baseStruc, iparamsSphere)
assert len(outStrucSphere) != 0, "Output structure should have some length"
assert strucTypeSphere == "atom", "Structure type should be an atom"
assert strucTypeSphere == "atom", "Structure type should be an atom"
6 changes: 3 additions & 3 deletions tests/test_atomRandomPlace.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ def testRandomPlace():
if name not in iparamsCube:
iparamsCube[name] = dparams[name]

struc, unitCell = readStrucFile(iparamsSphere['structureFile'])
struc, unitCell, connectivity = readStrucFile(iparamsSphere['structureFile'])

if iparamsSphere['baseStrucFile']:
baseStruc = readStrucFile(iparamsSphere['baseStrucFile'])
baseStruc, _, _ = readStrucFile(iparamsSphere['baseStrucFile'])
else:
baseStruc = None

Expand All @@ -45,4 +45,4 @@ def testRandomPlace():

outStrucSphere, strucTypeSphere = drawMolSphere(struc, baseStruc, iparamsSphere)
assert len(outStrucSphere) != 0, "Output structure should have some length"
assert strucTypeSphere == "atom", "Structure type should be an atom"
assert strucTypeSphere == "atom", "Structure type should be an atom"
6 changes: 3 additions & 3 deletions tests/test_moleculeFill.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ def testMoleculeFill():
if name not in iparamsCube:
iparamsCube[name] = dparams[name]

struc, unitCell = readStrucFile(iparamsSphere['structureFile'])
struc, unitCell, connectivity = readStrucFile(iparamsSphere['structureFile'])

if iparamsSphere['baseStrucFile']:
baseStruc = readStrucFile(iparamsSphere['baseStrucFile'])
baseStruc, _, _ = readStrucFile(iparamsSphere['baseStrucFile'])
else:
baseStruc = None

Expand All @@ -43,4 +43,4 @@ def testMoleculeFill():

outStrucSphere, strucTypeSphere = drawMolSphere(struc, baseStruc, iparamsSphere)
assert len(outStrucSphere) != 0, "Output structure should have some length"
assert strucTypeSphere == "molecule", "Structure type should be an atom"
assert strucTypeSphere == "molecule", "Structure type should be an atom"
8 changes: 5 additions & 3 deletions tests/test_moleculeRandomPlace.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ def testMoleculeRandomPlace():
if name not in iparamsCube:
iparamsCube[name] = dparams[name]

struc, unitCell = readStrucFile(iparamsSphere['structureFile'])
struc, unitCell, connectivity = readStrucFile(iparamsSphere['structureFile'])

if iparamsSphere['baseStrucFile']:
baseStruc, baseUnitCell = readStrucFile(iparamsSphere['baseStrucFile'])
baseStruc, baseUnitCell, baseConnectivity = readStrucFile(
iparamsSphere['baseStrucFile']
)
else:
baseStruc = None

Expand All @@ -45,4 +47,4 @@ def testMoleculeRandomPlace():

outStrucSphere, strucTypeSphere = drawMolSphere(struc, baseStruc, iparamsSphere)
assert len(outStrucSphere) != 0, "Output structure should have some length"
assert strucTypeSphere == "molecule", "Structure type should be an atom"
assert strucTypeSphere == "molecule", "Structure type should be an atom"
6 changes: 3 additions & 3 deletions tests/test_randOrient.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ def testRandOrient():
if name not in iparamsCube:
iparamsCube[name] = dparams[name]

struc, unitCell = readStrucFile(iparamsSphere['structureFile'])
struc, unitCell, connectivity = readStrucFile(iparamsSphere['structureFile'])

if iparamsSphere['baseStrucFile']:
baseStruc = readStrucFile(iparamsSphere['baseStrucFile'])
baseStruc, _, _ = readStrucFile(iparamsSphere['baseStrucFile'])
else:
baseStruc = None

Expand All @@ -45,4 +45,4 @@ def testRandOrient():

outStrucSphere, strucTypeSphere = drawMolSphere(struc, baseStruc, iparamsSphere)
assert len(outStrucSphere) != 0, "Output structure should have some length"
assert strucTypeSphere == "molecule", "Structure type should be an atom"
assert strucTypeSphere == "molecule", "Structure type should be an atom"
6 changes: 3 additions & 3 deletions tests/test_readWritePDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ def testReadWritePDB():
if name not in iparamsCube:
iparamsCube[name] = dparams[name]

struc, unitCell = readStrucFile(iparamsSphere['structureFile'])
struc, unitCell, connectivity = readStrucFile(iparamsSphere['structureFile'])

if iparamsSphere['baseStrucFile']:
baseStruc = readStrucFile(iparamsSphere['baseStrucFile'])
baseStruc, _, _ = readStrucFile(iparamsSphere['baseStrucFile'])
else:
baseStruc = None

Expand All @@ -45,4 +45,4 @@ def testReadWritePDB():
outStrucSphere, strucTypeSphere = drawMolSphere(struc, baseStruc, iparamsSphere)
assert len(outStrucSphere) != 0, "Output structure should have some length"
assert strucTypeSphere == "molecule", "Structure type should be an atom"
assert isinstance(outStrucSphere[0][0][-1], str), 'Final place should be residue ID'
assert isinstance(outStrucSphere[0][0][-1], str), 'Final place should be residue ID'
Loading