https://github.com/shiba6v/shape_commentator

多次元配列の属性情報を実行時に取得してコメントに書き足すツール

https://github.com/shiba6v/shape_commentator

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 3 committers (33.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.4%) to scientific vocabulary

Keywords

numpy python pytorch
Last synced: 6 months ago · JSON representation

Repository

多次元配列の属性情報を実行時に取得してコメントに書き足すツール

Basic Info
Statistics
  • Stars: 69
  • Watchers: 3
  • Forks: 2
  • Open Issues: 0
  • Releases: 0
Topics
numpy python pytorch
Created about 7 years ago · Last pushed almost 3 years ago
Metadata Files
Readme License

README-development.md

Other Usage

The main usage are described in README.md.

For Editor Extension Developers

Create Commented Script to Standard Output

By using shape_commentator.print_comment module, you get the commented script in standard output. (Not src.py.commented.py) bash python -m shape_commentator.print_comment src.py [args]

Clear Shape Comment

By using shape_commentator.print_clear module, you get the uncommented script in standard output. bash python -m shape_commentator.print_clear src.py [args]

For Jupyter Notebook User (deprecated)

This is a Jupyter Notebook extension of this tool. It is deprecated now. Please use IPython extension.

use_fig

IPython (Cell)

Create Commented Script

  1. Execute the cell that you want to see shape.
  2. Run the cell below, and the commented source code will be outputted. (In[len(In)-2] is the source code in the cell that you ran just before.)

python import shape_commentator shape_commentator.comment()
ipython_comment

Clear Shape Comment

python import shape_commentator shape_commentator.clear()
ipython_clear

Formatting comments used in Shape Commentator

This tool emits very long shape comment. python import shape_commentator.formatter as fmt code = [i for i in range(1000)] print(fmt.tuple_format(code))

output [int,int,int,int,int,int,int,int,int, ... ]

Development

Installation

pip install numpy sudo apt install bats sh tests/install_for_dev.sh

Sample

```

Module Mode

python -m shapecommentator tests/inputscripts/numpy_compute.py

Method Mode (Use in IPython / Jupyter Notebook.)

python tests/commentmethod.py tests/inputscripts/numpy_compute.py ```

Test

python -m doctest shape_commentator/shape_commentator.py sh tests/install_for_dev.sh bats tests/test_all.bats python setup.py develop --uninstall

Changing Test Scripts

Remove remove_tested_scripts in tests/test_all.bats and run bats tests/test_all.bats, and you get new test script in tests/input_scripts/

Try Master Branch

The package of shape_commentator in TestPyPI is the HEAD of master branch.
You can try newest (but under development) version by running commands below. pip uninstall -y shape-commentator pip install --index-url https://test.pypi.org/simple/ shape-commentator

Owner

  • Name: ShibaNyan
  • Login: shiba6v
  • Kind: user

Game Backend (Go) / Computer Vision / CAMPHOR-

GitHub Events

Total
Last Year

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 120
  • Total Committers: 3
  • Avg Commits per committer: 40.0
  • Development Distribution Score (DDS): 0.042
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
shiba6v s****v@g****m 115
Keisuke Shibata s****a@v****p 4
ShibaNyan k****a@l****p 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 4
  • Total pull requests: 43
  • Average time to close issues: over 1 year
  • Average time to close pull requests: 4 minutes
  • Total issue authors: 3
  • Total pull request authors: 1
  • Average comments per issue: 1.75
  • Average comments per pull request: 0.05
  • Merged pull requests: 43
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • shiba6v (2)
  • SeeLog (1)
  • masan4444 (1)
Pull Request Authors
  • shiba6v (43)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 29 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 21
  • Total maintainers: 1
pypi.org: shape-commentator

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

  • Versions: 21
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 29 Last month
Rankings
Stargazers count: 8.2%
Dependent packages count: 10.0%
Average: 18.1%
Dependent repos count: 21.7%
Forks count: 22.6%
Downloads: 27.9%
Maintainers (1)
Last synced: 6 months ago

Dependencies

setup.py pypi