Skip to content

PyCharm Configuration

Albert Zeyer edited this page May 10, 2023 · 16 revisions

In order to conveniently work with PyCharm on RETURNN, some modification to the settings can be made. This Guide is for PyCharm 2020.1.2, but should work for other versions as well.

Use black

  • See black editor integration doc
  • I personally use the BlackConnect plugin now. Go to settings Tools | BlackConnect:
    • Enable all Trigger settings
    • Set Line length to 120

Editor | Inspections

  • change Profile to Project Default
  • Python | PEP8 coding style violation
    • Ignore Errors: E203 (see black)
  • Python | Missing or empty docstring
    • Enable weak warning or warning
  • Python | Unsatisfied package requirements
    • Add to ignored packages (each an own entry): tensorflow, soundfile, matplotlib, mpi4py, horovod, scipy, sentencepiece, torch, torchdata, tree

Version Control | Commit Dialog

  • Commit message inspections:
    • enable all options
    • Limit body line -> right margin should be 72
    • Limit subject line -> right margin should be 72

Project: returnn | Project Structure

  • exclude:
    • docs/_build
    • docs/api
    • docs/returnn

As "Weak Warnings" might be difficult to see in the default style settings, the style can be changed under Editor->Color Scheme->General within the category: Errors and Warnings.

Note: if PEP8 errors fail to be displayed, add the Python interpreter to the project again, as specified in this post.