From 5fde57a7638d8b0122d80370f624bd09bfbd6d35 Mon Sep 17 00:00:00 2001 From: Nassim Oufattole Date: Mon, 19 Aug 2024 19:07:54 +0000 Subject: [PATCH] added autogluon support --- pyproject.toml | 4 ++-- src/MEDS_tabular_automl/mapper.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 475cf78..5070616 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ authors = [ ] description = "Scalable Tabularization of MEDS format Time-Series data" readme = "README.md" -requires-python = ">=3.12" +requires-python = ">=3.11" classifiers = [ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", @@ -17,7 +17,6 @@ classifiers = [ dependencies = [ "polars", "pyarrow", "loguru", "hydra-core", "numpy", "scipy<1.14.0", "pandas", "tqdm", "xgboost", "scikit-learn", "hydra-optuna-sweeper", "hydra-joblib-launcher", "ml-mixins", "meds==0.3", - "MEDS-transforms==0.0.5", ] [project.scripts] @@ -33,6 +32,7 @@ generate-subsets = "MEDS_tabular_automl.scripts.generate_subsets:main" dev = ["pre-commit"] tests = ["pytest", "pytest-cov", "rootutils"] profiling = ["mprofile", "matplotlib"] +autogluon = ["autogluon; python_version=='3.11.*'"] # Environment marker to restrict AutoGluon to Python 3.11 [build-system] requires = ["setuptools>=61.0", "setuptools-scm>=8.0", "wheel"] diff --git a/src/MEDS_tabular_automl/mapper.py b/src/MEDS_tabular_automl/mapper.py index 34275b8..9870c50 100644 --- a/src/MEDS_tabular_automl/mapper.py +++ b/src/MEDS_tabular_automl/mapper.py @@ -5,10 +5,12 @@ from collections.abc import Callable from datetime import datetime from pathlib import Path +from typing import TypeVar from loguru import logger LOCK_TIME_FMT = "%Y-%m-%dT%H:%M:%S.%f" +DF_T = TypeVar("DF_T") def get_earliest_lock(cache_directory: Path) -> datetime | None: @@ -82,9 +84,7 @@ def register_lock(cache_directory: Path) -> tuple[datetime, Path]: return lock_time, lock_fp -def wrap[ - DF_T -]( +def wrap( in_fp: Path, out_fp: Path, read_fn: Callable[[Path], DF_T],