-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make all imputation methods consistent in regard to encoding requirem…
…ents (#827) * Before test * After tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Apply suggestions from code review part 1 Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net> * @nicolassidoux @Zethson Apply suggestions from code review part 2 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Updated _base_check_imputation to throw exception * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Added spinner support * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * After @eroell review * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Changed spinner to Rich * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fixed missing import * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * After @eroell review * Updated returns in imputation, rewrote miss_forest_impute * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fixed imputation returns --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net> Co-authored-by: PRECIPOINT\nicolas.sidoux <nicolas.sidoux@precipoint.de>
- Loading branch information
1 parent
f05adda
commit 67fedbf
Showing
11 changed files
with
407 additions
and
312 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import functools | ||
|
||
from rich.progress import Progress, SpinnerColumn | ||
|
||
|
||
def spinner(message: str = "Running task"): | ||
def wrap(func): | ||
@functools.wraps(func) | ||
def wrapped_f(*args, **kwargs): | ||
with Progress( | ||
"[progress.description]{task.description}", | ||
SpinnerColumn(), | ||
refresh_per_second=1500, | ||
) as progress: | ||
progress.add_task(f"[blue]{message}", total=1) | ||
result = func(*args, **kwargs) | ||
return result | ||
|
||
return wrapped_f | ||
|
||
return wrap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.