From 8638f893fc2370aceac74c910e5588507a246966 Mon Sep 17 00:00:00 2001 From: Alex Kleb Date: Thu, 7 Oct 2021 11:54:25 -0400 Subject: [PATCH 1/3] remove redirectIO --- multipoint/utils.py | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/multipoint/utils.py b/multipoint/utils.py index adaa682..804be23 100644 --- a/multipoint/utils.py +++ b/multipoint/utils.py @@ -1,6 +1,3 @@ -import os -import sys -import io import copy from mpi4py import MPI import numpy as np @@ -92,30 +89,3 @@ def createGroups(sizes, comm): flags[member_key] = True return new_comm, flags - - -def redirectIO(f): - """ - Redirect stdout/stderr to the given file handle. - Based on: http://eli.thegreenplace.net/2015/redirecting-all-kinds-of-stdout-in-python/. - Written by Bret Naylor - """ - original_stdout_fd = sys.stdout.fileno() - original_stderr_fd = sys.stderr.fileno() - - sys.stdout.flush() - sys.stderr.flush() - - # Flush and close sys.stdout/err - also closes the file descriptors (fd) - sys.stdout.close() - sys.stderr.close() - - # Make original_stdout_fd point to the same file as to_fd - os.dup2(f.fileno(), original_stdout_fd) - os.dup2(f.fileno(), original_stderr_fd) - - # Create a new sys.stdout that points to the redirected fd - - # For Python 3.x - sys.stdout = io.TextIOWrapper(os.fdopen(original_stdout_fd, "wb")) - sys.stderr = io.TextIOWrapper(os.fdopen(original_stderr_fd, "wb")) From 24e4c39d629e2c252256b3a20e62933b61d01017 Mon Sep 17 00:00:00 2001 From: Alex Kleb Date: Thu, 7 Oct 2021 15:54:28 -0400 Subject: [PATCH 2/3] remove redirectIO from __init__ --- multipoint/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/multipoint/__init__.py b/multipoint/__init__.py index d06bb28..1ff88fc 100644 --- a/multipoint/__init__.py +++ b/multipoint/__init__.py @@ -3,6 +3,5 @@ from .multiPointSparse import multiPointSparse from .utils import createGroups -from .utils import redirectIO -__all__ = ["multiPointSparse", "createGroups", "redirectIO"] +__all__ = ["multiPointSparse", "createGroups"] From f856835eac6e88b2521e433bc420a4c45129943a Mon Sep 17 00:00:00 2001 From: Alex Kleb Date: Mon, 21 Feb 2022 13:52:07 -0500 Subject: [PATCH 3/3] Bump minor version --- multipoint/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multipoint/__init__.py b/multipoint/__init__.py index 1ff88fc..e335ad2 100644 --- a/multipoint/__init__.py +++ b/multipoint/__init__.py @@ -1,4 +1,4 @@ -__version__ = "1.3.2" +__version__ = "1.4.0" from .multiPointSparse import multiPointSparse