Skip to content

Commit f80927d

Browse files
committed
Merge branch 'rjkoch-fix_list_handling'
* adjust for fixup in diffpy.structure * wrapped dictionary .keys() call in list * wrapped dictionary .values() call in list Resolve #60.
2 parents 4edfa96 + 564c9e3 commit f80927d

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

src/diffpy/srfit/fitbase/fitrecipe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def addContribution(self, con, weight = 1.0):
179179

180180
def setWeight(self, con, weight):
181181
"""Set the weight of a FitContribution."""
182-
idx = self._contributions.values().index(con)
182+
idx = list(self._contributions.values()).index(con)
183183
self._weights[idx] = weight
184184
return
185185

src/diffpy/srfit/fitbase/fitresults.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def formatResults(self, header = "", footer = "", update = False):
349349

350350
## Per-FitContribution results
351351
if len(self.conresults) > 1:
352-
keys = self.conresults.keys()
352+
keys = list(self.conresults.keys())
353353
keys.sort(key=numstr)
354354

355355
lines.append("")

src/diffpy/srfit/tests/testpdf.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,6 @@ def test_pickling(self):
270270
self.assertTrue(numpy.array_equal(res1, pc2.residual()))
271271
return
272272

273-
# TODO: remove after fixup release of diffpy.structure
274-
import sys
275-
if sys.version_info >= (3, 7):
276-
test_pickling = unittest.expectedFailure(test_pickling)
277-
278273
# End of class TestPDFContribution
279274

280275
# ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)