peakdet icon indicating copy to clipboard operation
peakdet copied to clipboard

Make linters happy again

Open smoia opened this issue 3 years ago • 0 comments

@vinferrer was happily moving the tests to Cirrus CI using the same linters as phys2bids when we realised that the linters are not happy at the moment...

...by this much:
make lint
peakdet/operations.py:2:1: D200 One-line docstring should fit on one line with quotes
peakdet/operations.py:2:1: D400 First line should end with a period
peakdet/operations.py:14:1: D202 No blank lines allowed after function docstring
peakdet/operations.py:14:1: D400 First line should end with a period
peakdet/operations.py:14:1: D401 First line should be in imperative mood
peakdet/operations.py:66:1: D202 No blank lines allowed after function docstring
peakdet/operations.py:66:1: D400 First line should end with a period
peakdet/operations.py:102:1: D202 No blank lines allowed after function docstring
peakdet/operations.py:102:1: D400 First line should end with a period
peakdet/operations.py:102:1: D401 First line should be in imperative mood
peakdet/operations.py:143:1: D202 No blank lines allowed after function docstring
peakdet/operations.py:143:1: D400 First line should end with a period
peakdet/operations.py:143:1: D401 First line should be in imperative mood
peakdet/operations.py:165:1: D202 No blank lines allowed after function docstring
peakdet/operations.py:165:1: D400 First line should end with a period
peakdet/operations.py:165:1: D401 First line should be in imperative mood
peakdet/operations.py:186:1: D202 No blank lines allowed after function docstring
peakdet/operations.py:186:1: D400 First line should end with a period
peakdet/operations.py:186:1: D401 First line should be in imperative mood
peakdet/operations.py:221:1: D202 No blank lines allowed after function docstring
peakdet/operations.py:221:1: D400 First line should end with a period
peakdet/operations.py:221:1: D401 First line should be in imperative mood
peakdet/analytics.py:2:1: D200 One-line docstring should fit on one line with quotes
peakdet/analytics.py:2:1: D400 First line should end with a period
peakdet/analytics.py:12:1: D400 First line should end with a period
peakdet/analytics.py:67:1: D107 Missing docstring in __init__
peakdet/analytics.py:75:1: D210 No whitespaces allowed surrounding docstring text
peakdet/analytics.py:75:1: D400 First line should end with a period
peakdet/analytics.py:75:1: D401 First line should be in imperative mood
peakdet/analytics.py:83:1: D210 No whitespaces allowed surrounding docstring text
peakdet/analytics.py:83:1: D400 First line should end with a period
peakdet/analytics.py:96:1: D102 Missing docstring in public method
peakdet/analytics.py:100:1: D102 Missing docstring in public method
peakdet/analytics.py:104:1: D102 Missing docstring in public method
peakdet/analytics.py:108:1: D102 Missing docstring in public method
peakdet/analytics.py:112:1: D102 Missing docstring in public method
peakdet/analytics.py:116:1: D102 Missing docstring in public method
peakdet/analytics.py:120:1: D102 Missing docstring in public method
peakdet/analytics.py:124:1: D102 Missing docstring in public method
peakdet/analytics.py:143:1: D102 Missing docstring in public method
peakdet/analytics.py:147:1: D102 Missing docstring in public method
peakdet/analytics.py:151:1: D102 Missing docstring in public method
peakdet/analytics.py:155:1: D102 Missing docstring in public method
peakdet/analytics.py:159:1: D102 Missing docstring in public method
peakdet/analytics.py:163:1: D102 Missing docstring in public method
peakdet/analytics.py:167:1: D102 Missing docstring in public method
peakdet/analytics.py:171:1: D102 Missing docstring in public method
peakdet/analytics.py:176:1: D102 Missing docstring in public method
peakdet/utils.py:2:1: D205 1 blank line required between summary line and description
peakdet/utils.py:2:1: D400 First line should end with a period
peakdet/utils.py:14:1: D400 First line should end with a period
peakdet/utils.py:14:1: D401 First line should be in imperative mood; try rephrasing
peakdet/utils.py:65:1: D202 No blank lines allowed after function docstring
peakdet/utils.py:65:1: D400 First line should end with a period
peakdet/utils.py:65:1: D401 First line should be in imperative mood
peakdet/utils.py:112:1: D202 No blank lines allowed after function docstring
peakdet/utils.py:112:1: D400 First line should end with a period
peakdet/utils.py:112:1: D401 First line should be in imperative mood
peakdet/utils.py:150:1: D202 No blank lines allowed after function docstring
peakdet/utils.py:150:1: D400 First line should end with a period
peakdet/utils.py:150:1: D401 First line should be in imperative mood
peakdet/utils.py:187:1: D202 No blank lines allowed after function docstring
peakdet/utils.py:187:1: D400 First line should end with a period
peakdet/utils.py:187:1: D401 First line should be in imperative mood
peakdet/modalities.py:1:1: D100 Missing docstring in public module
peakdet/modalities.py:6:1: D101 Missing docstring in public class
peakdet/modalities.py:7:1: D102 Missing docstring in public method
peakdet/modalities.py:26:1: D102 Missing docstring in public method
peakdet/modalities.py:30:1: D101 Missing docstring in public class
peakdet/modalities.py:34:1: D101 Missing docstring in public class
peakdet/modalities.py:38:1: D101 Missing docstring in public class
peakdet/modalities.py:41:1: D102 Missing docstring in public method
peakdet/info.py:1:1: D100 Missing docstring in public module
peakdet/physio.py:2:1: D200 One-line docstring should fit on one line with quotes
peakdet/physio.py:2:1: D400 First line should end with a period
peakdet/physio.py:10:1: D400 First line should end with a period
peakdet/physio.py:39:1: D107 Missing docstring in __init__
peakdet/physio.py:71:1: D105 Missing docstring in magic method
peakdet/physio.py:74:1: D105 Missing docstring in magic method
peakdet/physio.py:77:1: D105 Missing docstring in magic method
peakdet/physio.py:80:1: D105 Missing docstring in magic method
peakdet/physio.py:91:1: D210 No whitespaces allowed surrounding docstring text
peakdet/physio.py:91:1: D400 First line should end with a period
peakdet/physio.py:96:1: D210 No whitespaces allowed surrounding docstring text
peakdet/physio.py:96:1: D400 First line should end with a period
peakdet/physio.py:96:1: D401 First line should be in imperative mood
peakdet/physio.py:101:1: D210 No whitespaces allowed surrounding docstring text
peakdet/physio.py:101:1: D400 First line should end with a period
peakdet/physio.py:106:1: D210 No whitespaces allowed surrounding docstring text
peakdet/physio.py:106:1: D400 First line should end with a period
peakdet/physio.py:106:1: D401 First line should be in imperative mood
peakdet/physio.py:111:1: D210 No whitespaces allowed surrounding docstring text
peakdet/physio.py:111:1: D400 First line should end with a period
peakdet/physio.py:111:1: D401 First line should be in imperative mood
peakdet/io.py:2:1: D200 One-line docstring should fit on one line with quotes
peakdet/io.py:2:1: D400 First line should end with a period
peakdet/io.py:17:1: D202 No blank lines allowed after function docstring
peakdet/io.py:17:1: D400 First line should end with a period
peakdet/io.py:17:1: D401 First line should be in imperative mood
peakdet/io.py:94:1: D202 No blank lines allowed after function docstring
peakdet/io.py:94:1: D400 First line should end with a period
peakdet/io.py:94:1: D401 First line should be in imperative mood
peakdet/io.py:123:1: D202 No blank lines allowed after function docstring
peakdet/io.py:123:1: D400 First line should end with a period
peakdet/io.py:123:1: D401 First line should be in imperative mood
peakdet/io.py:175:1: D202 No blank lines allowed after function docstring
peakdet/io.py:175:1: D400 First line should end with a period
peakdet/io.py:175:1: D401 First line should be in imperative mood
peakdet/editor.py:2:1: D200 One-line docstring should fit on one line with quotes
peakdet/editor.py:2:1: D400 First line should end with a period
peakdet/editor.py:14:1: D400 First line should end with a period
peakdet/editor.py:51:1: D210 No whitespaces allowed surrounding docstring text
peakdet/editor.py:51:1: D400 First line should end with a period
peakdet/editor.py:51:1: D401 First line should be in imperative mood
peakdet/editor.py:69:1: D210 No whitespaces allowed surrounding docstring text
peakdet/editor.py:69:1: D400 First line should end with a period
peakdet/editor.py:69:1: D401 First line should be in imperative mood
peakdet/editor.py:75:1: D210 No whitespaces allowed surrounding docstring text
peakdet/editor.py:75:1: D400 First line should end with a period
peakdet/editor.py:79:1: D210 No whitespaces allowed surrounding docstring text
peakdet/editor.py:79:1: D400 First line should end with a period
peakdet/editor.py:87:1: D210 No whitespaces allowed surrounding docstring text
peakdet/editor.py:87:1: D400 First line should end with a period
peakdet/editor.py:87:1: D401 First line should be in imperative mood
peakdet/editor.py:106:1: D210 No whitespaces allowed surrounding docstring text
peakdet/editor.py:106:1: D400 First line should end with a period
peakdet/editor.py:106:1: D401 First line should be in imperative mood
peakdet/__init__.py:1:1: D104 Missing docstring in public package
peakdet/__init__.py:18:17: W292 no newline at end of file
peakdet/external.py:2:1: D200 One-line docstring should fit on one line with quotes
peakdet/external.py:2:1: D400 First line should end with a period
peakdet/external.py:13:1: D202 No blank lines allowed after function docstring
peakdet/external.py:13:1: D400 First line should end with a period
peakdet/external.py:13:1: D401 First line should be in imperative mood
peakdet/cli/run.py:1:1: D100 Missing docstring in public module
peakdet/cli/run.py:51:1: D210 No whitespaces allowed surrounding docstring text
peakdet/cli/run.py:51:1: D400 First line should end with a period
peakdet/cli/run.py:111:1: D202 No blank lines allowed after function docstring
peakdet/cli/run.py:111:1: D400 First line should end with a period
peakdet/cli/run.py:111:1: D401 First line should be in imperative mood; try rephrasing
peakdet/cli/run.py:227:1: D103 Missing docstring in public function
peakdet/cli/__init__.py:1:1: D104 Missing docstring in public package
make: *** [Makefile:13: lint] Error 1

