Skip to content

Commit cc233bc

Browse files
committed
first
0 parents  commit cc233bc

File tree

8 files changed

+628
-0
lines changed

8 files changed

+628
-0
lines changed

.automation/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# .automation
2+
3+
This folder holds an automation script to visualize the progress.
4+
5+
## make_progress.py
6+
7+
This script uses GitHub Actions so that when a push to the repository is committed, it will complete the following:
8+
9+
- Checkout the source code
10+
- Update progress.png
11+
- Update progress.json

.automation/make_progress.py

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
"""Make progress chart of onolab members."""
2+
from pathlib import Path
3+
4+
import matplotlib.pyplot as plt
5+
import seaborn as sns
6+
import pandas as pd
7+
8+
9+
def get_progress():
10+
cwd = Path(".")
11+
data = {
12+
"user": [],
13+
"chapter": [],
14+
"progress": [],
15+
}
16+
users = list(
17+
filter(lambda x: x.is_dir() and x.name not in IGNORE, sorted(cwd.iterdir()))
18+
)
19+
20+
# user ごとの progress を取得する
21+
for user in users:
22+
for chap, max_cnt in zip(range(n_chapters), n_codes):
23+
# user/chapterXX の path (章だけ 1-indexed なので num+1)
24+
chapter_path = Path(user / f"chapter{chap+1:02d}")
25+
26+
# user/chapterXX に含まれる .py ファイルをカウント
27+
py_files = list(chapter_path.glob("q[0-9][0-9].py"))
28+
29+
# 問題数は max_cnt が上限で、それ以上のファイル数が含まれる場合は max_cnt にする
30+
n_solved = min(len(py_files), max_cnt)
31+
32+
data["user"] += [user]
33+
data["chapter"] += [chap + 1]
34+
data["progress"] += [n_solved / max_cnt]
35+
36+
return data
37+
38+
39+
def plot_progress(data):
40+
df = pd.DataFrame(data)
41+
42+
sns.set(style="white", context="notebook")
43+
sns.set_palette("hls", n_chapters)
44+
45+
g = sns.catplot(
46+
data=df,
47+
y="user",
48+
x="progress",
49+
hue="chapter",
50+
kind="bar",
51+
aspect=1.5,
52+
)
53+
g.set(xlim=(0, 1))
54+
g.despine(top=False, right=False)
55+
56+
plt.subplots_adjust(bottom=0.10)
57+
plt.savefig("progress.png")
58+
59+
60+
def main():
61+
data = get_progress()
62+
if len(list(data.keys())):
63+
plot_progress(data)
64+
65+
66+
if __name__ == "__main__":
67+
# 章数と各章の問題数
68+
n_chapters, n_codes = 10, [10 for _ in range(10)]
69+
70+
# progress bar に表示しないディレクトリ名
71+
IGNORE = [".git", ".github", ".automation"]
72+
73+
main()

.automation/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
numpy
2+
matplotlib
3+
seaborn

.github/workflows/update-progress.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Update-Progress
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- "ch**"
7+
8+
workflow_dispatch:
9+
inputs:
10+
purpose:
11+
description: "Purpose to manually run"
12+
required: true
13+
default: "test"
14+
15+
jobs:
16+
update:
17+
name: Update
18+
runs-on: ubuntu-latest
19+
env:
20+
FILE_NAME: "progress.png"
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v2
25+
26+
- name: Echo your purpose
27+
if: ${{ github.event.inputs.purpose != '' }}
28+
run: |
29+
echo "Purpose: ${{ github.event.inputs.purpose }}"
30+
31+
- name: Print Python info
32+
run: |
33+
echo "python --version: `python --version`"
34+
echo "python3 --version: `python3 --version`"
35+
36+
- name: Update ${{ env.FILE_NAME }}
37+
run: |
38+
python -m pip install -r .automation/requirements.txt
39+
python .automation/make_progress.py
40+
41+
- name: Configure your Git username/email
42+
run: |
43+
git config user.name ${NAME}
44+
git config user.email ${EMAIL}
45+
env:
46+
NAME: "taishi-n"
47+
48+
49+
- name: Commit ${{ env.FILE_NAME }}
50+
run: |
51+
git add $FILE_NAME
52+
git diff-index --quiet HEAD || git commit -m "bot: Update progress"
53+
git push

