Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
name: Task
about: A Task to be Completed
labels: task
---
13 changes: 0 additions & 13 deletions .github/ISSUE_TEMPLATE/task.yml

This file was deleted.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,13 @@ legacy_tox_ini = """
jupyter nbconvert {toxinidir}/notebooks/*.ipynb --to markdown --output-dir={toxinidir}/docs/notebooks
cp {toxinidir}/notebooks/README.md {toxinidir}/docs/notebooks/README.md
python {toxinidir}/docs/notebooks/update_notebook_links.py {toxinidir}/docs/notebooks
npx prettier@3.1.0 --write --quote-props=as-needed {toxinidir}/docs/notebooks/*.md
mkdocs build
extras =
docs
allowlist_externals =
cp
npx

[tox]
env_list =
Expand Down
6 changes: 2 additions & 4 deletions src/patientflow/predict/emergency_demand.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,13 @@ def warn_specialty_mismatch(
if new_in_request:
warnings.warn(
f"{len(new_in_request)} specialties found in the request but absent "
f"from the trained {source_label} (models may need retraining): "
f"{sorted(new_in_request)}",
f"from the trained {source_label} (models may need retraining).",
stacklevel=stacklevel,
)
if missing_from_request:
warnings.warn(
f"{len(missing_from_request)} specialties present in the trained "
f"{source_label} but absent from the request: "
f"{sorted(missing_from_request)}",
f"{source_label} but absent from the request.",
stacklevel=stacklevel,
)

Expand Down
15 changes: 4 additions & 11 deletions src/patientflow/predict/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,9 @@ def compute_transfer_arrivals(
f"got {type(source_data)}"
)

# Get transfer probabilities from model
# Get transfer probabilities from model.
# get_transfer_prob returns 0.0 (with a warning) for unknown
# services, so we only need to handle cohort-not-found here.
try:
prob_transfer = transfer_model.get_transfer_prob(
source_service, admission_type
Expand All @@ -1366,18 +1368,9 @@ def compute_transfer_arrivals(
source_service, admission_type
)
except ValueError as e:
# Handle case where cohort doesn't exist in transfer model
if "not found in trained model" in str(e):
# Skip this admission type if not trained for it
continue
else:
raise ValueError(
f"Error getting transfer probabilities for '{source_service}' and admission type '{admission_type}': {e}"
)
except KeyError as e:
raise ValueError(
f"Error getting transfer probabilities for '{source_service}' and admission type '{admission_type}': {e}"
)
raise

# Skip if no transfers from this source
if prob_transfer == 0:
Expand Down
Loading
Loading