So this is some work to do next! And, judging by most of the errors, I'm going to say it's a good first issue to start navigating the code and understanding its doing (and practice python & git).

smoia avatar Jan 26 '21 16:01 smoia

thanks @shlff -- looks like markdown isn't rendered in the list -- is the link formed over two lines? If you edit the notebook can you get the link to work. If so please add solution here.

mmcky avatar Feb 01 '21 23:02 mmcky

Thanks @mmcky . Please see the whole part of this footnote

<p><a id=fn-mdt href=#fn-mdt-link><strong>[1]</strong></a> Although there is a specialized matrix data type defined in NumPy, it’s more standard to work with ordinary NumPy arrays. See [this discussion](https://python-programming.quantecon.org/numpy.html#matrix-multiplication).

It seems that the link does not form over two lines.

shlff avatar Feb 03 '21 02:02 shlff

@shlff would you mind copying the notebook here? Your right -- not split over lines. I wonder why jupyter isn't picking up the link in that context.

mmcky avatar Feb 08 '21 06:02 mmcky

Sure @mmcky . Please find the notebook here.

shlff avatar Feb 09 '21 00:02 shlff

hey @shlff it looks like the leading html causes the jupyter notebook to not parse the paragraph as markdown

Perhaps we should use:

**Footnotes**

<p><a id=fn-mdt href=#fn-mdt-link><strong>[1]</strong></a> 
    
Although there is a specialized matrix data type defined in NumPy, it’s more standard to work with ordinary NumPy arrays. See [this discussion](https://python-programming.quantecon.org/numpy.html#matrix-multiplication).

<p><a id=cfn href=#cfn-link><strong>[2]</strong></a> 
    
Suppose that $ \|S \| < 1 $. Take any nonzero vector $ x $, and let $ r := \|x\| $. We have $ \| Sx \| = r \| S (x/r) \| \leq r \| S \| < r = \| x\| $. Hence every point is pulled towards the origin.

mmcky avatar Feb 09 '21 01:02 mmcky

Actually we should probably update sphinx-tojupyter to use markdown

**Footnotes**

**[1]** Although there is a specialized matrix data type defined in NumPy, it’s more standard to work with ordinary NumPy arrays. See [this discussion](https://python-programming.quantecon.org/numpy.html#matrix-multiplication).

**[2]** Suppose that $ \|S \| < 1 $. Take any nonzero vector $ x $, and let $ r := \|x\| $. We have $ \| Sx \| = r \| S (x/r) \| \leq r \| S \| < r = \| x\| $. Hence every point is pulled towards the origin.

mmcky avatar Feb 09 '21 01:02 mmcky

I love the 2nd change, @mmcky . Do you think we should manually update the leading in footnotes of all lectures with markdown?

shlff avatar Feb 09 '21 02:02 shlff

This will need to be done in sphinx-tojupyter as the download notebook is generated from the source.

mmcky avatar Feb 09 '21 02:02 mmcky

Thanks @mmcky , this issue has not been solved yet and please see the screenshot of the notebook for lecture 04_linear_algebra downloaded from the site:

Screen Shot 2021-03-11 at 11 10 33 am

shlff avatar Mar 11 '21 00:03 shlff

This issue still exists.

shlff avatar Jun 08 '23 03:06 shlff