{"id":15546745,"url":"https://github.com/shiba6v/shape_commentator","last_synced_at":"2025-10-10T09:13:01.802Z","repository":{"id":57466606,"uuid":"160149447","full_name":"shiba6v/shape_commentator","owner":"shiba6v","description":"多次元配列の属性情報を実行時に取得してコメントに書き足すツール","archived":false,"fork":false,"pushed_at":"2023-05-28T12:47:32.000Z","size":96,"stargazers_count":68,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T04:30:37.349Z","etag":null,"topics":["numpy","python","pytorch"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/shape-commentator","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shiba6v.png","metadata":{"files":{"readme":"README-development.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-03T07:25:14.000Z","updated_at":"2023-05-26T06:55:02.000Z","dependencies_parsed_at":"2024-10-21T20:21:55.017Z","dependency_job_id":null,"html_url":"https://github.com/shiba6v/shape_commentator","commit_stats":{"total_commits":120,"total_committers":3,"mean_commits":40.0,"dds":0.04166666666666663,"last_synced_commit":"8d3fce9c9786882457f07f2e2614373bb6f791f2"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiba6v%2Fshape_commentator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiba6v%2Fshape_commentator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiba6v%2Fshape_commentator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiba6v%2Fshape_commentator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shiba6v","download_url":"https://codeload.github.com/shiba6v/shape_commentator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248814409,"owners_count":21165762,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["numpy","python","pytorch"],"created_at":"2024-10-02T13:04:11.067Z","updated_at":"2025-10-10T09:12:56.758Z","avatar_url":"https://github.com/shiba6v.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Other Usage  \nThe main usage are described in `README.md`.\n\n### For Editor Extension Developers\n#### Create Commented Script to Standard Output\nBy using `shape_commentator.print_comment` module, you get the commented script in standard output. (Not `src.py.commented.py`)\n```bash\npython -m shape_commentator.print_comment src.py [args]\n```\n\n#### Clear Shape Comment\nBy using `shape_commentator.print_clear` module, you get the uncommented script in standard output.\n```bash\npython -m shape_commentator.print_clear src.py [args]\n```\n\n### For Jupyter Notebook User (deprecated)\n[This](https://github.com/shiba6v/jupyter-shape-commentator) is a Jupyter Notebook extension of this tool. \nIt is deprecated now. Please use IPython extension.\n\n![use_fig](https://user-images.githubusercontent.com/13820488/61187795-fcf6d300-a6b0-11e9-97c6-4fd029244839.png)\n\n### IPython (Cell)\n#### Create Commented Script\n1. Execute the cell that you want to see shape.  \n2. 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.)\n\n```python\nimport shape_commentator\nshape_commentator.comment()\n```  \n![ipython_comment](https://user-images.githubusercontent.com/13820488/50559871-1ac8a000-0d3e-11e9-923e-997f6aac6d68.png)  \n\n#### Clear Shape Comment\n```python\nimport shape_commentator\nshape_commentator.clear()\n```  \n![ipython_clear](https://user-images.githubusercontent.com/13820488/50559879-37fd6e80-0d3e-11e9-8c06-7f6963396dcb.png)  \n\n### Formatting comments used in Shape Commentator\nThis tool emits very long shape comment.\n```python\nimport shape_commentator.formatter as fmt\ncode = [i for i in range(1000)]\nprint(fmt.tuple_format(code))\n```\n\noutput\n```\n[int,int,int,int,int,int,int,int,int, ... ]\n```\n\n## Development  \n### Installation\n```\npip install numpy\nsudo apt install bats\nsh tests/install_for_dev.sh\n```\n\n### Sample\n```\n# Module Mode\npython -m shape_commentator tests/input_scripts/numpy_compute.py\n# Method Mode (Use in IPython / Jupyter Notebook.)\npython tests/comment_method.py tests/input_scripts/numpy_compute.py \n```\n\n### Test  \n```\npython -m doctest shape_commentator/shape_commentator.py\nsh tests/install_for_dev.sh\nbats tests/test_all.bats\npython setup.py develop --uninstall\n```\n\n### Changing Test Scripts\nRemove `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/`\n\n### Try Master Branch\nThe package of shape_commentator in TestPyPI is the HEAD of master branch.  \nYou can try newest (but under development) version by running commands below.\n```\npip uninstall -y shape-commentator\npip install --index-url https://test.pypi.org/simple/ shape-commentator\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiba6v%2Fshape_commentator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshiba6v%2Fshape_commentator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiba6v%2Fshape_commentator/lists"}