Skip to content

fix: locate MEDS_transform-pipeline next to sys.executable (closes #51)#52

Open
mmcdermott wants to merge 1 commit into
devfrom
fix/path-lookup-meds-transform-pipeline
Open

fix: locate MEDS_transform-pipeline next to sys.executable (closes #51)#52
mmcdermott wants to merge 1 commit into
devfrom
fix/path-lookup-meds-transform-pipeline

Conversation

@mmcdermott

Copy link
Copy Markdown
Collaborator

Summary

Fix for #51MIMIC_IV_MEDS/__main__.py shells out to the MEDS_transform-pipeline console script via subprocess.run(["MEDS_transform-pipeline", ...]). The subprocess inherits the parent's PATH. When the user runs the bundled MEDS_extract-MIMIC_IV script directly via its venv path without first activating the venv, the venv's bin/ is not on PATH, and the subprocess raises FileNotFoundError even though the script is installed in the same environment as the python interpreter calling it.

I just hit this in a real run — download stage finally succeeded after retries, pre_MEDS ran cleanly, then MEDS extraction died at the seam because subprocess couldn't find its own subprocess executable.

Fix

Introduce resolve_console_script(name) in commands.py that looks next to sys.executable first (where pip / uv guarantee console scripts land), then falls back to a PATH lookup, then raises a useful FileNotFoundError naming both sites tried. Use it in __main__.py to resolve MEDS_transform-pipeline to an absolute path before invoking the subprocess.

candidate = Path(sys.executable).parent / name
if candidate.is_file():
    return str(candidate)
found = shutil.which(name)
if found:
    return found
raise FileNotFoundError(...)

5 LOC in __main__.py (one-line callsite change + import), ~25 LOC of helper + docstring in commands.py.

Test plan

  • tests/test_commands.py — new file, 5 tests:
    • test_resolve_console_script_prefers_sys_executable_dir — sibling wins over PATH (the load-bearing assertion)
    • test_resolve_console_script_falls_back_to_path — system-installed tools still work
    • test_resolve_console_script_raises_when_not_found — error message names both lookup sites
    • test_resolve_console_script_actually_finds_real_console_script — self-check using the MEDS_transform-pipeline from the test venv (catches a busted test environment AND a busted real environment)
    • test_resolve_console_script_skips_directories_named_like_scriptsis_file() guard against a directory shadowing the lookup
  • 2 new doctests in commands.py for happy + missing paths
  • All 29 tests + doctests pass; ruff / ruff-format / docformatter clean

Notes

  • This is not a regression — the same commands.py line exists in earlier versions; it's a long-standing PATH-coupling that only surfaces when the venv isn't activated. So no behavior change for users who already activate.
  • The fix is opt-out-friendly: shutil.which fallback means tools intentionally placed elsewhere on PATH still work.
  • Pinning the resolved absolute path also makes failure messages clearer (the path that was tried appears in any subsequent FileNotFoundError from subprocess).

🤖 Generated with Claude Code

…via PATH

MIMIC_IV_MEDS/__main__.py shells out to the `MEDS_transform-pipeline` console
script via `subprocess.run(["MEDS_transform-pipeline", ...])` (commands.py:39).
The subprocess inherits the parent's PATH — but when the user runs the bundled
`MEDS_extract-MIMIC_IV` script directly via its venv path WITHOUT first
activating the venv, the venv's bin/ isn't on PATH, and the subprocess raises
FileNotFoundError even though the script is installed in the same environment
as the python interpreter that's calling it.

Hit this in production after the download stage finally finished — pre_MEDS
ran cleanly, then the MEDS extraction step died on the seam between the two
because it couldn't find its own subprocess executable.

Fix: introduce `resolve_console_script(name)` in commands.py that looks next
to `sys.executable` first (where pip/uv guarantee console scripts land) and
only falls back to a PATH lookup. Use it in __main__.py for the
MEDS_transform-pipeline call.

Tests:
- test_resolve_console_script_prefers_sys_executable_dir — sibling wins over PATH
- test_resolve_console_script_falls_back_to_path — apt-installed tools still work
- test_resolve_console_script_raises_when_not_found — error names both lookup sites
- test_resolve_console_script_actually_finds_real_console_script — self-check
  using MEDS_transform-pipeline from the test venv
- test_resolve_console_script_skips_directories_named_like_scripts — `is_file()`
  guard against a directory shadowing the lookup
- 2 doctests in commands.py covering happy + missing paths

29 tests + 3 doctests pass; ruff/format/docformatter clean.

Closes #51.
@codecov

codecov Bot commented Apr 25, 2026

Copy link
Copy Markdown

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
35 2 33 0
View the top 2 failed test(s) by shortest run time
tests.e2e_demo_test::test_e2e_copy
Stack Traces | 168s run time
def test_e2e_copy():
        with TemporaryDirectory() as temp_dir:
>           run_extract_and_validate(Path(temp_dir), do_copy=True)

tests/e2e_demo_test.py:64: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

root = PosixPath('/tmp/tmppkbwdr9k'), do_copy = True

    def run_extract_and_validate(root: Path, do_copy: bool):
        do_overwrite = True
        do_demo = True
        do_download = True
    
        command_parts = [
            "MEDS_extract-MIMIC_IV",
            f"root_output_dir={root.resolve()!s}",
            f"do_download={do_download}",
            f"do_overwrite={do_overwrite}",
            f"do_copy={do_copy}",
            f"do_demo={do_demo}",
        ]
    
        full_cmd = " ".join(command_parts)
        command_out = subprocess.run(full_cmd, shell=True, capture_output=True)
    
        stdout = command_out.stdout.decode()
        stderr = command_out.stderr.decode()
    
        err_message = (
            f"Command failed with return code {command_out.returncode}.\n"
            f"Command stdout:\n{stdout}\n"
            f"Command stderr:\n{stderr}"
        )
>       assert command_out.returncode == 0, err_message
E       AssertionError: Command failed with return code 1.
E         Command stdout:
E         [2026-04-25 18:49:05,853][MIMIC_IV_MEDS.__main__][INFO] - Downloading demo data with 8 parallel workers.
E         [2026-04-25 18:49:07,620][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/admissions.csv.gz
E         [2026-04-25 18:49:08,133][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/diagnoses_icd.csv.gz
E         [2026-04-25 18:49:08,213][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/hcpcsevents.csv.gz
E         [2026-04-25 18:49:16,565][urllib3.connectionpool][WARNING] - Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f35f665b750>, 'Connection to physionet.org timed out. (connect timeout=10.0)')': ......................................./files/mimic-iv-demo/2.2/hosp/d_labitems.csv.gz
E         [2026-04-25 18:49:16,566][urllib3.connectionpool][WARNING] - Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f35f64d9950>, 'Connection to physionet.org timed out. (connect timeout=10.0)')': ......................................./files/mimic-iv-demo/2.2/hosp/drgcodes.csv.gz
E         [2026-04-25 18:49:30,582][urllib3.connectionpool][WARNING] - Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f35f64c7390>, 'Connection to physionet.org timed out. (connect timeout=10.0)')': ......................................./files/mimic-iv-demo/2.2/hosp/drgcodes.csv.gz
E         [2026-04-25 18:49:30,582][urllib3.connectionpool][WARNING] - Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f35f64c7790>, 'Connection to physionet.org timed out. (connect timeout=10.0)')': ......................................./files/mimic-iv-demo/2.2/hosp/d_labitems.csv.gz
E         [2026-04-25 18:49:34,865][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/d_hcpcs.csv.gz
E         [2026-04-25 18:49:39,430][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/microbiologyevents.csv.gz
E         [2026-04-25 18:49:40,423][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/omr.csv.gz
E         [2026-04-25 18:49:40,583][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/patients.csv.gz
E         [2026-04-25 18:49:45,690][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/emar_detail.csv.gz
E         [2026-04-25 18:49:46,198][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/emar.csv.gz
E         [2026-04-25 18:49:47,742][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/poe_detail.csv.gz
E         [2026-04-25 18:49:48,592][urllib3.connectionpool][WARNING] - Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f35f64c5e90>, 'Connection to physionet.org timed out. (connect timeout=10.0)')': ......................................./files/mimic-iv-demo/2.2/hosp/d_labitems.csv.gz
E         [2026-04-25 18:49:48,595][urllib3.connectionpool][WARNING] - Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f35f64c61d0>, 'Connection to physionet.org timed out. (connect timeout=10.0)')': ......................................./files/mimic-iv-demo/2.2/hosp/drgcodes.csv.gz
E         [2026-04-25 18:50:07,188][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/d_icd_procedures.csv.gz
E         [2026-04-25 18:50:07,587][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/procedures_icd.csv.gz
E         [2026-04-25 18:50:08,909][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/pharmacy.csv.gz
E         [2026-04-25 18:50:09,218][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/services.csv.gz
E         [2026-04-25 18:50:10,640][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/transfers.csv.gz
E         [2026-04-25 18:50:13,045][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/icu/caregiver.csv.gz
E         [2026-04-25 18:50:14,777][urllib3.connectionpool][WARNING] - Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f35f64bf7d0>, 'Connection to physionet.org timed out. (connect timeout=10.0)')': ......................................./files/mimic-iv-demo/2.2/hosp/d_labitems.csv.gz
E         [2026-04-25 18:50:14,777][urllib3.connectionpool][WARNING] - Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f35f64c4d90>, 'Connection to physionet.org timed out. (connect timeout=10.0)')': ......................................./files/mimic-iv-demo/2.2/hosp/drgcodes.csv.gz
E         [2026-04-25 18:50:16,144][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/provider.csv.gz
E         [2026-04-25 18:50:19,504][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/icu/d_items.csv.gz
E         [2026-04-25 18:50:20,324][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/poe.csv.gz
E         [2026-04-25 18:50:20,712][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/icu/icustays.csv.gz
E         [2026-04-25 18:50:21,790][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/prescriptions.csv.gz
E         [2026-04-25 18:50:26,411][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/icu/datetimeevents.csv.gz
E         [2026-04-25 18:50:31,854][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/icu/outputevents.csv.gz
E         [2026-04-25 18:50:34,418][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/icu/procedureevents.csv.gz
E         [2026-04-25 18:50:35,963][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../tmppkbwdr9k/raw_input/LICENSE.txt
E         [2026-04-25 18:50:36,044][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../tmppkbwdr9k/raw_input/README.txt
E         [2026-04-25 18:50:36,286][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../tmppkbwdr9k/raw_input/SHA256SUMS.txt
E         [2026-04-25 18:50:36,362][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../tmppkbwdr9k/raw_input/demo_subject_id.csv
E         [2026-04-25 18:50:45,032][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/d_icd_diagnoses.csv.gz
E         [2026-04-25 18:50:50,596][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/icu/ingredientevents.csv.gz
E         [2026-04-25 18:50:51,648][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/labevents.csv.gz
E         [2026-04-25 18:50:54,702][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/icu/inputevents.csv.gz
E         [2026-04-25 18:50:56,791][urllib3.connectionpool][WARNING] - Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f35f664e0d0>, 'Connection to physionet.org timed out. (connect timeout=10.0)')': ......................................./files/mimic-iv-demo/2.2/hosp/d_labitems.csv.gz
E         [2026-04-25 18:50:56,791][urllib3.connectionpool][WARNING] - Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f35f664d390>, 'Connection to physionet.org timed out. (connect timeout=10.0)')': ......................................./files/mimic-iv-demo/2.2/hosp/drgcodes.csv.gz
E         [2026-04-25 18:50:57,497][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/d_labitems.csv.gz
E         [2026-04-25 18:51:06,977][MIMIC_IV_MEDS.download][ERROR] - Parallel download failed for https://physionet.org......................................./files/mimic-iv-demo/2.2/hosp/drgcodes.csv.gz: Failed to download https://physionet.org......................................./files/mimic-iv-demo/2.2/hosp/drgcodes.csv.gz
E         [2026-04-25 18:51:53,012][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/icu/chartevents.csv.gz
E         
E         Command stderr:
E         Error executing job with overrides: ['root_output_dir=/tmp/tmppkbwdr9k', 'do_download=True', 'do_overwrite=True', 'do_copy=True', 'do_demo=True']
E         Traceback (most recent call last):
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11........./site-packages/urllib3/connection.py", line 204, in _new_conn
E             sock = connection.create_connection(
E                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11.../urllib3/util/connection.py", line 85, in create_connection
E             raise err
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11.../urllib3/util/connection.py", line 73, in create_connection
E             sock.connect(sa)
E         TimeoutError: timed out
E         
E         The above exception was the direct cause of the following exception:
E         
E         Traceback (most recent call last):
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11......................../site-packages/urllib3/connectionpool.py", line 787, in urlopen
E             response = self._make_request(
E                        ^^^^^^^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11......................../site-packages/urllib3/connectionpool.py", line 488, in _make_request
E             raise new_e
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11......................../site-packages/urllib3/connectionpool.py", line 464, in _make_request
E             self._validate_conn(conn)
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11......................../site-packages/urllib3/connectionpool.py", line 1093, in _validate_conn
E             conn.connect()
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11........./site-packages/urllib3/connection.py", line 759, in connect
E             self.sock = sock = self._new_conn()
E                                ^^^^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11........./site-packages/urllib3/connection.py", line 213, in _new_conn
E             raise ConnectTimeoutError(
E         urllib3.exceptions.ConnectTimeoutError: (<HTTPSConnection(host='physionet.org', port=443) at 0x7f35f64c6850>, 'Connection to physionet.org timed out. (connect timeout=10.0)')
E         
E         The above exception was the direct cause of the following exception:
E         
E         Traceback (most recent call last):
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11....../site-packages/requests/adapters.py", line 645, in send
E             resp = conn.urlopen(
E                    ^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11......................../site-packages/urllib3/connectionpool.py", line 871, in urlopen
E             return self.urlopen(
E                    ^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11......................../site-packages/urllib3/connectionpool.py", line 871, in urlopen
E             return self.urlopen(
E                    ^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11......................../site-packages/urllib3/connectionpool.py", line 871, in urlopen
E             return self.urlopen(
E                    ^^^^^^^^^^^^^
E           [Previous line repeated 2 more times]
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11......................../site-packages/urllib3/connectionpool.py", line 841, in urlopen
E             retries = retries.increment(
E                       ^^^^^^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11.../urllib3/util/retry.py", line 535, in increment
E             raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
E             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E         urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='physionet.org', port=443): Max retries exceeded with url: ......................................./files/mimic-iv-demo/2.2/hosp/drgcodes.csv.gz (Caused by ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f35f64c6850>, 'Connection to physionet.org timed out. (connect timeout=10.0)'))
E         
E         During handling of the above exception, another exception occurred:
E         
E         Traceback (most recent call last):
E           File ".../src/MIMIC_IV_MEDS/download.py", line 263, in download_file
E             with session.get(url, stream=True, timeout=DEFAULT_TIMEOUT) as response:
E                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11........./site-packages/requests/sessions.py", line 605, in get
E             return self.request("GET", url, **kwargs)
E                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11........./site-packages/requests/sessions.py", line 592, in request
E             resp = self.send(prep, **send_kwargs)
E                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11........./site-packages/requests/sessions.py", line 706, in send
E             r = adapter.send(request, **kwargs)
E                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11....../site-packages/requests/adapters.py", line 666, in send
E             raise ConnectTimeout(e, request=request)
E         requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='physionet.org', port=443): Max retries exceeded with url: ......................................./files/mimic-iv-demo/2.2/hosp/drgcodes.csv.gz (Caused by ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f35f64c6850>, 'Connection to physionet.org timed out. (connect timeout=10.0)'))
E         
E         The above exception was the direct cause of the following exception:
E         
E         Traceback (most recent call last):
E           File ".../src/MIMIC_IV_MEDS/download.py", line 485, in crawl_and_download
E             fut.result()
E           File ".../hostedtoolcache/Python/3.11.15........./x64/lib/python3.11....../concurrent/futures/_base.py", line 449, in result
E             return self.__get_result()
E                    ^^^^^^^^^^^^^^^^^^^
E           File ".../hostedtoolcache/Python/3.11.15........./x64/lib/python3.11....../concurrent/futures/_base.py", line 401, in __get_result
E             raise self._exception
E           File ".../hostedtoolcache/Python/3.11.15........./x64/lib/python3.11.../concurrent/futures/thread.py", line 58, in run
E             result = self.fn(*self.args, **self.kwargs)
E                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           File ".../src/MIMIC_IV_MEDS/download.py", line 466, in _download_one
E             download_file(file_url, subdir, worker_session)
E           File ".../src/MIMIC_IV_MEDS/download.py", line 273, in download_file
E             raise ValueError(f"Failed to download {url}") from e
E         ValueError: Failed to download https://physionet.org......................................./files/mimic-iv-demo/2.2/hosp/drgcodes.csv.gz
E         
E         The above exception was the direct cause of the following exception:
E         
E         Traceback (most recent call last):
E           File ".../src/MIMIC_IV_MEDS/download.py", line 636, in download_data
E             crawl_and_download(
E           File ".../src/MIMIC_IV_MEDS/download.py", line 510, in crawl_and_download
E             raise ValueError(f"{len(errors)} download(s) failed (first: {first_url!r})") from first_err
E         ValueError: 1 download(s) failed (first: 'https://physionet.org......................................./files/mimic-iv-demo/2.2/hosp/drgcodes.csv.gz')
E         
E         The above exception was the direct cause of the following exception:
E         
E         Traceback (most recent call last):
E           File ".../src/MIMIC_IV_MEDS/__main__.py", line 72, in main
E             download_data(
E           File ".../src/MIMIC_IV_MEDS/download.py", line 648, in download_data
E             raise ValueError(f"Failed to download data from {url}: {e}") from e
E         ValueError: Failed to download data from https://physionet.org......................................./files/mimic-iv-demo/2.2/: 1 download(s) failed (first: 'https://physionet.org......................................./files/mimic-iv-demo/2.2/hosp/drgcodes.csv.gz')
E         
E         Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
E         
E       assert 1 == 0
E        +  where 1 = CompletedProcess(args='MEDS_extract-MIMIC_IV root_output_dir=/tmp/tmppkbwdr9k do_download=True do_overwrite=True do_copy=True do_demo=True', returncode=1, stdout=b"[2026-04-25 18:49:05,853][MIMIC_IV_MEDS.__main__][INFO] - Downloading demo data with 8 parallel workers.\n[2026-04-25 18:49:07,620][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/admissions.csv.gz\n[2026-04-25 18:49:08,133][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/diagnoses_icd.csv.gz\n[2026-04-25 18:49:08,213][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/hcpcsevents.csv.gz\n[2026-04-25 18:49:16,565][urllib3.connectionpool][WARNING] - Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f35f665b750>, 'Connection to physionet.org timed out. (connect timeout=10.0)')': ......................................./files/mimic-iv-demo/2.2/hosp/d_labitems.csv.gz\n[2026-04-25 18:49:16,566][urllib3.connectionpool][WARNING] - Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(...nTraceback (most recent call last):\n  File ".../src/MIMIC_IV_MEDS/download.py", line 636, in download_data\n    crawl_and_download(\n  File ".../src/MIMIC_IV_MEDS/download.py", line 510, in crawl_and_download\n    raise ValueError(f"{len(errors)} download(s) failed (first: {first_url!r})") from first_err\nValueError: 1 download(s) failed (first: \'https://physionet.org......................................./files/mimic-iv-demo/2.2/hosp/drgcodes.csv.gz\')\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n  File ".../src/MIMIC_IV_MEDS/__main__.py", line 72, in main\n    download_data(\n  File ".../src/MIMIC_IV_MEDS/download.py", line 648, in download_data\n    raise ValueError(f"Failed to download data from {url}: {e}") from e\nValueError: Failed to download data from https://physionet.org......................................./files/mimic-iv-demo/2.2/: 1 download(s) failed (first: \'https://physionet.org......................................./files/mimic-iv-demo/2.2/hosp/drgcodes.csv.gz\')\n\nSet the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.\n').returncode

tests/e2e_demo_test.py:31: AssertionError
tests.e2e_demo_test::test_e2e_symlink
Stack Traces | 192s run time
def test_e2e_symlink():
        with TemporaryDirectory() as temp_dir:
>           run_extract_and_validate(Path(temp_dir), do_copy=False)

tests/e2e_demo_test.py:59: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

root = PosixPath('/tmp/tmpkhd2tikt'), do_copy = False

    def run_extract_and_validate(root: Path, do_copy: bool):
        do_overwrite = True
        do_demo = True
        do_download = True
    
        command_parts = [
            "MEDS_extract-MIMIC_IV",
            f"root_output_dir={root.resolve()!s}",
            f"do_download={do_download}",
            f"do_overwrite={do_overwrite}",
            f"do_copy={do_copy}",
            f"do_demo={do_demo}",
        ]
    
        full_cmd = " ".join(command_parts)
        command_out = subprocess.run(full_cmd, shell=True, capture_output=True)
    
        stdout = command_out.stdout.decode()
        stderr = command_out.stderr.decode()
    
        err_message = (
            f"Command failed with return code {command_out.returncode}.\n"
            f"Command stdout:\n{stdout}\n"
            f"Command stderr:\n{stderr}"
        )
>       assert command_out.returncode == 0, err_message
E       AssertionError: Command failed with return code 1.
E         Command stdout:
E         [2026-04-25 18:45:53,525][MIMIC_IV_MEDS.__main__][INFO] - Downloading demo data with 8 parallel workers.
E         [2026-04-25 18:45:55,119][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/drgcodes.csv.gz
E         [2026-04-25 18:45:55,579][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/d_labitems.csv.gz
E         [2026-04-25 18:45:55,658][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/hcpcsevents.csv.gz
E         [2026-04-25 18:45:56,336][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/diagnoses_icd.csv.gz
E         [2026-04-25 18:46:01,986][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/microbiologyevents.csv.gz
E         [2026-04-25 18:46:03,228][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/omr.csv.gz
E         [2026-04-25 18:46:03,408][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/patients.csv.gz
E         [2026-04-25 18:46:04,262][urllib3.connectionpool][WARNING] - Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f1229254650>, 'Connection to physionet.org timed out. (connect timeout=10.0)')': ..................................../files/mimic-iv-demo/2.2/hosp/admissions.csv.gz
E         [2026-04-25 18:46:04,262][urllib3.connectionpool][WARNING] - Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f12295675d0>, 'Connection to physionet.org timed out. (connect timeout=10.0)')': ..................................../files/mimic-iv-demo/2.2/hosp/d_icd_procedures.csv.gz
E         [2026-04-25 18:46:23,109][urllib3.connectionpool][WARNING] - Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f12290ca750>, 'Connection to physionet.org timed out. (connect timeout=10.0)')': ..................................../files/mimic-iv-demo/2.2/hosp/d_icd_procedures.csv.gz
E         [2026-04-25 18:46:23,109][urllib3.connectionpool][WARNING] - Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f12290ca6d0>, 'Connection to physionet.org timed out. (connect timeout=10.0)')': ..................................../files/mimic-iv-demo/2.2/hosp/admissions.csv.gz
E         [2026-04-25 18:46:28,999][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/d_hcpcs.csv.gz
E         [2026-04-25 18:46:37,299][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/pharmacy.csv.gz
E         [2026-04-25 18:46:39,038][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/poe_detail.csv.gz
E         [2026-04-25 18:46:41,004][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/emar_detail.csv.gz
E         [2026-04-25 18:46:41,137][urllib3.connectionpool][WARNING] - Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f12290c8810>, 'Connection to physionet.org timed out. (connect timeout=10.0)')': ..................................../files/mimic-iv-demo/2.2/hosp/d_icd_procedures.csv.gz
E         [2026-04-25 18:46:41,137][urllib3.connectionpool][WARNING] - Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f12290c85d0>, 'Connection to physionet.org timed out. (connect timeout=10.0)')': ..................................../files/mimic-iv-demo/2.2/hosp/admissions.csv.gz
E         [2026-04-25 18:46:41,487][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/procedures_icd.csv.gz
E         [2026-04-25 18:46:43,004][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/emar.csv.gz
E         [2026-04-25 18:46:43,362][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/services.csv.gz
E         [2026-04-25 18:46:44,979][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/transfers.csv.gz
E         [2026-04-25 18:46:47,793][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/icu/caregiver.csv.gz
E         [2026-04-25 18:46:51,638][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/provider.csv.gz
E         [2026-04-25 18:46:55,364][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/icu/d_items.csv.gz
E         [2026-04-25 18:47:03,166][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/icu/datetimeevents.csv.gz
E         [2026-04-25 18:47:03,622][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/icu/icustays.csv.gz
E         [2026-04-25 18:47:07,325][urllib3.connectionpool][WARNING] - Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f122924dc10>, 'Connection to physionet.org timed out. (connect timeout=10.0)')': ..................................../files/mimic-iv-demo/2.2/hosp/d_icd_procedures.csv.gz
E         [2026-04-25 18:47:07,325][urllib3.connectionpool][WARNING] - Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f12290db3d0>, 'Connection to physionet.org timed out. (connect timeout=10.0)')': ..................................../files/mimic-iv-demo/2.2/hosp/admissions.csv.gz
E         [2026-04-25 18:47:08,212][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/poe.csv.gz
E         [2026-04-25 18:47:19,248][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/prescriptions.csv.gz
E         [2026-04-25 18:47:25,624][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/icu/outputevents.csv.gz
E         [2026-04-25 18:47:28,631][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/icu/procedureevents.csv.gz
E         [2026-04-25 18:47:30,461][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../tmpkhd2tikt/raw_input/LICENSE.txt
E         [2026-04-25 18:47:30,538][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../tmpkhd2tikt/raw_input/README.txt
E         [2026-04-25 18:47:30,846][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../tmpkhd2tikt/raw_input/SHA256SUMS.txt
E         [2026-04-25 18:47:30,928][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../tmpkhd2tikt/raw_input/demo_subject_id.csv
E         [2026-04-25 18:47:42,265][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/icu/ingredientevents.csv.gz
E         [2026-04-25 18:47:48,003][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/d_icd_diagnoses.csv.gz
E         [2026-04-25 18:47:49,508][urllib3.connectionpool][WARNING] - Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f12290b2190>, 'Connection to physionet.org timed out. (connect timeout=10.0)')': ..................................../files/mimic-iv-demo/2.2/hosp/d_icd_procedures.csv.gz
E         [2026-04-25 18:47:49,508][urllib3.connectionpool][WARNING] - Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f12290b1c50>, 'Connection to physionet.org timed out. (connect timeout=10.0)')': ..................................../files/mimic-iv-demo/2.2/hosp/admissions.csv.gz
E         [2026-04-25 18:47:51,830][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/icu/inputevents.csv.gz
E         [2026-04-25 18:47:54,104][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/labevents.csv.gz
E         [2026-04-25 18:47:59,694][MIMIC_IV_MEDS.download][ERROR] - Parallel download failed for https://physionet.org..................................../files/mimic-iv-demo/2.2/hosp/admissions.csv.gz: Failed to download https://physionet.org..................................../files/mimic-iv-demo/2.2/hosp/admissions.csv.gz
E         [2026-04-25 18:48:17,158][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/d_icd_procedures.csv.gz
E         [2026-04-25 18:49:04,867][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/icu/chartevents.csv.gz
E         
E         Command stderr:
E         Error executing job with overrides: ['root_output_dir=/tmp/tmpkhd2tikt', 'do_download=True', 'do_overwrite=True', 'do_copy=False', 'do_demo=True']
E         Traceback (most recent call last):
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11........./site-packages/urllib3/connection.py", line 204, in _new_conn
E             sock = connection.create_connection(
E                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11.../urllib3/util/connection.py", line 85, in create_connection
E             raise err
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11.../urllib3/util/connection.py", line 73, in create_connection
E             sock.connect(sa)
E         TimeoutError: timed out
E         
E         The above exception was the direct cause of the following exception:
E         
E         Traceback (most recent call last):
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11......................../site-packages/urllib3/connectionpool.py", line 787, in urlopen
E             response = self._make_request(
E                        ^^^^^^^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11......................../site-packages/urllib3/connectionpool.py", line 488, in _make_request
E             raise new_e
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11......................../site-packages/urllib3/connectionpool.py", line 464, in _make_request
E             self._validate_conn(conn)
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11......................../site-packages/urllib3/connectionpool.py", line 1093, in _validate_conn
E             conn.connect()
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11........./site-packages/urllib3/connection.py", line 759, in connect
E             self.sock = sock = self._new_conn()
E                                ^^^^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11........./site-packages/urllib3/connection.py", line 213, in _new_conn
E             raise ConnectTimeoutError(
E         urllib3.exceptions.ConnectTimeoutError: (<HTTPSConnection(host='physionet.org', port=443) at 0x7f12290f2b90>, 'Connection to physionet.org timed out. (connect timeout=10.0)')
E         
E         The above exception was the direct cause of the following exception:
E         
E         Traceback (most recent call last):
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11....../site-packages/requests/adapters.py", line 645, in send
E             resp = conn.urlopen(
E                    ^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11......................../site-packages/urllib3/connectionpool.py", line 871, in urlopen
E             return self.urlopen(
E                    ^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11......................../site-packages/urllib3/connectionpool.py", line 871, in urlopen
E             return self.urlopen(
E                    ^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11......................../site-packages/urllib3/connectionpool.py", line 871, in urlopen
E             return self.urlopen(
E                    ^^^^^^^^^^^^^
E           [Previous line repeated 2 more times]
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11......................../site-packages/urllib3/connectionpool.py", line 841, in urlopen
E             retries = retries.increment(
E                       ^^^^^^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11.../urllib3/util/retry.py", line 535, in increment
E             raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
E             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E         urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='physionet.org', port=443): Max retries exceeded with url: ..................................../files/mimic-iv-demo/2.2/hosp/admissions.csv.gz (Caused by ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f12290f2b90>, 'Connection to physionet.org timed out. (connect timeout=10.0)'))
E         
E         During handling of the above exception, another exception occurred:
E         
E         Traceback (most recent call last):
E           File ".../src/MIMIC_IV_MEDS/download.py", line 263, in download_file
E             with session.get(url, stream=True, timeout=DEFAULT_TIMEOUT) as response:
E                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11........./site-packages/requests/sessions.py", line 605, in get
E             return self.request("GET", url, **kwargs)
E                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11........./site-packages/requests/sessions.py", line 592, in request
E             resp = self.send(prep, **send_kwargs)
E                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11........./site-packages/requests/sessions.py", line 706, in send
E             r = adapter.send(request, **kwargs)
E                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           File ".../MIMIC_IV_MEDS/MIMIC_IV_MEDS/.venv/lib/python3.11....../site-packages/requests/adapters.py", line 666, in send
E             raise ConnectTimeout(e, request=request)
E         requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='physionet.org', port=443): Max retries exceeded with url: ..................................../files/mimic-iv-demo/2.2/hosp/admissions.csv.gz (Caused by ConnectTimeoutError(<HTTPSConnection(host='physionet.org', port=443) at 0x7f12290f2b90>, 'Connection to physionet.org timed out. (connect timeout=10.0)'))
E         
E         The above exception was the direct cause of the following exception:
E         
E         Traceback (most recent call last):
E           File ".../src/MIMIC_IV_MEDS/download.py", line 485, in crawl_and_download
E             fut.result()
E           File ".../hostedtoolcache/Python/3.11.15........./x64/lib/python3.11....../concurrent/futures/_base.py", line 449, in result
E             return self.__get_result()
E                    ^^^^^^^^^^^^^^^^^^^
E           File ".../hostedtoolcache/Python/3.11.15........./x64/lib/python3.11....../concurrent/futures/_base.py", line 401, in __get_result
E             raise self._exception
E           File ".../hostedtoolcache/Python/3.11.15........./x64/lib/python3.11.../concurrent/futures/thread.py", line 58, in run
E             result = self.fn(*self.args, **self.kwargs)
E                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           File ".../src/MIMIC_IV_MEDS/download.py", line 466, in _download_one
E             download_file(file_url, subdir, worker_session)
E           File ".../src/MIMIC_IV_MEDS/download.py", line 273, in download_file
E             raise ValueError(f"Failed to download {url}") from e
E         ValueError: Failed to download https://physionet.org..................................../files/mimic-iv-demo/2.2/hosp/admissions.csv.gz
E         
E         The above exception was the direct cause of the following exception:
E         
E         Traceback (most recent call last):
E           File ".../src/MIMIC_IV_MEDS/download.py", line 636, in download_data
E             crawl_and_download(
E           File ".../src/MIMIC_IV_MEDS/download.py", line 510, in crawl_and_download
E             raise ValueError(f"{len(errors)} download(s) failed (first: {first_url!r})") from first_err
E         ValueError: 1 download(s) failed (first: 'https://physionet.org..................................../files/mimic-iv-demo/2.2/hosp/admissions.csv.gz')
E         
E         The above exception was the direct cause of the following exception:
E         
E         Traceback (most recent call last):
E           File ".../src/MIMIC_IV_MEDS/__main__.py", line 72, in main
E             download_data(
E           File ".../src/MIMIC_IV_MEDS/download.py", line 648, in download_data
E             raise ValueError(f"Failed to download data from {url}: {e}") from e
E         ValueError: Failed to download data from https://physionet.org..................................../files/mimic-iv-demo/2.2/: 1 download(s) failed (first: 'https://physionet.org..................................../files/mimic-iv-demo/2.2/hosp/admissions.csv.gz')
E         
E         Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
E         
E       assert 1 == 0
E        +  where 1 = CompletedProcess(args='MEDS_extract-MIMIC_IV root_output_dir=/tmp/tmpkhd2tikt do_download=True do_overwrite=True do_copy=False do_demo=True', returncode=1, stdout=b"[2026-04-25 18:45:53,525][MIMIC_IV_MEDS.__main__][INFO] - Downloading demo data with 8 parallel workers.\n[2026-04-25 18:45:55,119][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/drgcodes.csv.gz\n[2026-04-25 18:45:55,579][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/d_labitems.csv.gz\n[2026-04-25 18:45:55,658][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/hcpcsevents.csv.gz\n[2026-04-25 18:45:56,336][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/diagnoses_icd.csv.gz\n[2026-04-25 18:46:01,986][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/microbiologyevents.csv.gz\n[2026-04-25 18:46:03,228][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/omr.csv.gz\n[2026-04-25 18:46:03,408][MIMIC_IV_MEDS.download][INFO] - Downloaded: .../raw_input/hosp/patients.csv.gz\n[2026-04-25 18:46:04,262][urllib3.connectionpool][WARNING] - Retrying (Retry(to...ceback (most recent call last):\n  File ".../src/MIMIC_IV_MEDS/download.py", line 636, in download_data\n    crawl_and_download(\n  File ".../src/MIMIC_IV_MEDS/download.py", line 510, in crawl_and_download\n    raise ValueError(f"{len(errors)} download(s) failed (first: {first_url!r})") from first_err\nValueError: 1 download(s) failed (first: \'https://physionet.org..................................../files/mimic-iv-demo/2.2/hosp/admissions.csv.gz\')\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n  File ".../src/MIMIC_IV_MEDS/__main__.py", line 72, in main\n    download_data(\n  File ".../src/MIMIC_IV_MEDS/download.py", line 648, in download_data\n    raise ValueError(f"Failed to download data from {url}: {e}") from e\nValueError: Failed to download data from https://physionet.org..................................../files/mimic-iv-demo/2.2/: 1 download(s) failed (first: \'https://physionet.org..................................../files/mimic-iv-demo/2.2/hosp/admissions.csv.gz\')\n\nSet the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.\n').returncode

tests/e2e_demo_test.py:31: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant