Skip to content

Commit

Permalink
Fix more things.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Nov 2, 2024
1 parent dc937e8 commit 602ea80
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 15 deletions.
Empty file modified .circleci/get_data.py
100644 → 100755
Empty file.
3 changes: 1 addition & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
# " for paragraphs
import os
import sys
from datetime import datetime

import xcp_d

Expand Down Expand Up @@ -91,7 +90,7 @@
# General information about the project.
project = 'xcp_d'
author = 'xcp_d team'
copyright = f'2021-{datetime.now().year}, {author}'
copyright = '2021-, {author}'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down
Empty file modified xcp_d/cli/combineqc.py
100644 → 100755
Empty file.
1 change: 0 additions & 1 deletion xcp_d/cli/parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
"""The XCP-D preprocessing worklow.
XCP-D preprocessing workflow
Expand Down
20 changes: 10 additions & 10 deletions xcp_d/cli/parser_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ def _int_or_auto(string, is_parser=True):
error = argparse.ArgumentTypeError if is_parser else ValueError
try:
intarg = int(string)
except ValueError:
except ValueError as exc:
msg = "Argument must be a nonnegative integer or 'auto'."
raise error(msg)
raise error(msg) from exc

if intarg < 0:
raise error('Int argument must be nonnegative.')
Expand All @@ -38,9 +38,9 @@ def _float_or_auto(string, is_parser=True):
error = argparse.ArgumentTypeError if is_parser else ValueError
try:
floatarg = float(string)
except ValueError:
except ValueError as exc:
msg = "Argument must be a nonnegative float or 'auto'."
raise error(msg)
raise error(msg) from exc

if floatarg < 0:
raise error('Float argument must be nonnegative.')
Expand All @@ -55,9 +55,9 @@ def _float_or_auto_or_none(string, is_parser=True):
error = argparse.ArgumentTypeError if is_parser else ValueError
try:
floatarg = float(string)
except ValueError:
except ValueError as exc:
msg = f"Argument must be a nonnegative float, 'all', or 'none', not '{string}'."
raise error(msg)
raise error(msg) from exc

if floatarg < 0:
raise error('Float argument must be nonnegative.')
Expand All @@ -68,8 +68,8 @@ def _restricted_float(x):
"""From https://stackoverflow.com/a/12117065/2589328."""
try:
x = float(x)
except ValueError:
raise argparse.ArgumentTypeError(f'{x} not a floating-point literal')
except ValueError as exc:
raise argparse.ArgumentTypeError(f'{x} not a floating-point literal') from exc

if x < 0.0 or x > 1.0:
raise argparse.ArgumentTypeError(f'{x} not in range [0.0, 1.0]')
Expand Down Expand Up @@ -120,8 +120,8 @@ def _bids_filter(value, parser):
if Path(value).exists():
try:
return loads(Path(value).read_text(), object_hook=_filter_pybids_none_any)
except JSONDecodeError:
raise parser.error(f'JSON syntax error in: <{value}>.')
except JSONDecodeError as exc:
raise parser.error(f'JSON syntax error in: <{value}>.') from exc
else:
raise parser.error(f'Path does not exist: <{value}>.')

Expand Down
1 change: 0 additions & 1 deletion xcp_d/cli/run.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
"""The XCP-D postprocessing worklow.
XCP-D postprocessing workflow
Expand Down
2 changes: 1 addition & 1 deletion xcp_d/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
class _Config:
"""An abstract class forbidding instantiation."""

_paths = tuple()
_paths = ()

def __init__(self):
"""Avert instantiation."""
Expand Down

0 comments on commit 602ea80

Please sign in to comment.