Skip to content

Commit

Permalink
Use Parsl NoDataFlowKernelError for detecting existing Parsl configur…
Browse files Browse the repository at this point in the history
…ations (#112)

* update and forward lock for parsl 2023.09.25

* move to new exception type no dfk for config check

* remove NoDataFlowKernelError str message check

* update lockfile
  • Loading branch information
d33bs authored Oct 6, 2023
1 parent a5b5895 commit ab5bfee
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
13 changes: 4 additions & 9 deletions cytotable/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from cloudpathlib.exceptions import InvalidPrefixError
from parsl.app.app import AppBase
from parsl.config import Config
from parsl.errors import ConfigurationError
from parsl.errors import NoDataFlowKernelError
from parsl.executors import HighThroughputExecutor

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -108,15 +108,10 @@ def _parsl_loaded() -> bool:
try:
# try to reference Parsl dataflowkernel
parsl.dfk()
except ConfigurationError as pce:
# if we detect a Parsl ConfigurationError that states we need to load config
except NoDataFlowKernelError:
# if we detect a Parsl NoDataFlowKernelError
# return false to indicate parsl config has not yet been loaded.
if pce.args[0] == "Must first load config":
return False

# otherwise we raise other ConfigurationError's
else:
raise
return False

# otherwise we indicate parsl config has already been loaded
return True
Expand Down
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ python = ">=3.8,<3.13"
pyarrow = "^13.0.0"
cloudpathlib = {extras = ["all"], version = "^0.15.0"}
duckdb = ">=0.8.0"
parsl = ">=2023.9.18"
parsl = ">=2023.9.25"

[tool.poetry.dev-dependencies]
pytest = "^7.4.0"
Expand Down

0 comments on commit ab5bfee

Please sign in to comment.