Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STYLE: Fix codespell issues #3218

Merged
merged 2 commits into from
May 16, 2024
Merged

Conversation

jhlegarreta
Copy link
Contributor

@jhlegarreta jhlegarreta commented May 12, 2024

  • STYLE: Fix typo in view parameter sagital
  • STYLE: Deprecate l parameter name in favor of step in PIESNO

@pep8speaks
Copy link

pep8speaks commented May 12, 2024

Hello @jhlegarreta, Thank you for updating !

Line 77:81: E501 line too long (82 > 80 characters)

Comment last updated at 2024-05-16 14:09:07 UTC

@jhlegarreta jhlegarreta force-pushed the FixCodespellIssues branch 3 times, most recently from 867a7aa to 2876601 Compare May 12, 2024 15:12
Copy link
Member

@skoudoro skoudoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jhlegarreta,

Thank yo for this and see below my comments

dipy/denoise/noise_estimate.py Outdated Show resolved Hide resolved
dipy/denoise/noise_estimate.py Outdated Show resolved Hide resolved
dipy/viz/streamline.py Show resolved Hide resolved
dipy/viz/streamline.py Show resolved Hide resolved
dipy/viz/tests/test_streamline.py Outdated Show resolved Hide resolved
@skoudoro
Copy link
Member

Can you also rebase this PR?

Thank you

@jhlegarreta jhlegarreta force-pushed the FixCodespellIssues branch 2 times, most recently from 7da7795 to e635078 Compare May 14, 2024 19:10
@jhlegarreta
Copy link
Contributor Author

Can you also rebase this PR?
Done.

The inline exclude pattern has not made it into a release yet:
https://github.com/codespell-project/codespell?tab=readme-ov-file#inline-ignore

And adding sagital to the excluded word list defeats the purpose, so I prefer to have it failing until a new version of codespell is released, bump the version and add the inline exclude rules then.

@jhlegarreta jhlegarreta force-pushed the FixCodespellIssues branch 3 times, most recently from 59432c4 to 28d749d Compare May 15, 2024 13:14
@skoudoro
Copy link
Member

The inline exclude pattern has not made it into a release yet:
https://github.com/codespell-project/codespell?tab=readme-ov-file#inline-ignore

I am lost by this PR and not sure to understand what you are trying to do.

to me, this 2 lines send me opposite message:

@jhlegarreta
Copy link
Contributor Author

I am sorry I have lost some lines in previous commits, you will want to check the last push force:
050567a

The codespell inline command would allow to tell to skip the sagital words that we still need to keep for backwards compatibility reasons. That is codespell still complains bout 3 lines containing sagital.

Tests are passing now: failing tests are unrelated.

Copy link

codecov bot commented May 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.75%. Comparing base (f741b88) to head (7b16a78).
Report is 5 commits behind head on master.

❗ Current head 7b16a78 differs from pull request most recent head eb861de. Consider uploading reports for the commit eb861de to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3218   +/-   ##
=======================================
  Coverage   83.75%   83.75%           
=======================================
  Files         153      153           
  Lines       21343    21348    +5     
  Branches     3445     3446    +1     
=======================================
+ Hits        17876    17881    +5     
  Misses       2611     2611           
  Partials      856      856           
Files Coverage Δ
dipy/denoise/noise_estimate.py 79.56% <100.00%> (+0.68%) ⬆️
dipy/viz/streamline.py 71.57% <100.00%> (+1.57%) ⬆️

... and 3 files with indirect coverage changes

Copy link
Member

@skoudoro skoudoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jhlegarreta,

This is almost ready to go. See below my comments.

Thanks @jhlegarreta!

dipy/denoise/noise_estimate.py Outdated Show resolved Hide resolved
dipy/viz/streamline.py Outdated Show resolved Hide resolved
dipy/viz/streamline.py Outdated Show resolved Hide resolved
dipy/viz/streamline.py Show resolved Hide resolved
@skoudoro
Copy link
Member

I am surprise that # codespell:ignore. does not work because this directive has been implemented in 2022 as you can see here: codespell-project/codespell#2400.
There was some releases after that

@skoudoro
Copy link
Member

Ah ok, it has been merged only on March 10. Let's request a release

@jhlegarreta
Copy link
Contributor Author

jhlegarreta commented May 15, 2024

It was only merged in March 2024, and there has not been a release yet. So this is ready to go.

@skoudoro
Copy link
Member

Hi @jhlegarreta,

ok, this PR is ready to go. However, I am not comfortable to merge with Codespell CI's failing and Code Format CI failing.

All the follow-up PR will then always fail. They are currently green.

Not sure what to do here.

Not sure that #3216 will fix that. For how long those CI's will fails after merging this PR?

  • Maybe we should wait the codespell release before going further
  • or we can add sagital to the ignore list and create an issue to remove it as soon as a new release appear in codespell

Please share your thought and let's find a solution.

@jhlegarreta
Copy link
Contributor Author

PR #3216 will not fix this issues. I added sagital to the whitelist; codespell is now passing. @skoudoro please open an issue to make it clear that the word should be removed once a new version of codespell is released.

@skoudoro
Copy link
Member

Ok, thank you for this, and I will create the issue.

Can you fix code format also: see here: https://github.com/dipy/dipy/actions/runs/9112708491/job/25052537528?pr=3218#step:4:126

Fix typo in view parameter `sagital`. Warn about future removal of
support.

Fixes:
```
Error: ./dipy/viz/streamline.py:10: sagital ==> sagittal
Error: ./dipy/viz/streamline.py:45: sagital ==> sagittal
Error: ./dipy/viz/tests/test_streamline.py:34: sagital ==> sagittal
```

raised for example in:
https://github.com/dipy/dipy/actions/runs/9051840842/job/24868829333?pr=3216#step:4:17

`codespell` does not allow for now inline ignore rules, so add `sagital`
to the whitelist to allow the spell check to pass. The word will be
removed as soon as a new `codespell` version gets released.

Take advantage of the commit to remove the default value from the
docstring and rely on the method signature to remove the maintenance
burden.
Deprecate `l` parameter name in favor of `step` in PIESNO: check section
2.6 in original paper by Koay et al., 2009 JMRI for further information
about its meaning.

Fixes:
```
dipy/denoise/noise_estimate.py:26:33: E741 Ambiguous variable name: `l`
dipy/denoise/noise_estimate.py:148:5: E741 Ambiguous variable name: `l`
```

raised for example in:
https://github.com/dipy/dipy/actions/runs/9051840840/job/24868829334#step:4:117

Take advantage of the commit to remove the default value from the
docstring and rely on the method signature to remove the maintenance
burden.
@jhlegarreta
Copy link
Contributor Author

Can you fix code format also: see here: https://github.com/dipy/dipy/actions/runs/9112708491/job/25052537528?pr=3218#step:4:126

My bad, had not seen that. Fixed. This is then ready to go.

@jhlegarreta
Copy link
Contributor Author

@skoudoro skoudoro merged commit 7402d82 into dipy:master May 16, 2024
29 of 32 checks passed
@skoudoro
Copy link
Member

Thank you @jhlegarreta ! merging

@jhlegarreta jhlegarreta deleted the FixCodespellIssues branch May 16, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants