Skip to content

Commit

Permalink
Merge pull request #101 from LSSTDESC/dask-fixes
Browse files Browse the repository at this point in the history
Fixes for more recent dask versions
  • Loading branch information
joezuntz authored Nov 1, 2023
2 parents f1696d9 + 009ba8d commit 25def53
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, "3.10"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]

steps:
- name: Checkout repository
Expand Down
10 changes: 5 additions & 5 deletions ceci/stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,8 @@ def describe_configuration(cls):
@classmethod
def _describe_configuration_text(cls):
s = []
if cls.config_options is None:
return "<This class has no configuration options>"
for name, val in cls.config_options.items():
if isinstance(val, StageParameter):
if val.required:
Expand Down Expand Up @@ -831,14 +833,12 @@ def start_dask(self):

return is_client

@staticmethod
def stop_dask():
def stop_dask(self):
"""
End the dask event loop
"""
from dask_mpi import send_close_signal

send_close_signal()
self.dask_client.retire_workers()
self.dask_client.shutdown()

def split_tasks_by_rank(self, tasks):
"""Iterate through a list of items, yielding ones this process is responsible for/
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ viz = [
]

dask = [
"dask",
"dask_mpi @ git+https://github.com/joezuntz/dask-mpi",
"dask[distributed] >= 2023.5.0",
"dask_mpi >= 2022.4.0",
]

test = [
Expand All @@ -90,6 +90,6 @@ all = [
"pytest-mock",
"mockmpi",
"h5py",
"dask[distributed]",
"dask_mpi @ git+https://github.com/joezuntz/dask-mpi",
"dask[distributed] >= 2023.5.0",
"dask_mpi >= 2022.4.0",
]
2 changes: 1 addition & 1 deletion tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_flow_chart_dot():
def test_run_parsl():
run1("launcher.name=parsl", "launcher.max_threads=3")


@pytest.mark.skip(reason="CWL currently broken")
def test_run_cwl():
run1("launcher.name=cwl", "launcher.dir=tests/cwl") == 0

Expand Down
6 changes: 6 additions & 0 deletions tests/test_stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ def run(self):
assert stage_1_cmd.config.a == 6.
assert stage_1_cmd.config.b == 'puffins are not extinct?'

class AbstractStage(PipelineStage):
name="AbstractStage"
config_options = None

AbstractStage.describe_configuration()


# This one should not work
class TestStage_2(PipelineStage):
Expand Down

0 comments on commit 25def53

Please sign in to comment.