Skip to content

Commit 7abbfa1

Browse files
committed
MAINT: clean up issues reported by pyflakes.
1 parent 3c8f54d commit 7abbfa1

22 files changed

+63
-20
lines changed

Diff for: src/pyobjcryst/__init__.py

+6
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,9 @@ def loadCrystal(filename):
8787
with open(filename) as fp:
8888
rv = CreateCrystalFromCIF(fp)
8989
return rv
90+
91+
92+
# silence the pyflakes syntax checker
93+
assert ObjCrystException is not None
94+
assert __version__ or True
95+
assert pyobjcryst.zscatterer

Diff for: src/pyobjcryst/atom.py

+2
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@
2323
will cause segmentation faults, even if it is printed.
2424
"""
2525

26+
__all__ = ["Atom"]
27+
2628
from pyobjcryst._pyobjcryst import Atom

Diff for: src/pyobjcryst/crystal.py

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
method accepts a python file rather than a CIF object.
3030
"""
3131

32+
__all__ = ["Crystal", "BumpMergePar", "CreateCrystalFromCIF"]
33+
3234
from pyobjcryst._pyobjcryst import Crystal
3335
from pyobjcryst._pyobjcryst import BumpMergePar
3436
from pyobjcryst._pyobjcryst import CreateCrystalFromCIF

