Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
shape_commentator Fix python -m shape_commentator Dec 4, 2018
.gitignore Add tests Dec 4, 2018
LICENSE Create LICENSE Dec 3, 2018
MANIFEST.in Add tests Dec 4, 2018
README.md Fix README.md Dec 4, 2018
setup.py Fix python -m shape_commentator Dec 4, 2018

README.md

Shape Commentator

About

You can easily add numpy.ndarray.shape information to your script as comments.

Installation

pip install shape_commentator

Usage

CLI

  1. Run this script as a module with argument of script name. Command line arguments to the target script are available.

python -m shape_commentator src.py

python -m shape_commentator src.py arg1 arg2

  1. You get the commented script. For example, you execute shape_commentator to src.py, you get src.py.commented.py. src
    src_commented

Jupyter

  1. Execute the cell that you want to see shape.
  2. Run the cell below, and the commented source code will be outputted.
import shape_commentator
shape_commentator.comment(In[len(In)-2],globals(),locals())

jupyter

Development

Test

python -m doctest shape_commentator.py