Skip to content

Commit

Permalink
STYLE: Improve the warning message style
Browse files Browse the repository at this point in the history
Improve the warning message style: avoid whitespaces due to string
literal line breaks in code.

Allows to show:
```
UserWarning: b0_threshold (value: 0) is too low, increase your b0_threshold. It should be higher than the lowest b0 value (5.0).
  warn("b0_threshold (value: {0}) is too low, increase your "
```

instead of:
```
UserWarning: b0_threshold (value: 0) is too low, increase your              b0_threshold. It should be higher than the lowest b0 value              (5.0).
    warn("b0_threshold (value: {0}) is too low, increase your \
```
  • Loading branch information
jhlegarreta committed Nov 5, 2021
1 parent 62c21c3 commit 254c09e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dipy/core/gradients.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,9 @@ def gradient_table_from_bvals_bvecs(bvals, bvecs, b0_threshold=50, atol=1e-2,

# checking for the correctness of bvals
if b0_threshold < bvals.min():
warn("b0_threshold (value: {0}) is too low, increase your \
b0_threshold. It should be higher than the lowest b0 value \
({1}).".format(b0_threshold, bvals.min()))
warn("b0_threshold (value: {0}) is too low, increase your "
"b0_threshold. It should be higher than the lowest b0 value "
"({1}).".format(b0_threshold, bvals.min()))

bvecs = np.where(np.isnan(bvecs), 0, bvecs)
bvecs_close_to_1 = abs(vector_norm(bvecs) - 1) <= atol
Expand Down

0 comments on commit 254c09e

Please sign in to comment.