Skip to content

Commit c4a655d

Browse files
Grab CI patch
2 parents cefb0a8 + c5a9dc7 commit c4a655d

File tree

5 files changed

+34
-13
lines changed

5 files changed

+34
-13
lines changed

.github/workflows/workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,6 @@ jobs:
101101
run: |
102102
ASPIREDIR=${{ env.WORK_DIR }} python -c \
103103
"import aspire; print(aspire.config['ray']['temp_dir'])"
104-
ASPIREDIR=${{ env.WORK_DIR }} pytest
104+
ASPIREDIR=${{ env.WORK_DIR }} pytest --durations=50
105105
- name: Cleanup
106106
run: rm -rf ${{ env.WORK_DIR }}

azure-pipelines.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ jobs:
2727
- bash: |
2828
source activate myEnvironment
2929
pip install -e .[dev]
30-
pytest --random-order
30+
pip freeze --all
31+
pytest --durations=50 --random-order
3132
displayName: pytest
3233
3334
- job:
@@ -52,7 +53,8 @@ jobs:
5253
- bash: |
5354
source activate myEnvironment
5455
pip install -e .[dev]
55-
pytest --random-order
56+
pip freeze --all
57+
pytest --durations=50 --random-order
5658
displayName: pytest
5759
5860
- job:
@@ -82,7 +84,8 @@ jobs:
8284
- bash: |
8385
source activate myEnvironment
8486
pip install -e .[dev]
85-
pytest -s
87+
pip freeze --all
88+
pytest --durations=50 -s
8689
displayName: pytest
8790
8891
- job:
@@ -112,7 +115,8 @@ jobs:
112115
- bash: |
113116
source activate myEnvironment
114117
pip install -e .[dev]
115-
pytest -s
118+
pip freeze --all
119+
pytest --durations=50 -s
116120
displayName: pytest
117121
118122
- job:
@@ -137,5 +141,6 @@ jobs:
137141
- script: |
138142
call activate myEnvironment
139143
pip install -e .[dev]
140-
pytest --random-order
144+
pip freeze --all
145+
pytest --durations=50 --random-order
141146
displayName: pytest

src/aspire/classification/averager2d.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,11 @@ def _innerloop(i):
215215
b_avgs[i] = _innerloop(i)
216216
else:
217217
logger.info(f"Starting Pool({self.num_procs})")
218-
ray.init(_temp_dir=config["ray"]["temp_dir"].as_filename())
218+
ray.init(
219+
_temp_dir=config["ray"]["temp_dir"].as_filename(),
220+
num_cpus=self.num_procs,
221+
num_gpus=0,
222+
)
219223
with Pool(self.num_procs) as p:
220224
results = p.map(_innerloop, range(n_classes))
221225
ray.shutdown()
@@ -563,7 +567,11 @@ def _innerloop(k):
563567

564568
else:
565569
logger.info(f"Starting Pool({self.num_procs})")
566-
ray.init(_temp_dir=config["ray"]["temp_dir"].as_filename())
570+
ray.init(
571+
_temp_dir=config["ray"]["temp_dir"].as_filename(),
572+
num_cpus=self.num_procs,
573+
num_gpus=0,
574+
)
567575
with Pool(self.num_procs) as p:
568576
results = p.map(_innerloop, range(n_classes))
569577
ray.shutdown()
@@ -623,7 +631,11 @@ def _innerloop(i):
623631
b_avgs[i] = _innerloop(i)
624632
else:
625633
logger.info(f"Starting Pool({self.num_procs})")
626-
ray.init(_temp_dir=config["ray"]["temp_dir"].as_filename())
634+
ray.init(
635+
_temp_dir=config["ray"]["temp_dir"].as_filename(),
636+
num_cpus=self.num_procs,
637+
num_gpus=0,
638+
)
627639
with Pool(self.num_procs) as p:
628640
results = p.map(_innerloop, range(n_classes))
629641
ray.shutdown()
@@ -750,7 +762,11 @@ def _innerloop(k):
750762
rotations[k], shifts[k], correlations[k] = _innerloop(k)
751763
else:
752764
logger.info(f"Starting Pool({self.num_procs})")
753-
ray.init(_temp_dir=config["ray"]["temp_dir"].as_filename())
765+
ray.init(
766+
_temp_dir=config["ray"]["temp_dir"].as_filename(),
767+
num_cpus=self.num_procs,
768+
num_gpus=0,
769+
)
754770
with Pool(self.num_procs) as p:
755771
results = p.map(_innerloop, range(n_classes))
756772
ray.shutdown()

tests/test_averager2d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def testAverager(self):
300300
class ReddyChatterjiAverager2DTestCase(BFSRAverager2DTestCase):
301301

302302
averager = ReddyChatterjiAverager2D
303-
num_procs = 1 if xfail_ray_dev() else None
303+
num_procs = 1 if xfail_ray_dev() else 3
304304

305305
def testAverager(self):
306306
"""

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ deps =
1717
commands =
1818
python -V
1919
py{3.7,3.8,3.9,3.10}-dev: sh -c "pip freeze | cut -d@ -f1 | cut -d= -f1 | xargs -n1 pip install -U"
20-
pip freeze
20+
pip freeze --all
2121
python -c "import numpy; numpy.show_config()"
2222
# --cov should generate `Coverage` data
23-
pytest --cov=aspire --cov-report=xml {posargs}
23+
pytest --durations=50 --cov=aspire --cov-report=xml {posargs}
2424

2525
[testenv:docs]
2626
changedir = docs

0 commit comments

Comments
 (0)