Commit 0d70d70
committed
REF: Call the pandas DataFrame constructor with the same data
Call the pandas DataFrame constructor with the same data instead of
copying.
Fixes:
```
nireports/tests/test_reportlets.py::test_plot_raincloud[True-v]
nireports/tests/test_reportlets.py::test_plot_raincloud[False-h]
nireports/tests/test_reportlets.py::test_plot_raincloud[False-v]
nireports/tests/test_reportlets.py::test_plot_raincloud[True-h]
/home/runner/work/nireports/nireports/nireports/reportlets/nuisance.py:1108: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
See the caveats in the documentation:
https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
df_clip[feature] = df[feature].clip(lower=lower_limit_value, upper=upper_limit_value)
```
raised for example in:
https://github.com/nipreps/nireports/actions/runs/16604968354/job/46974298946?pr=157#step:14:4761 parent 4bfabed commit 0d70d70
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1104 | 1104 | | |
1105 | 1105 | | |
1106 | 1106 | | |
1107 | | - | |
1108 | | - | |
| 1107 | + | |
| 1108 | + | |
1109 | 1109 | | |
1110 | 1110 | | |
1111 | 1111 | | |
| |||
0 commit comments