Commit d7254e02 authored by Klaus Zimmermann's avatar Klaus Zimmermann
Browse files

Detect tty for non-interactive logging output (closes #185)

parent caf15b62
......@@ -11,3 +11,5 @@ data
dask-worker-space
dist
docs/build
slurm/
......@@ -4,9 +4,9 @@ import logging
import time
import dask.array as da
from dask.distributed import progress
from iris.analysis import Aggregator
from .dask_setup import progress
from .util import change_units
......
# -*- coding: utf-8 -*-
from collections import OrderedDict
import sys
import dask
from dask.distributed import Client, LocalCluster
from dask.distributed import Client, LocalCluster, wait, system
from dask.distributed import progress as distributed_progress
# from dask_jobqueue import SLURMCluster
def progress(fs):
if sys.stdout.isatty():
return distributed_progress(fs)
else:
wait(fs)
return fs
class DistributedLocalClusterScheduler:
def __init__(self):
self.cluster = LocalCluster()
......
......@@ -3,12 +3,13 @@
import logging
import time
from dask.distributed import progress
import iris
from iris.experimental.equalise_cubes import equalise_attributes
import netCDF4
import numpy as np
from .dask_setup import progress
MISSVAL = 1.0e20
......
......@@ -2,11 +2,11 @@ import logging
import cftime
import dask.array as da
from dask.distributed import progress
import numpy as np
from .support import IndexFunction, parse_timerange
from ..dask_setup import progress
from ..dask_take_along_axis import dask_take_along_axis
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment