Skip to content

Commit e32567f

Browse files
authored
Python 3 refactor (#9)
* First pass * Just work my dude * Wheels? * I don't understand you * Do iiit * Maybe you could work tho * Will this work? * Gzzz * How about now? * Do iiit * Please * bleep * Exclude /docs/ from appveyor builds * exclude -> except * Updated meta.yaml for conda build
1 parent 03a4f84 commit e32567f

40 files changed

+9974
-2997
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,5 @@ dist/
105105
.pytest_cache/
106106
.ftpconfig
107107
.ftpignore
108-
.vscode/
108+
.vscode/
109+
version.py

.travis.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# v0.2.0
2+
3+
A considerable amount of refactoring occurred for this build, chiefly to get
4+
rid of Python 2.7 support. While the functionality did not change much for this
5+
version, we have switched from a `pkgutil`-style `pydrobert` namespace to
6+
PEP-420-style namespaces. As a result, *this package is not
7+
backwards-compatible with previous `pydrobert` packages!* Make sure that if any
8+
of the following are installed, they exceed the following version thresholds:
9+
10+
- `pydrobert-param >0.2.0`
11+
- `pydrobert-kaldi >0.5.3`
12+
- `pydrobert-pytorch >0.2.1`
13+
14+
Miscellaneous other stuff:
15+
16+
- Type hints everywhere
17+
- Shifted python source to `src/`
18+
- Black-formatted remaining source
19+
- Removed `future` dependency
20+
- Shifted most of the configuration to `setup.cfg`, leaving only a shell
21+
in `setup.py` to remain compatible with Conda builds
22+
- Added `pyproject.toml` for [PEP
23+
517](https://www.python.org/dev/peps/pep-0517/).
24+
- `tox.ini` for TOX testing
25+
- Switched to AppVeyor for CI
26+
- Messed around with documentation a little bit
27+
- Added changelog :D

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
[![Build Status](https://travis-ci.com/sdrobert/pydrobert-speech.svg?branch=master)](https://travis-ci.com/sdrobert/pydrobert-speech)
21
[![Documentation Status](https://readthedocs.org/projects/pydrobert-speech/badge/?version=latest)](https://pydrobert-speech.readthedocs.io/en/latest/?badge=latest)
2+
[![Build status](https://ci.appveyor.com/api/projects/status/abn39mww84fydxqe/branch/master?svg=true)](https://ci.appveyor.com/project/sdrobert/pydrobert-speech/branch/master)
33
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
44

55
# pydrobert-speech
@@ -36,7 +36,7 @@ feats = computer.compute_full(signal)
3636

3737
If you plan on using a [PyTorch](https://pytorch.org) `DataLoader` or Kaldi
3838
tables in your ASR pipeline, you can compute all a corpus' features by
39-
using the commmands `signals-to-torch-feat-dir` (requires *pytorch* package)
39+
using the commands `signals-to-torch-feat-dir` (requires *pytorch* package)
4040
or `compute-feats-from-kaldi-tables` (requires *pydrobert-kaldi* package).
4141

4242
This package can compute much more than f-banks, with many different

appveyor.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
version: build.{build}.branch.{branch}
2+
image: Visual Studio 2019
3+
4+
environment:
5+
matrix:
6+
- TOXENV: py36
7+
PYTHON: "C:\\Python36-x64"
8+
- TOXENV: py37
9+
PYTHON: "C:\\Python37-x64"
10+
- TOXENV: py38
11+
PYTHON: "C:\\Python38-x64"
12+
- TOXENV: py39
13+
PYTHON: "C:\\Python39-x64"
14+
15+
build: off
16+
17+
init:
18+
- cmd: set PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%
19+
20+
install:
21+
- python -m pip install -U pip tox wheel
22+
23+
test_script:
24+
- python -m tox
25+
26+
branches:
27+
except:
28+
- /docs/

docs/source/conf.py

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,21 @@
1313
import os
1414
import sys
1515

16-
sys.path.insert(0, os.path.abspath('../..'))
16+
sys.path.insert(0, os.path.abspath("../../src"))
1717

1818

19-
autodoc_mock_imports = [
20-
'numpy',
21-
]
19+
autodoc_mock_imports = ["numpy", "matplotlib"]
2220

2321
# -- Project information -----------------------------------------------------
2422

25-
project = 'pydrobert-speech'
26-
copyright = '2019, Sean Robertson'
27-
author = 'Sean Robertson'
23+
project = "pydrobert-speech"
24+
copyright = "2021, Sean Robertson"
25+
author = "Sean Robertson"
2826

2927
# The full version, including alpha/beta/rc tags
30-
release = '0.0.1'
28+
release = ""
3129

32-
language = 'en'
30+
language = "en"
3331

3432

3533
# -- General configuration ---------------------------------------------------
@@ -38,12 +36,23 @@
3836
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3937
# ones.
4038
extensions = [
41-
'sphinx.ext.autodoc',
42-
'sphinx.ext.napoleon',
39+
"sphinx.ext.autodoc",
40+
"sphinx.ext.autosectionlabel",
41+
"sphinx.ext.intersphinx",
42+
"sphinx.ext.napoleon",
43+
"sphinx.ext.viewcode",
4344
]
4445

46+
naploeon_numpy_docstring = True
47+
48+
intersphinx_mapping = {
49+
"python": ("https://docs.python.org/", None),
50+
"numpy": ("https://docs.scipy.org/doc/numpy/", None),
51+
"matplotlib": ("https://matplotlib.org", None),
52+
}
53+
4554
# Add any paths that contain templates here, relative to this directory.
46-
templates_path = ['_templates']
55+
templates_path = ["_templates"]
4756

4857
# List of patterns, relative to source directory, that match files and
4958
# directories to ignore when looking for source files.
@@ -53,19 +62,19 @@
5362

5463
# -- Options for HTML output -------------------------------------------------
5564

56-
on_rtd = os.environ.get('READTHEDOCS') == 'True'
65+
on_rtd = os.environ.get("READTHEDOCS") == "True"
5766
if on_rtd:
58-
html_theme = 'default'
67+
html_theme = "default"
5968
else:
60-
html_theme = 'nature'
69+
html_theme = "sphinx_rtd_theme"
6170

6271

6372
# Add any paths that contain custom static files (such as style sheets) here,
6473
# relative to this directory. They are copied after the builtin static files,
6574
# so a file named "default.css" will overwrite the builtin "default.css".
66-
html_static_path = ['_static']
75+
html_static_path = ["_static"]
6776

6877

69-
highlight_language = 'none'
78+
highlight_language = "none"
7079

71-
master_doc = 'index'
80+
master_doc = "index"

docs/source/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
:maxdepth: 2
33
:caption: Contents:
44

5-
.. include:: overview.rst
6-
7-
.. include:: modules.rst
5+
overview
6+
modules
7+
references
88

99
Indices and tables
1010
==================

docs/source/pydrobert.speech.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
pydrobert.speech package
22
========================
33

4-
Submodules
5-
----------
6-
7-
pydrobert.speech.command\_line module
4+
pydrobert.speech.command_line module
85
-------------------------------------
96

107
.. automodule:: pydrobert.speech.command_line

docs/source/references.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
References
2+
----------
3+
.. [stevens1937] S. S. Stevens, J. Volkmann, and E. B. Newman, "A Scale for the
4+
Measurement of the Psychological Magnitude Pitch," The Journal of the
5+
Acoustical Society of America, vol. 8, no. 3, pp. 185-190, 1937.
6+
.. [flanagan1960] J. L. Flanagan, "Models for approximating basilar membrane
7+
displacement," The Bell System Technical Journal, vol. 39, no. 5, pp.
8+
1163-1191, Sep. 1960.
9+
.. [zwicker1961] E. Zwicker, "Subdivision of the Audible Frequency Range into
10+
Critical Bands (Frequenzgruppen)," The Journal of the Acoustical Society of
11+
America, vol. 33, no. 2, pp. 248-248, 1961.
12+
.. [aertsen1981] A. M. H. J. Aertsen, J. H. J. Olders, and P. I. M. Johannesma,
13+
"Spectro-temporal receptive fields of auditory neurons in the grassfrog,"
14+
Biological Cybernetics, vol. 39, no. 3, pp. 195-209, Jan. 1981.
15+
.. [oshaughnessy1987] D. O'Shaughnessy, Speech communication: human and
16+
machine. Addison-Wesley Pub. Co., 1987.
17+
.. [tranmuller1990] H. Traunm\\:{u}ller, "Analytical expressions for the
18+
tonotopic sensory scale," The Journal of the Acoustical Society of America,
19+
vol. 88, no. 1, pp. 97-100, Jul. 1990.
20+
.. [povey2011] D. Povey et al., "The Kaldi Speech Recognition Toolkit," in
21+
IEEE 2011 Workshop on Automatic Speech Recognition and Understanding, Hilton
22+
Waikoloa Village, Big Island, Hawaii, US, 2011.
23+
.. [young] S. Young et al., "The HTK book (for HTK version 3.4)," Cambridge
24+
university engineering department, vol. 2, no. 2, pp. 2-3, 2006.

docs/source/requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)