Skip to content

Commit

Permalink
Merge pull request #75 from sp-nitech/format
Browse files Browse the repository at this point in the history
Format
  • Loading branch information
takenori-y committed Jun 17, 2024
2 parents d80de27 + dee78ed commit 096f950
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
torch: 1.11.0
torchaudio: 0.11.0
- python: 3.12
torch: 2.3.0
torchaudio: 2.3.0
torch: 2.3.1
torchaudio: 2.3.1

steps:
- name: Clone
Expand Down
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,19 @@ doc-clean:

check: tool
. ./venv/bin/activate && python -m ruff check $(PROJECT) tests
. ./venv/bin/activate && python -m ruff format --check $(PROJECT) tests
. ./venv/bin/activate && python -m ruff format --check $(PROJECT) tests docs
. ./venv/bin/activate && python -m isort --check $(PROJECT) tests
. ./venv/bin/activate && python -m mdformat --check README.md
./tools/taplo/taplo fmt --check pyproject.toml
./tools/yamlfmt/yamlfmt --lint *.yml .github/workflows/*.yml
./tools/yamlfmt/yamlfmt --lint *.cff *.yml .github/workflows/*.yml

format: tool
. ./venv/bin/activate && python -m ruff check --fix $(PROJECT) tests
. ./venv/bin/activate && python -m ruff format $(PROJECT) tests
. ./venv/bin/activate && python -m ruff format $(PROJECT) tests docs
. ./venv/bin/activate && python -m isort $(PROJECT) tests
. ./venv/bin/activate && python -m mdformat README.md
./tools/taplo/taplo fmt pyproject.toml
./tools/yamlfmt/yamlfmt *.yml .github/workflows/*.yml
./tools/yamlfmt/yamlfmt *.cff *.yml .github/workflows/*.yml

test: tool
[ -n "$(MODULE)" ] && module=tests/test_$(MODULE).py || module=; \
Expand Down
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
diffsptk
========
# diffsptk

*diffsptk* is a differentiable version of [SPTK](https://github.com/sp-nitech/SPTK) based on the PyTorch framework.

[![Latest Manual](https://img.shields.io/badge/docs-latest-blue.svg)](https://sp-nitech.github.io/diffsptk/latest/)
[![Stable Manual](https://img.shields.io/badge/docs-stable-blue.svg)](https://sp-nitech.github.io/diffsptk/2.0.1/)
[![Downloads](https://static.pepy.tech/badge/diffsptk)](https://pepy.tech/project/diffsptk)
[![Python Version](https://img.shields.io/pypi/pyversions/diffsptk.svg)](https://pypi.python.org/pypi/diffsptk)
[![PyTorch Version](https://img.shields.io/badge/pytorch-1.11.0%20%7C%202.3.0-orange.svg)](https://pypi.python.org/pypi/diffsptk)
[![PyTorch Version](https://img.shields.io/badge/pytorch-1.11.0%20%7C%202.3.1-orange.svg)](https://pypi.python.org/pypi/diffsptk)
[![PyPI Version](https://img.shields.io/pypi/v/diffsptk.svg)](https://pypi.python.org/pypi/diffsptk)
[![Codecov](https://codecov.io/gh/sp-nitech/diffsptk/branch/master/graph/badge.svg)](https://app.codecov.io/gh/sp-nitech/diffsptk)
[![License](https://img.shields.io/github/license/sp-nitech/diffsptk.svg)](https://github.com/sp-nitech/diffsptk/blob/master/LICENSE)
[![GitHub Actions](https://github.com/sp-nitech/diffsptk/workflows/package/badge.svg)](https://github.com/sp-nitech/diffsptk/actions)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

## Requirements

Requirements
------------
- Python 3.8+
- PyTorch 1.11.0+

## Documentation

Documentation
-------------
- See [this page](https://sp-nitech.github.io/diffsptk/latest/) for a reference manual.
- Our [paper](https://www.isca-speech.org/archive/ssw_2023/yoshimura23_ssw.html) is available on the ISCA Archive.

## Installation

Installation
------------
The latest stable release can be installed through PyPI by running

```sh
pip install diffsptk
```

The development release can be installed from the master branch:

```sh
pip install git+https://github.com/sp-nitech/diffsptk.git@master
```

## Examples

Examples
--------
### Mel-cepstral analysis and synthesis

```python
import diffsptk

Expand Down Expand Up @@ -91,6 +91,7 @@ diffsptk.write("unvoiced.wav", x_unvoiced, sr)
```

### Mel-spectrogram, MFCC, and PLP extraction

```python
import diffsptk

Expand Down Expand Up @@ -138,6 +139,7 @@ print(Y.shape)
```

### Subband decomposition

```python
import diffsptk

Expand Down Expand Up @@ -166,6 +168,7 @@ print(error)
```

### Constant-Q transform

```python
import diffsptk
import librosa # This is to get sample audio.
Expand Down Expand Up @@ -194,6 +197,7 @@ print(error)
```

### Vector quantization

```python
import diffsptk

Expand All @@ -212,14 +216,12 @@ error = (x_hat - x).abs().sum()
print(error)
```

## License

License
-------
This software is released under the Apache License 2.0.

## Citation

Citation
--------
```bibtex
@InProceedings{sp-nitech2023sptk,
author = {Takenori Yoshimura and Takato Fujimoto and Keiichiro Oura and Keiichi Tokuda},
Expand Down
23 changes: 14 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))

sys.path.insert(0, os.path.abspath(".."))


# -- Project information -----------------------------------------------------

project = 'diffsptk'
copyright = '2022, SPTK Working Group'
author = 'SPTK Working Group'
project = "diffsptk"
copyright = "2022, SPTK Working Group"
author = "SPTK Working Group"
exec(open(f"../{project}/version.py").read())
version = __version__
release = __version__
Expand All @@ -31,9 +32,9 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'numpydoc',
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"numpydoc",
]

# Add any paths that contain templates here, relative to this directory.
Expand All @@ -42,15 +43,19 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = [
"_build",
"Thumbs.db",
".DS_Store",
]


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'pydata_sphinx_theme'
html_theme = "pydata_sphinx_theme"

# Disable navigation with keys.
html_theme_options = {"navigation_with_keys": False}
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,22 @@ classifiers = [
"Programming Language :: Python :: 3 :: Only",
]
dependencies = [
"numpy < 2.0.0",
"librosa >= 0.10.1",
"soundfile >= 0.10.2",
"torch >= 1.11.0",
"torchaudio >= 0.11.0",
"torchcrepe >= 0.0.21",
"torchlpc >= 0.2.0",
"vector-quantize-pytorch >= 0.8.0, <= 1.12.12",
"numpy",
]
dynamic = ["version"]

[project.optional-dependencies]
dev = [
"build",
"isort",
"mdformat",
"numpydoc",
"pydata-sphinx-theme",
"pytest",
Expand Down

0 comments on commit 096f950

Please sign in to comment.