Conversation
| @@ -0,0 +1,38 @@ | |||
| line-length = 88 | |||
There was a problem hiding this comment.
Can we increase this limit to 128 instead...? It makes the notebooks super ugly.... Actually it was in the ignore list
| "B018", # 'useless expressions' are ok because some tests just check for exceptions | ||
| ] | ||
| "*.ipynb" = [ | ||
| "E501", # longer lines are sometimes more readable |
There was a problem hiding this comment.
I think this ignore rule was ignored??
There was a problem hiding this comment.
We never really ran ruff format on our notebooks https://github.com/scipp/copier_template/blob/288894294bf0085bedcb275e5d5788aadfe3a619/template/.pre-commit-config.yaml#L31 and with this I didn't turn it off.
Added config to exclude .ipynb files from ruff format below.
YooSunYoung
left a comment
There was a problem hiding this comment.
Notebooks shouldn't have the fixes related to E501 but other than that, it's fine...?
| "wf[MaskingRules] = {\n", | ||
| " 'x_pixel_offset': lambda x: (x < sc.scalar(-5.8e-3, unit='m').to(unit=x.unit)) | (x > sc.scalar(5.8e-3, unit='m').to(unit=x.unit)),\n", | ||
| " 'y_pixel_offset': lambda y: (y < sc.scalar(-5.8e-3, unit='m').to(unit=y.unit)) | (y > sc.scalar(5.8e-3, unit='m').to(unit=y.unit))\n", | ||
| " 'x_pixel_offset': lambda x: (\n", |
There was a problem hiding this comment.
I think we had decided (probably a long time ago) to not enforce formatting on notebooks.
If people want to format them with ruff or black, they are free to do so.
But if they want to have long lines like these, it should be allowed.
| " wf.compute(CorrectedDetector[SampleRun]).bins.concat().hist(wavelength=wbins) /\n", | ||
| " wf.compute(CorrectedDetector[OpenBeamRun]).bins.concat().hist(wavelength=wbins)\n", | ||
| ")\n", | ||
| "normalized = wf.compute(CorrectedDetector[SampleRun]).bins.concat().hist(\n", |
There was a problem hiding this comment.
Same as above, I think it was more readable before.
| "wf[time_of_flight.SourcePosition] = source_position\n", | ||
| "wf[time_of_flight.NumberOfSimulatedNeutrons] = 200_000 # Increase this number for more reliable results\n", | ||
| "wf[time_of_flight.NumberOfSimulatedNeutrons] = (\n", | ||
| " 200_000 # Increase this number for more reliable results\n", |
| ] | ||
| warn_unreachable = true | ||
|
|
||
| [tool.codespell] |
There was a problem hiding this comment.
Do we need to add this back into the global config?
No description provided.