.gitignore

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
### https://raw.github.com/github/gitignore/e92f8db7a027af8cc25da2dc0758317e39697684/Python.gitignore
2+
3+
*.pdf
4+
*.wav
5+
6+
# Byte-compiled / optimized / DLL files
7+
__pycache__/
8+
*.py[cod]
9+
*$py.class
10+
11+
# C extensions
12+
*.so
13+
14+
# Distribution / packaging
15+
.Python
16+
build/
17+
develop-eggs/
18+
dist/
19+
downloads/
20+
eggs/
21+
.eggs/
22+
lib/
23+
lib64/
24+
parts/
25+
sdist/
26+
var/
27+
wheels/
28+
pip-wheel-metadata/
29+
share/python-wheels/
30+
*.egg-info/
31+
.installed.cfg
32+
*.egg
33+
MANIFEST
34+
35+
# PyInstaller
36+
# Usually these files are written by a python script from a template
37+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
38+
*.manifest
39+
*.spec
40+
41+
# Installer logs
42+
pip-log.txt
43+
pip-delete-this-directory.txt
44+
45+
# Unit test / coverage reports
46+
htmlcov/
47+
.tox/
48+
.nox/
49+
.coverage
50+
.coverage.*
51+
.cache
52+
nosetests.xml
53+
coverage.xml
54+
*.cover
55+
.hypothesis/
56+
.pytest_cache/
57+
58+
# Translations
59+
*.mo
60+
*.pot
61+
62+
# Django stuff:
63+
*.log
64+
local_settings.py
65+
db.sqlite3
66+
db.sqlite3-journal
67+
68+
# Flask stuff:
69+
instance/
70+
.webassets-cache
71+
72+
# Scrapy stuff:
73+
.scrapy
74+
75+
# Sphinx documentation
76+
docs/_build/
77+
78+
# PyBuilder
79+
target/
80+
81+
# Jupyter Notebook
82+
.ipynb_checkpoints
83+
84+
# IPython
85+
profile_default/
86+
ipython_config.py
87+
88+
# pyenv
89+
.python-version
90+
91+
# pipenv
92+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
94+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
95+
# install all needed dependencies.
96+
Pipfile.lock
97+
Pipfile
98+
99+
# celery beat schedule file
100+
celerybeat-schedule
101+
102+
# SageMath parsed files
103+
*.sage.py
104+
105+
# Environments
106+
.env
107+
.venv
108+
env/
109+
venv/
110+
ENV/
111+
env.bak/
112+
venv.bak/
113+
114+
# Spyder project settings
115+
.spyderproject
116+
.spyproject
117+
118+
# Rope project settings
119+
.ropeproject
120+
121+
# mkdocs documentation
122+
/site
123+
124+
# mypy
125+
.mypy_cache/
126+
.dmypy.json
127+
dmypy.json
128+
129+
# Pyre type checker
130+
.pyre/
131+
132+
# Pycharm temporary file
133+
.idea/
134+
135+
# macOS temporary file
136+
.DS_Store
137+
138+
# VSCode temporary file
139+
.vscode/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Ono Laboratory at Department of Computer Science, Graduate school of Systems Design, Tokyo Metropolitan University
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# 音響信号処理基礎勉強会
2+
3+
小野研新入生向けの音響信号処理勉強会
4+
5+
## 進め方
6+
7+
**現在検討中です.やりながら今後変わる可能性があります.**
8+
9+
- 1 時間で [演習問題](exercises.md) を解く
10+
- 残りの時間で github にアップロード・レビューを行う
11+
12+
## 使い方
13+
14+
1. このレポジトリを fork する
15+
2. fork したレポジトリを clone する
16+
```
17+
$ git clone https://github.com/<user_name>/morise-asa.git
18+
```
19+
`<user_name>` の部分は各自のユーザー名に置き換えてください
20+
3. 新しいブランチを作る
21+
ブランチ名は `<ユーザー名>/<章>` としてください.
22+
例:中嶋が 1 章のコードを追加するとき → `tnakashima/chapter01`
23+
```
24+
$ git branch <user_name>/chapter<XX>
25+
```
26+
4. コードを書く
27+
ファイル名は `chapter<章番号>/q<問題番号>.py` とし,**章番号・問題番号は 1 始まりの 2 桁**に揃えてください.
28+
例:1 章の 1 個目 → `chapter01/q01.py`
29+
5. 新しく書いたコードを git の管理対象に追加する
30+
```
31+
$ git add ./<user_name>/chpaterXX/qYY.py
32+
```
33+
6. 変更を記録する
34+
コミットメッセージは「○ 章を追加」などわかりやすい文章にしてください.
35+
```
36+
$ git commit -m 'your message'
37+
```
38+
7. Remote repository の変更を pull する
39+
```
40+
$ git pull
41+
```
42+
8. Remote repository に push する
43+
このとき, `<user_name>/chapter<XX>` は 2. で作成したブランチ名にしてください
44+
```
45+
$ git push origin <user_name>/chapter<XX>
46+
```
47+
9. GitHub 上で pull request を作成する
48+
49+
## 注意事項
50+
51+
- わからないところは **積極的** に RA か研究室の人に聞いてください.
52+
- **他の人のディレクトリを変更しないでください.**
53+
- 他の人のコードを閲覧したい場合は、Web サイト上から閲覧してください.
54+
- フォルダ名,ファイル名を間違えると進捗グラフに反映されません.
55+
56+
## 進捗状況
57+
58+
![progress](progress.png)
59+
60+
## 謝辞
61+
62+
[小町研究室](https://github.com/tmu-nlp)のいくつかのリポジトリを参考にしました.

0 commit comments

Comments
 (0)