Skip to content

Commit 703588b

Browse files
committed
skpkg: autofixes with linelength 79
1 parent d3ecb25 commit 703588b

27 files changed

+232
-62
lines changed

doc/source/examples/distanceprinter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ def _resetValue(self):
1616

1717
def _addPairContribution(self, bnds, sumscale):
1818
self.count += bnds.multiplicity() * sumscale / 2.0
19-
print("%i %g %i %i" % (self.count, bnds.distance(), bnds.site0(), bnds.site1()))
19+
print(
20+
"%i %g %i %i"
21+
% (self.count, bnds.distance(), bnds.site0(), bnds.site1())
22+
)
2023
return
2124

2225

doc/source/examples/parallelPDF.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525

2626
# configure options parsing
2727
parser = optparse.OptionParser("%prog [options]\n" + __doc__)
28-
parser.add_option("--pyobjcryst", action="store_true", help="Use pyobjcryst to load the CIF file.")
28+
parser.add_option(
29+
"--pyobjcryst",
30+
action="store_true",
31+
help="Use pyobjcryst to load the CIF file.",
32+
)
2933
parser.allow_interspersed_args = True
3034
opts, args = parser.parse_args(sys.argv[1:])
3135

setup.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ def get_boost_config():
3737
conda_prefix = os.environ.get("CONDA_PREFIX")
3838
if not conda_prefix:
3939
raise EnvironmentError(
40-
"Neither BOOST_PATH nor CONDA_PREFIX are set. " "Please install Boost or set BOOST_PATH."
40+
"Neither BOOST_PATH nor CONDA_PREFIX are set. "
41+
"Please install Boost or set BOOST_PATH."
4142
)
4243
if os.name == "nt":
4344
inc = Path(conda_prefix) / "Library" / "include"
@@ -99,7 +100,11 @@ def get_objcryst_libraries():
99100

100101
def create_extensions():
101102
"Initialize Extension objects for the setup function."
102-
ext = Extension("diffpy.srreal.srreal_ext", glob.glob("src/extensions/*.cpp"), **ext_kws)
103+
ext = Extension(
104+
"diffpy.srreal.srreal_ext",
105+
glob.glob("src/extensions/*.cpp"),
106+
**ext_kws,
107+
)
103108
return [ext]
104109

105110

src/diffpy/srreal/devutils/tunePeakPrecision.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ def comparePDFCalculators(qmax, peakprecision=None):
108108
rv = {}
109109
rv["qmax"] = qmax
110110
rv["peakprecision"] = (
111-
peakprecision is None and PDFCalculator()._getDoubleAttr("peakprecision") or peakprecision
111+
peakprecision is None
112+
and PDFCalculator()._getDoubleAttr("peakprecision")
113+
or peakprecision
112114
)
113115
ttic = time.clock()
114116
rg0 = Gpdffit2(qmax)
@@ -175,7 +177,10 @@ def main():
175177
processCommandLineArguments()
176178
cmpdata = comparePDFCalculators(qmax, peakprecision)
177179
print(
178-
("qmax = %(qmax)g pkprec = %(peakprecision)g " + "grmsd = %(grmsd)g t0 = %(t0).3f t1 = %(t1).3f")
180+
(
181+
"qmax = %(qmax)g pkprec = %(peakprecision)g "
182+
+ "grmsd = %(grmsd)g t0 = %(t0).3f t1 = %(t1).3f"
183+
)
179184
% cmpdata
180185
)
181186
if createplot:

src/diffpy/srreal/parallel.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ def proxymethod(self, *args, **kwargs):
163163
return proxymethod
164164

165165
for n, f in inspect.getmembers(pqtype, inspect.isroutine):
166-
ignore = n not in proxy_forced and (n.startswith("_") or hasattr(ParallelPairQuantity, n))
166+
ignore = n not in proxy_forced and (
167+
n.startswith("_") or hasattr(ParallelPairQuantity, n)
168+
)
167169
if ignore:
168170
continue
169171
setattr(ParallelPairQuantity, n, _make_proxymethod(n, f))

src/diffpy/srreal/pdfbaseline.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ def fshiftedline(x, aline, bline):
8585
"""
8686
from diffpy.srreal.wraputils import _wrapAsRegisteredUnaryFunction
8787

88-
rv = _wrapAsRegisteredUnaryFunction(PDFBaseline, name, fnc, replace=replace, **dbattrs)
88+
rv = _wrapAsRegisteredUnaryFunction(
89+
PDFBaseline, name, fnc, replace=replace, **dbattrs
90+
)
8991
return rv
9092

9193

src/diffpy/srreal/pdfenvelope.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ def fexpdecay(x, expscale, exptail):
115115
"""
116116
from diffpy.srreal.wraputils import _wrapAsRegisteredUnaryFunction
117117

118-
rv = _wrapAsRegisteredUnaryFunction(PDFEnvelope, name, fnc, replace=replace, **dbattrs)
118+
rv = _wrapAsRegisteredUnaryFunction(
119+
PDFEnvelope, name, fnc, replace=replace, **dbattrs
120+
)
119121
return rv
120122

121123

src/diffpy/srreal/peakwidthmodel.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@
2020

2121

2222
# exported items
23-
__all__ = ["PeakWidthModel", "ConstantPeakWidth", "DebyeWallerPeakWidth", "JeongPeakWidth"]
23+
__all__ = [
24+
"PeakWidthModel",
25+
"ConstantPeakWidth",
26+
"DebyeWallerPeakWidth",
27+
"JeongPeakWidth",
28+
]
2429

2530
from diffpy.srreal import _final_imports
2631
from diffpy.srreal.srreal_ext import (

src/diffpy/srreal/scatteringfactortable.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@
1717

1818

1919
# exported items, these also makes them show in pydoc.
20-
__all__ = ["ScatteringFactorTable", "SFTXray", "SFTElectron", "SFTNeutron", "SFTElectronNumber", "SFAverage"]
20+
__all__ = [
21+
"ScatteringFactorTable",
22+
"SFTXray",
23+
"SFTElectron",
24+
"SFTNeutron",
25+
"SFTElectronNumber",
26+
"SFAverage",
27+
]
2128

2229
from diffpy.srreal.sfaverage import SFAverage
2330
from diffpy.srreal.srreal_ext import (

src/diffpy/srreal/sfaverage.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,11 @@ def fromComposition(cls, composition, sftb, q=0):
150150
sfa.f1sum = 0.0 * q
151151
sfa.f2sum = 0.0 * q
152152
# resolve the lookup table object `tb`
153-
tb = sftb if not isinstance(sftb, str) else ScatteringFactorTable.createByType(sftb)
153+
tb = (
154+
sftb
155+
if not isinstance(sftb, str)
156+
else ScatteringFactorTable.createByType(sftb)
157+
)
154158
for smbl, cnt in sfa.composition.items():
155159
sfq = tb.lookup(smbl, q)
156160
sfa.f1sum += cnt * sfq

0 commit comments

Comments
 (0)