Diff for: src/pyobjcryst/diffractiondatasinglecrystal.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
2020
Changes from ObjCryst::DiffractionDataSingleCrystal::
2121
In development !
22-
2322
"""
2423

24+
__all__ = ["DiffractionDataSingleCrystal"]
25+
2526
from pyobjcryst._pyobjcryst import DiffractionDataSingleCrystal

Diff for: src/pyobjcryst/general.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
"""Python wrapping of things from General.h.
1717
1818
See the online ObjCryst++ documentation (http://vincefn.net/ObjCryst/).
19-
2019
"""
2120

21+
__all__ = ["RadiationType", "ObjCrystException"]
22+
2223
from pyobjcryst._pyobjcryst import RadiationType
2324
from pyobjcryst._pyobjcryst import ObjCrystException

Diff for: src/pyobjcryst/io.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
2020
Changes from ObjCryst::XMLCrystTag
2121
- The istream constructor of XMLCrystTag is not wrapped.
22-
2322
"""
2423

24+
__all__ = ["XMLCrystTag"]
25+
2526
from pyobjcryst._pyobjcryst import XMLCrystTag

Diff for: src/pyobjcryst/molecule.py

+6
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@
8282
methods.
8383
"""
8484

85+
__all__ = ["Molecule", "GetBondLength", "GetBondAngle",
86+
"GetDihedralAngle", "MolAtom", "MolBond",
87+
"MolBondAngle", "MolDihedralAngle", "Quaternion",
88+
"RigidGroup", "StretchMode", "StretchModeBondLength",
89+
"StretchModeBondAngle", "StretchModeTorsion", "StretchModeTwist"]
90+
8591
# TODO - MolRing
8692

8793
from pyobjcryst._pyobjcryst import Molecule

Diff for: src/pyobjcryst/polyhedron.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616
"""Python wrapping of Polyhedron.h
1717
1818
See the online ObjCryst++ documentation (http://vincefn.net/ObjCryst/).
19-
2019
"""
2120

21+
__all__ = ["MakeTetrahedron", "MakeOctahedron", "MakeSquarePlane",
22+
"MakeCube", "MakeAntiPrismTetragonal", "MakePrismTrigonal",
23+
"MakeIcosahedron", "MakeTriangle"]
24+
2225
from pyobjcryst._pyobjcryst import MakeTetrahedron
2326
from pyobjcryst._pyobjcryst import MakeOctahedron
2427
from pyobjcryst._pyobjcryst import MakeSquarePlane

Diff for: src/pyobjcryst/powderpattern.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616
1717
Changes from ObjCryst::PowderPattern::
1818
In development !
19-
2019
"""
2120

21+
__all__ = ["PowderPattern", "CreatePowderPatternFromCIF",
22+
"PowderPatternBackground", "PowderPatternComponent",
23+
"PowderPatternDiffraction", "ReflectionProfileType"]
24+
2225
from pyobjcryst._pyobjcryst import PowderPattern
2326
from pyobjcryst._pyobjcryst import CreatePowderPatternFromCIF
2427
from pyobjcryst._pyobjcryst import PowderPatternBackground

Diff for: src/pyobjcryst/refinableobj.py

+5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@
6464
- XML input/output are not exposed.
6565
"""
6666

67+
__all__ = ["RefinableObjClock", "RefinableObj", "RefObjOpt",
68+
"RefinableObjRegistry", "RefParType", "RefParDerivStepModel",
69+
"RefinablePar", "Restraint", "ScattererRegistry",
70+
"ScatteringPowerRegistry", "ZAtomRegistry"]
71+
6772
from pyobjcryst._pyobjcryst import RefinableObjClock
6873
from pyobjcryst._pyobjcryst import RefinableObj
6974
from pyobjcryst._pyobjcryst import RefObjOpt

Diff for: src/pyobjcryst/reflectionprofile.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
1717
Changes from ObjCryst::ReflectionProfile::
1818
In development !
19-
2019
"""
2120

21+
__all__ = ["ReflectionProfile"]
22+
2223
from pyobjcryst._pyobjcryst import ReflectionProfile

Diff for: src/pyobjcryst/scatterer.py

+2
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,6 @@
2929
- Methods related to visualization are not exposed.
3030
"""
3131

32+
__all__ = ["Scatterer"]
33+
3234
from pyobjcryst._pyobjcryst import Scatterer

Diff for: src/pyobjcryst/scatteringdata.py

+2
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@
1818
See the online ObjCryst++ documentation (http://vincefn.net/ObjCryst/).
1919
"""
2020

21+
__all__ = ["ScatteringData"]
22+
2123
from pyobjcryst._pyobjcryst import ScatteringData

Diff for: src/pyobjcryst/scatteringpower.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@
2222
2323
Changes from ObjCryst::ScatteringComponentList
2424
- Wrapped as a to-python converter only (no constructor)
25-
2625
"""
2726

27+
__all__ = ["ScatteringPower", "ScatteringComponent",
28+
"ScatteringPowerAtom", "ScatteringComponentList"]
29+
2830
from pyobjcryst._pyobjcryst import ScatteringPower
2931
from pyobjcryst._pyobjcryst import ScatteringComponent
3032
from pyobjcryst._pyobjcryst import ScatteringPowerAtom

Diff for: src/pyobjcryst/scatteringpowersphere.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"""Python wrapping of ScatteringPowerSphere.h
1717
1818
See the online ObjCryst++ documentation (http://vincefn.net/ObjCryst/).
19-
2019
"""
2120

21+
__all__ = ["ScatteringPowerSphere"]
22+
2223
from pyobjcryst._pyobjcryst import ScatteringPowerSphere

Diff for: src/pyobjcryst/spacegroup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
"""Python wrapping of SpaceGroup.h.
1717
1818
See the online ObjCryst++ documentation (http://vincefn.net/ObjCryst/).
19-
2019
"""
2120

21+
__all__ = ["SpaceGroup", "AsymmetricUnit"]
22+
2223
from pyobjcryst._pyobjcryst import SpaceGroup
2324
from pyobjcryst._pyobjcryst import AsymmetricUnit

Diff for: src/pyobjcryst/tests/pyobjcrysttest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def testCrystalScope():
6666
def testMultiAdd():
6767
"""Test exception for multi-crystal additions."""
6868
sp, atom = makeScatterer()
69-
c = makeCrystal(sp, atom)
69+
makeCrystal(sp, atom)
7070

7171
# Force this exception
7272
try:

Diff for: src/pyobjcryst/tests/testcrystal.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
import unittest
1919

20-
from pyobjcryst.tests.pyobjcrysttestutils import *
21-
20+
from pyobjcryst.tests.pyobjcrysttestutils import (
21+
makeScatterer, makeCrystal, getScatterer, makeScattererAnisotropic)
2222
from pyobjcryst.atom import Atom
2323

2424

@@ -37,7 +37,6 @@ def testCrystalScope(self):
3737

3838
def testScattererScope(self):
3939
"""Test when atoms go out of scope before crystal."""
40-
c = makeCrystal(*makeScatterer())
4140
sp2 = getScatterer()
4241
self.assertEqual("Ni", sp2.GetName())
4342
return

Diff for: src/pyobjcryst/tests/testmolecule.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@
1717

1818
import unittest
1919

20-
from pyobjcryst.molecule import *
2120
from pyobjcryst import ObjCrystException
21+
from pyobjcryst.molecule import (
22+
GetBondLength, StretchModeBondLength,
23+
GetBondAngle, StretchModeBondAngle,
24+
GetDihedralAngle, StretchModeTorsion)
2225
from pyobjcryst.refinableobj import RefParType, RefinablePar
26+
from pyobjcryst.tests.pyobjcrysttestutils import makeC60, makeMnO6
2327

24-
from pyobjcryst.tests.pyobjcrysttestutils import *
2528
from numpy import pi
2629

2730
numplaces = 6
@@ -81,7 +84,6 @@ def testAtoms(self):
8184
8285
This tests AddAtom by association.
8386
This tests GetAtom.
84-
8587
"""
8688
self.assertEqual(60, self.m.GetNbAtoms())
8789
for i in range(60):
@@ -90,7 +92,6 @@ def testAtoms(self):
9092

9193
a = self.m.GetAtom(0)
9294
x = a.X
93-
sp = a.GetScatteringPower()
9495

9596
self.assertEqual(60, self.m.GetNbAtoms())
9697

Diff for: src/pyobjcryst/tests/testrefinableobj.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515

1616
"""Tests for refinableobj module."""
1717

18-
from pyobjcryst.refinableobj import *
18+
from pyobjcryst.refinableobj import RefinableObjClock, RefParType, Restraint
19+
from pyobjcryst.refinableobj import RefinablePar, RefinableObj
1920
from pyobjcryst import ObjCrystException
2021

2122
import unittest

Diff for: src/pyobjcryst/unitcell.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"""Python wrapping of UnitCell.h
1717
1818
See the online ObjCryst++ documentation (http://vincefn.net/ObjCryst/).
19-
2019
"""
2120

21+
__all__ = ["UnitCell"]
22+
2223
from pyobjcryst._pyobjcryst import UnitCell

Diff for: src/pyobjcryst/zscatterer.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@
2222
2323
Changes from ObjCryst++
2424
- XMLOutput and Input are not wrapped.
25-
2625
"""
2726

27+
__all__ = ["ZScatterer", "ZAtom", "ZPolyhedron",
28+
"RegularPolyhedraType", "GlobalScatteringPower"]
29+
2830
from pyobjcryst._pyobjcryst import ZScatterer
2931
from pyobjcryst._pyobjcryst import ZAtom
3032
from pyobjcryst._pyobjcryst import ZPolyhedron

0 commit comments

Comments
 (0)