OpenMined / PyDP

The Python Differential Privacy Library. Built on top of: https://github.com/google/differential-privacy
Apache License 2.0
507 stars 138 forks source link

Add style and mypy checks in jupyter NBs #317

Closed chinmayshah99 closed 3 years ago

chinmayshah99 commented 4 years ago

Description

Right now the only test for jupyter notebooks is making sure that the notebook actually runs and no code standards test for it.

We need to add two tests for it:

8bitmp3 commented 4 years ago

👍 @chinmayshah99 +1 for the (Google) style guide tool to help with linting things up. Maybe you could consider adding this to CI tests for the notebooks. From https://github.com/OpenMined/PyDP/pull/307#pullrequestreview-508552678:

About linting:

The easiest way to scale reviews is to let the machine do it. Every project has recurring issues that pop up in reviews, and style questions are often best settled with a style guide...

(from this blog post by @lamberta)

... Then use the nblint linter with the --styles=google flag:

python3 -m tensorflow_docs.tools.nblint --styles=google your_notebook.ipynb

This doesn't highlight everything, but it's good. Check out this README for more options.

sid-alluri commented 3 years ago

Is this still available?

chinmayshah99 commented 3 years ago

Yeah, it is still available. There is some WIP PR: https://github.com/OpenMined/PyDP/pull/322. You can take it forward from there.

dnabanita7 commented 3 years ago

I made another branch and added tests for all notebooks. The previous PR can be closed.