scikit-learn-contrib / scikit-matter

A collection of scikit-learn compatible utilities that implement methods born out of the materials science and chemistry communities
https://scikit-matter.readthedocs.io/en/v0.2.0/
BSD 3-Clause "New" or "Revised" License
70 stars 18 forks source link

Add flake8-bugbear and flake8-sphinx-links #178

Closed PicoCentauri closed 1 year ago

PicoCentauri commented 1 year ago

Introduce linters for possible bugs (flake8-bugbear) and correct sphinx links in the docs (flake8-sphinx-links).

Besides some minor changes the most noticable change is setting the stacklevel of warnings since this is required by flake8-bugbear:

B028: No explicit stacklevel keyword argument found. The warn method from the warnings module uses a stacklevel of 1 by default. This will only show a stack trace for the line on which the warn method is called. It is therefore recommended to use a stacklevel of 2 or greater to provide more information to the user.

Here, I set the level to stacklevel=1 (the default) meaning that no additional backtrace information is given. I think we do not need more information for the user because the warnings are well written and a link and codeblock does not help much. If you disagree we can also set it to 2 or 3.

We had already a discussion in equistore.


:books: Documentation preview :books:: https://scikit-matter--178.org.readthedocs.build/en/178/