Skip to content

Commit 4863093

Browse files
authored
Merge pull request #20 from DCMLab/develop
merge new version (0.4.0) from develop
2 parents 1d4c297 + 7c6118f commit 4863093

39 files changed

+5390
-1988
lines changed

.github/workflows/test_develop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
python-version: [3.6, 3.7, 3.8, 3.9]
19+
python-version: ["3.7", "3.8", "3.9", "3.10"]
2020

2121
steps:
2222
- uses: actions/checkout@v2

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python-version: [3.6, 3.7, 3.8, 3.9]
18+
python-version: ["3.7", "3.8", "3.9", "3.10"]
1919

2020
steps:
2121
- uses: actions/checkout@v2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ instance/
7070

7171
# Sphinx documentation
7272
docs/_build/
73+
docs/_autosummary/
7374

7475
# PyBuilder
7576
target/

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Changes
2+
3+
## v0.4.0
4+
5+
### new features
6+
7+
- implement spelled array types
8+
- vectorized operations (using numpy)
9+
- supports array interface (indexing, iteration, etc.)
10+
- add one-hot encoding/decoding for all spelled types
11+
12+
### breaking changes
13+
14+
- update definition of "direction" on spelled types
15+
- now altered unisons have a direction (except the perfect unison) for spelled types
16+
- `d1:0` is now normalized to `-a1:0` (because `d1:0` is considered downward)
17+
- compliant with the other libraries
18+
- remove `generic` and `diatonic_steps` from spelled pitch types
19+
- both don't make sense (conceptually) for pitches
20+
- potentially leak the underlying interval representation
21+
- only degree is meaningful for pitches
22+
23+
### improvements
24+
25+
- better docstring formatting (parameters and return values)
26+
27+
### bug fixes
28+
29+
- implement ordering for spelled types in a consistent way
30+
- add docs
31+
- fixes bug where `Cb-1 > C-1` was true
32+
33+
## v0.3.0
34+
35+
first version that is compliant with the other libraries

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ For other (and mostly compatible) implementations see:
2020

2121
The main goals of this library are:
2222

23-
- providing types and operations (such as arithmetics, printing and parsing) for common types of pitches and intervals
23+
- providing types and operations (such as arithmetics, printing and parsing) for common types of pitches and intervals,
24+
(in particular spelled pitches and intervals, which are often difficult to handle),
2425
- providing a generic interface for writing code that is agnostic to the specific pitch or interval types.
2526

2627
## Installation
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{{ fullname | escape | underline}}
2+
3+
.. currentmodule:: {{ module }}
4+
5+
.. autoclass:: {{ objname }}
6+
:members:
7+
:show-inheritance:
8+
:inherited-members:
9+
:special-members:
10+
:exclude-members: __init__
11+
12+
{% block methods %}
13+
.. automethod:: __init__
14+
15+
{% if methods %}
16+
.. rubric:: {{ _('Methods') }}
17+
18+
.. autosummary::
19+
{% for item in methods %}
20+
~{{ name }}.{{ item }}
21+
{%- endfor %}
22+
{% endif %}
23+
{% endblock %}
24+
25+
{% block attributes %}
26+
{% if attributes %}
27+
.. rubric:: {{ _('Attributes') }}
28+
29+
.. autosummary::
30+
{% for item in attributes %}
31+
~{{ name }}.{{ item }}
32+
{%- endfor %}
33+
{% endif %}
34+
{% endblock %}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{{ fullname | escape | underline}}
2+
3+
.. automodule:: {{ fullname }}
4+
5+
{% block attributes %}
6+
{% if attributes %}
7+
.. rubric:: Module Attributes
8+
9+
.. autosummary::
10+
:toctree:
11+
{% for item in attributes %}
12+
{{ item }}
13+
{%- endfor %}
14+
{% endif %}
15+
{% endblock %}
16+
17+
{% block functions %}
18+
{% if functions %}
19+
.. rubric:: {{ _('Functions') }}
20+
21+
.. autosummary::
22+
:toctree:
23+
{% for item in functions %}
24+
{{ item }}
25+
{%- endfor %}
26+
{% endif %}
27+
{% endblock %}
28+
29+
{% block classes %}
30+
{% if classes %}
31+
.. rubric:: {{ _('Classes') }}
32+
33+
.. autosummary::
34+
:toctree:
35+
:template: custom-class-template.rst
36+
{% for item in classes %}
37+
{{ item }}
38+
{%- endfor %}
39+
{% endif %}
40+
{% endblock %}
41+
42+
{% block exceptions %}
43+
{% if exceptions %}
44+
.. rubric:: {{ _('Exceptions') }}
45+
46+
.. autosummary::
47+
:toctree:
48+
{% for item in exceptions %}
49+
{{ item }}
50+
{%- endfor %}
51+
{% endif %}
52+
{% endblock %}
53+
54+
{% block modules %}
55+
{% if modules %}
56+
.. rubric:: Modules
57+
58+
.. autosummary::
59+
:toctree:
60+
:template: custom-module-template.rst
61+
:recursive:
62+
{% for item in modules %}
63+
{{ item }}
64+
{%- endfor %}
65+
{% endif %}
66+
{% endblock %}

docs/api_summary.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
API Summary
2+
=====================
3+
4+
5+
.. autosummary::
6+
:toctree: _autosummary
7+
:template: custom-module-template.rst
8+
:recursive:
9+
10+
pitchtypes

docs/conf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
'myst_parser',
3232
'sphinx.ext.autodoc',
3333
'sphinx.ext.doctest',
34+
'sphinx.ext.autosummary',
35+
'sphinx_autodoc_typehints',
3436
]
3537

3638
# Add any paths that contain templates here, relative to this directory.
@@ -53,3 +55,6 @@
5355
# relative to this directory. They are copied after the builtin static files,
5456
# so a file named "default.css" will overwrite the builtin "default.css".
5557
html_static_path = ['_static']
58+
59+
# sort class members by type
60+
# autodoc_member_order = 'bysource'

docs/index.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ Welcome to pitchtypes's documentation!
1212

1313
introduction
1414
types/spelled
15+
types/spelled_array
1516
types/enharmonic
1617
types/frequencies
1718
types/harmonic
19+
api_summary
1820

1921

2022
A library for **handling musical pitches and intervals in a systematic way**.
@@ -29,15 +31,15 @@ Arithmetics
2931
-----------
3032

3133
You can, for instance, compute the interval class between a B♭ and an F♯,
32-
which is an augmented fifth
34+
which is an augmented fifth:
3335

3436
.. doctest::
3537

3638
>>> import pitchtypes as pt
3739
>>> pt.SpelledPitchClass("F#") - pt.SpelledPitchClass("Bb")
3840
a5
3941

40-
and do all the standard arithmetic operations.
42+
You can also perform all sensible arithmetic operations on intervals and pitches.
4143

4244
Generic Interface
4345
-----------------

0 commit comments

Comments
 (0)