OCR only on the pages without text; otherwise routes; batches on Dask through its own API
This commit is contained in:
@@ -11,7 +11,6 @@ from the valid studies.
|
||||
from pathlib import Path
|
||||
|
||||
import pandas as pd
|
||||
from joblib import Parallel, delayed
|
||||
|
||||
from models import cluster
|
||||
from models.tea.eeg.analysis import analyze
|
||||
@@ -48,9 +47,8 @@ def _one(key: str, edf: bytes, age: float) -> dict:
|
||||
def measure(studies) -> list[dict]:
|
||||
"""Each study's verdict and features, in listing order, each a task on the cluster
|
||||
(models.cluster)."""
|
||||
with cluster.batch(): # each task carries its recording: workers see no local folder
|
||||
return Parallel(n_jobs=cluster.jobs())(delayed(_one)(key, Path(path).read_bytes(), age)
|
||||
for key, path, age in studies) # fmt: skip
|
||||
# each task carries its recording: workers see no local folder
|
||||
return cluster.run(_one, ((key, Path(path).read_bytes(), age) for key, path, age in studies))
|
||||
|
||||
|
||||
def tables(measured: list[dict]) -> dict[str, pd.DataFrame]:
|
||||
|
||||
Reference in New Issue
Block a user