Skip to content

Commit 43d83a1

Browse files
committed
build: add diffpy.structure back to requirement
1 parent e173eff commit 43d83a1

7 files changed

Lines changed: 37 additions & 37 deletions

File tree

news/fix-test-package.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* Added `diffpy.structure` back to the requirements and run the test
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* <news item>
20+
21+
**Security:**
22+
23+
* <news item>

requirements/conda.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ numpy
33
scipy
44
bg-mpl-stylesheets
55
diffpy.utils
6+
diffpy.structure

requirements/pip.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ numpy
33
scipy
44
bg-mpl-stylesheets
55
diffpy.utils
6+
diffpy.structure

src/diffpy/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@
1313
# See LICENSE.rst for license information.
1414
#
1515
##############################################################################
16+
from pkgutil import extend_path
17+
18+
__path__ = extend_path(__path__, __name__)

tests/conftest.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ def sas_available():
7373
return has_sas()
7474

7575

76-
@pytest.fixture(scope="session")
77-
def diffpy_structure_available():
78-
return has_diffpy_structure()
79-
80-
8176
@pytest.fixture(scope="session")
8277
def diffpy_srreal_available():
8378
return has_diffpy_srreal()

tests/test_diffpyparset.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,12 @@
1818
import unittest
1919

2020
import numpy as np
21-
import pytest
2221

2322
from diffpy.srfit.structure.diffpyparset import DiffpyStructureParSet
2423

2524

26-
def testDiffpyStructureParSet(diffpy_structure_available):
25+
def testDiffpyStructureParSet():
2726
"""Test the structure conversion."""
28-
if not diffpy_structure_available:
29-
pytest.skip("diffpy.structure package not available")
3027
from diffpy.structure import Atom, Lattice, Structure
3128

3229
a1 = Atom("Cu", xyz=np.array([0.0, 0.1, 0.2]), Uisoequiv=0.003)
@@ -103,10 +100,8 @@ def _testLattice():
103100
return
104101

105102

106-
def test___repr__(diffpy_structure_available):
103+
def test___repr__():
107104
"""Test representation of DiffpyStructureParSet objects."""
108-
if not diffpy_structure_available:
109-
pytest.skip("diffpy.structure package not available")
110105
from diffpy.structure import Atom, Lattice, Structure
111106

112107
lat = Lattice(3, 3, 2, 90, 90, 90)
@@ -119,10 +114,8 @@ def test___repr__(diffpy_structure_available):
119114
return
120115

121116

122-
def test_pickling(diffpy_structure_available):
117+
def test_pickling():
123118
"""Test pickling of DiffpyStructureParSet."""
124-
if not diffpy_structure_available:
125-
pytest.skip("diffpy.structure package not available")
126119
from diffpy.structure import Atom, Structure
127120

128121
stru = Structure([Atom("C", [0, 0.2, 0.5])])

tests/test_pdf.py

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,7 @@ def testParser2(datafile):
140140
return
141141

142142

143-
def testGenerator(
144-
diffpy_srreal_available, diffpy_structure_available, datafile
145-
):
146-
if not diffpy_structure_available:
147-
pytest.skip("diffpy.structure package not available")
143+
def testGenerator(diffpy_srreal_available, datafile):
148144
if not diffpy_srreal_available:
149145
pytest.skip("diffpy.srreal package not available")
150146

@@ -200,7 +196,7 @@ def testGenerator(
200196
return
201197

202198

203-
def test_setQmin(diffpy_structure_available, diffpy_srreal_available):
199+
def test_setQmin(diffpy_srreal_available):
204200
"""Verify qmin is propagated to the calculator object."""
205201
if not diffpy_srreal_available:
206202
pytest.skip("diffpy.srreal package not available")
@@ -214,10 +210,8 @@ def test_setQmin(diffpy_structure_available, diffpy_srreal_available):
214210
return
215211

216212

217-
def test_setQmax(diffpy_structure_available, diffpy_srreal_available):
213+
def test_setQmax(diffpy_srreal_available):
218214
"""Check PDFContribution.setQmax()"""
219-
if not diffpy_structure_available:
220-
pytest.skip("diffpy.structure package not available")
221215
from diffpy.structure import Structure
222216

223217
if not diffpy_srreal_available:
@@ -233,10 +227,8 @@ def test_setQmax(diffpy_structure_available, diffpy_srreal_available):
233227
return
234228

235229

236-
def test_getQmax(diffpy_structure_available, diffpy_srreal_available):
230+
def test_getQmax(diffpy_srreal_available):
237231
"""Check PDFContribution.getQmax()"""
238-
if not diffpy_structure_available:
239-
pytest.skip("diffpy.structure package not available")
240232
from diffpy.structure import Structure
241233

242234
if not diffpy_srreal_available:
@@ -260,12 +252,8 @@ def test_getQmax(diffpy_structure_available, diffpy_srreal_available):
260252
return
261253

262254

263-
def test_savetxt(
264-
diffpy_structure_available, diffpy_srreal_available, datafile
265-
):
255+
def test_savetxt(diffpy_srreal_available, datafile):
266256
"check PDFContribution.savetxt()"
267-
if not diffpy_structure_available:
268-
pytest.skip("diffpy.structure package not available")
269257
from diffpy.structure import Structure
270258

271259
if not diffpy_srreal_available:
@@ -286,12 +274,8 @@ def test_savetxt(
286274
return
287275

288276

289-
def test_pickling(
290-
diffpy_structure_available, diffpy_srreal_available, datafile
291-
):
277+
def test_pickling(diffpy_srreal_available, datafile):
292278
"validate PDFContribution.residual() after pickling."
293-
if not diffpy_structure_available:
294-
pytest.skip("diffpy.structure package not available")
295279
from diffpy.structure import loadStructure
296280

297281
if not diffpy_srreal_available:

0 commit comments

Comments
 (0)