Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
Reformatted various files to comply with PEP8
Browse files Browse the repository at this point in the history
  • Loading branch information
dzelge committed Jan 18, 2019
1 parent 47d4eee commit 4284d05
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cate/core/ds.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ def open_xarray_dataset(paths,
e.g. the whole array in the file. Otherwise smaller dask chunks will be used
to split the dataset.
:param paths: Either a string glob in the form "path/to/my/files/\*.nc" or an explicit
:param paths: Either a string glob in the form "path/to/my/files/\\*.nc" or an explicit
list of files to open.
:param region: Optional region constraint.
:param var_names: Optional variable names constraint.
Expand Down
4 changes: 2 additions & 2 deletions cate/core/op.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,12 +698,12 @@ def new_subprocess_op(op_meta_info: OpMetaInfo,
and returns a tuple (label, total_work) or a regex that must match
in order to signal the start of progress monitoring.
The regex must provide the group names "label" or "total_work" or both,
e.g. "(?P<label>\w+)" or "(?P<total_work>\d+)"
e.g. "(?P<label>\\w+)" or "(?P<total_work>\\d+)"
:param progress: Either a callable that receives a text line from the executable's stdout
and returns a tuple (work, msg) or a regex that must match
in order to signal process.
The regex must provide group names "work" or "msg" or both,
e.g. "(?P<msg>\w+)" or "(?P<work>\d+)"
e.g. "(?P<msg>\\w+)" or "(?P<work>\\d+)"
:param done: Either a callable that receives a text line a text line from the executable's stdout
and returns True or False or a regex that must match
in order to signal the end of progress monitoring.
Expand Down
4 changes: 2 additions & 2 deletions cate/core/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1109,11 +1109,11 @@ class SubProcessStep(OpStepBase):
:param started_re: A regex that must match a text line from the process' stdout
in order to signal the start of progress monitoring.
The regex must provide the group names "label" or "total_work" or both,
e.g. "(?P<label>\w+)" or "(?P<total_work>\d+)"
e.g. "(?P<label>\\w+)" or "(?P<total_work>\\d+)"
:param progress_re: A regex that must match a text line from the process' stdout
in order to signal process.
The regex must provide group names "work" or "msg" or both,
e.g. "(?P<msg>\w+)" or "(?P<work>\d+)"
e.g. "(?P<msg>\\w+)" or "(?P<work>\\d+)"
:param done_re: A regex that must match a text line from the process' stdout
in order to signal the end of progress monitoring.
:param inputs: input name to input properties mapping.
Expand Down
2 changes: 1 addition & 1 deletion cate/core/wsmanag.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def plot_workspace_resource(self, base_dir: str, res_name: str,

import xarray as xr
import numpy as np
import matplotlib
# import matplotlib
# matplotlib.use('Qt5Agg')
import matplotlib.pyplot as plt

Expand Down
2 changes: 1 addition & 1 deletion cate/ops/animate.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"""
import os
import matplotlib

# import matplotlib
# noinspection PyBroadException
# try:
# matplotlib.use('Qt5Agg')
Expand Down
2 changes: 1 addition & 1 deletion cate/util/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def can_load_from_key(self, key) -> bool:
return False

def load_from_key(self, key):
raise NotImplemented()
raise NotImplementedError()

def store_value(self, key, value):
"""
Expand Down
2 changes: 1 addition & 1 deletion cate/util/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def new_indexed_name(names: Iterable[str], pattern: str) -> str:
"""
if "{index}" not in pattern:
raise ValueError('pattern must contain "{index}"')
re_pattern = re.compile(pattern.replace("{index}", "(\d+)"))
re_pattern = re.compile(pattern.replace("{index}", r"(\d+)"))
max_index = 0
for name in names:
match_result = re_pattern.match(name)
Expand Down
4 changes: 2 additions & 2 deletions cate/util/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ class ProcessOutputMonitor:
:param started: Either a callable that receives a text line and returns a tuple (label, total_work)
or a regex that must match in order to signal the start of progress monitoring.
The regex must provide the group names "label" or "total_work" or both,
e.g. "(?P<label>\w+)" or "(?P<total_work>\d+)"
e.g. r"(?P<label>\\w+)" or "(?P<total_work>\\d+)"
:param progress: Either a callable that receives a text line and returns a tuple (work, msg)
or a regex that must match in order to signal process.
The regex must provide group names "work" or "msg" or both,
e.g. "(?P<msg>\w+)" or "(?P<work>\d+)"
e.g. r"(?P<msg>\\w+)" or "(?P<work>\\d+)"
:param done: Either a callable that receives a text line and returns True or False
or a regex that must match in order to signal the end of progress monitoring.
"""
Expand Down
2 changes: 1 addition & 1 deletion cate/util/web/webapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ def url_pattern(pattern: str):
:return: equivalent regex pattern
:raise ValueError: if *pattern* is invalid
"""
name_pattern = '(?P<%s>[^\;\/\?\:\@\&\=\+\$\,]+)'
name_pattern = r'(?P<%s>[^\;\/\?\:\@\&\=\+\$\,]+)'
reg_expr = ''
pos = 0
while True:
Expand Down
6 changes: 3 additions & 3 deletions cate/webapi/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def job():
res_id=res_id,
feature_index=feature_index,
conservation_ratio=conservation_ratio)
except BaseException as e:
except BaseException:
self.write_status_error(exc_info=sys.exc_info())
self.finish()
if TRACE_PERF:
Expand Down Expand Up @@ -433,7 +433,7 @@ def get(self, base_dir, res_id):
if var_name:
try:
var_data = resource[var_name]
except Exception as e:
except Exception:
self.write_status_error(exc_info=sys.exc_info())
self.finish()
return
Expand All @@ -460,7 +460,7 @@ def get(self, base_dir, res_id):

self.set_header('Content-Type', 'text/csv')
self.write(csv)
except Exception as e:
except Exception:
self.write_status_error(exc_info=sys.exc_info())
self.finish()

Expand Down

0 comments on commit 4284d05

Please sign in to comment.