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
Repository
多次元配列の属性情報を実行時に取得してコメントに書き足すツール
Basic Info
- Host: GitHub
- Owner: shiba6v
- License: mit
- Language: Python
- Default Branch: master
- Homepage: https://pypi.org/project/shape-commentator
- Size: 93.8 KB
Statistics
- Stars: 69
- Watchers: 3
- Forks: 2
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
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.

IPython (Cell)
Create Commented Script
- Execute the cell that you want to see shape.
- 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()
Clear Shape Comment
python
import shape_commentator
shape_commentator.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
- Twitter: _6v_
- Repositories: 30
- Profile: https://github.com/shiba6v
Game Backend (Go) / Computer Vision / CAMPHOR-
GitHub Events
Total
Last Year
Committers
Last synced: over 1 year ago
Top Committers
| Name | 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.
- Homepage: https://github.com/shiba6v/shape_commentator
- Documentation: https://shape-commentator.readthedocs.io/
- License: MIT
-
Latest release: 0.8.0
published almost 3 years ago