stringcalc 0.1.0.dev17__tar.gz → 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- stringcalc-0.1.1/.gitignore +138 -0
- stringcalc-0.1.1/PKG-INFO +37 -0
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/README.md +4 -2
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/docs/api.rst +1 -0
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/docs/cli.rst +8 -0
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/docs/conf.py +3 -1
- stringcalc-0.1.1/docs/dev.md +40 -0
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/docs/examples/compare-data.md +108 -88
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/docs/examples/gauge-suggest.md +75 -75
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/docs/examples/pythagoras-ratios.md +57 -57
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/docs/examples/tension-plot.md +106 -106
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/docs/index.md +1 -0
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/docs/panel.rst +1 -1
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/docs/prior-art.md +53 -53
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/pyproject.toml +41 -12
- stringcalc-0.1.1/stringcalc/__init__.py +8 -0
- stringcalc-0.1.1/stringcalc/_version.py +24 -0
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/stringcalc/cli.py +3 -6
- stringcalc-0.1.1/stringcalc/data/daddario-stp.csv +611 -0
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/stringcalc/tension.py +40 -4
- stringcalc-0.1.0.dev17/.flake8 +0 -3
- stringcalc-0.1.0.dev17/.pre-commit-config.yaml +0 -34
- stringcalc-0.1.0.dev17/.readthedocs.yaml +0 -17
- stringcalc-0.1.0.dev17/PKG-INFO +0 -50
- stringcalc-0.1.0.dev17/stringcalc/__init__.py +0 -5
- stringcalc-0.1.0.dev17/stringcalc/util.py +0 -32
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/LICENSE +0 -0
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/docs/cli_gauge-suggest_tb23nw.svg +0 -0
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/docs/cli_gauge-suggest_tb23nw_d.svg +0 -0
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/stringcalc/data/__init__.py +0 -0
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/stringcalc/data/aquila-nng.csv +0 -0
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/stringcalc/data/daddario-tension.csv +0 -0
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/stringcalc/data/ghs.csv +0 -0
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/stringcalc/data/stringjoy.csv +0 -0
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/stringcalc/data/worth.csv +0 -0
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/stringcalc/frets.py +0 -0
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/stringcalc/py.typed +0 -0
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/tests/test_frets.py +0 -0
- {stringcalc-0.1.0.dev17 → stringcalc-0.1.1}/tests/test_string.py +0 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
data/tension_chart_13934.pdf
|
|
2
|
+
data/*.png
|
|
3
|
+
docs/api/
|
|
4
|
+
panel/app.html
|
|
5
|
+
_version.py
|
|
6
|
+
|
|
7
|
+
uv.lock
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Byte-compiled / optimized / DLL files
|
|
11
|
+
__pycache__/
|
|
12
|
+
*.py[cod]
|
|
13
|
+
*$py.class
|
|
14
|
+
|
|
15
|
+
# C extensions
|
|
16
|
+
*.so
|
|
17
|
+
|
|
18
|
+
# Distribution / packaging
|
|
19
|
+
.Python
|
|
20
|
+
build/
|
|
21
|
+
develop-eggs/
|
|
22
|
+
dist/
|
|
23
|
+
downloads/
|
|
24
|
+
eggs/
|
|
25
|
+
.eggs/
|
|
26
|
+
lib/
|
|
27
|
+
lib64/
|
|
28
|
+
parts/
|
|
29
|
+
sdist/
|
|
30
|
+
var/
|
|
31
|
+
wheels/
|
|
32
|
+
pip-wheel-metadata/
|
|
33
|
+
share/python-wheels/
|
|
34
|
+
*.egg-info/
|
|
35
|
+
.installed.cfg
|
|
36
|
+
*.egg
|
|
37
|
+
MANIFEST
|
|
38
|
+
|
|
39
|
+
# PyInstaller
|
|
40
|
+
# Usually these files are written by a python script from a template
|
|
41
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
42
|
+
*.manifest
|
|
43
|
+
*.spec
|
|
44
|
+
|
|
45
|
+
# Installer logs
|
|
46
|
+
pip-log.txt
|
|
47
|
+
pip-delete-this-directory.txt
|
|
48
|
+
|
|
49
|
+
# Unit test / coverage reports
|
|
50
|
+
htmlcov/
|
|
51
|
+
.tox/
|
|
52
|
+
.nox/
|
|
53
|
+
.coverage
|
|
54
|
+
.coverage.*
|
|
55
|
+
.cache
|
|
56
|
+
nosetests.xml
|
|
57
|
+
coverage.xml
|
|
58
|
+
*.cover
|
|
59
|
+
*.py,cover
|
|
60
|
+
.hypothesis/
|
|
61
|
+
.pytest_cache/
|
|
62
|
+
|
|
63
|
+
# Translations
|
|
64
|
+
*.mo
|
|
65
|
+
*.pot
|
|
66
|
+
|
|
67
|
+
# Django stuff:
|
|
68
|
+
*.log
|
|
69
|
+
local_settings.py
|
|
70
|
+
db.sqlite3
|
|
71
|
+
db.sqlite3-journal
|
|
72
|
+
|
|
73
|
+
# Flask stuff:
|
|
74
|
+
instance/
|
|
75
|
+
.webassets-cache
|
|
76
|
+
|
|
77
|
+
# Scrapy stuff:
|
|
78
|
+
.scrapy
|
|
79
|
+
|
|
80
|
+
# Sphinx documentation
|
|
81
|
+
docs/_build/
|
|
82
|
+
|
|
83
|
+
# PyBuilder
|
|
84
|
+
target/
|
|
85
|
+
|
|
86
|
+
# Jupyter Notebook
|
|
87
|
+
.ipynb_checkpoints
|
|
88
|
+
|
|
89
|
+
# IPython
|
|
90
|
+
profile_default/
|
|
91
|
+
ipython_config.py
|
|
92
|
+
|
|
93
|
+
# pyenv
|
|
94
|
+
.python-version
|
|
95
|
+
|
|
96
|
+
# pipenv
|
|
97
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
98
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
99
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
100
|
+
# install all needed dependencies.
|
|
101
|
+
#Pipfile.lock
|
|
102
|
+
|
|
103
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
|
104
|
+
__pypackages__/
|
|
105
|
+
|
|
106
|
+
# Celery stuff
|
|
107
|
+
celerybeat-schedule
|
|
108
|
+
celerybeat.pid
|
|
109
|
+
|
|
110
|
+
# SageMath parsed files
|
|
111
|
+
*.sage.py
|
|
112
|
+
|
|
113
|
+
# Environments
|
|
114
|
+
.env
|
|
115
|
+
.venv
|
|
116
|
+
env/
|
|
117
|
+
venv/
|
|
118
|
+
ENV/
|
|
119
|
+
env.bak/
|
|
120
|
+
venv.bak/
|
|
121
|
+
|
|
122
|
+
# Spyder project settings
|
|
123
|
+
.spyderproject
|
|
124
|
+
.spyproject
|
|
125
|
+
|
|
126
|
+
# Rope project settings
|
|
127
|
+
.ropeproject
|
|
128
|
+
|
|
129
|
+
# mkdocs documentation
|
|
130
|
+
/site
|
|
131
|
+
|
|
132
|
+
# mypy
|
|
133
|
+
.mypy_cache/
|
|
134
|
+
.dmypy.json
|
|
135
|
+
dmypy.json
|
|
136
|
+
|
|
137
|
+
# Pyre type checker
|
|
138
|
+
.pyre/
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: stringcalc
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Instrument string calculations
|
|
5
|
+
Project-URL: Home, https://github.com/zmoon/stringcalc
|
|
6
|
+
Project-URL: Source, https://github.com/zmoon/stringcalc
|
|
7
|
+
Project-URL: Documentation, https://stringcalc.readthedocs.io
|
|
8
|
+
Author-email: zmoon <zmoon92@gmail.com>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Requires-Python: <4,>=3.10
|
|
13
|
+
Requires-Dist: numpy>=1.21
|
|
14
|
+
Requires-Dist: pandas
|
|
15
|
+
Requires-Dist: pint>=0.22
|
|
16
|
+
Requires-Dist: pyabc2
|
|
17
|
+
Provides-Extra: cli
|
|
18
|
+
Requires-Dist: rich; extra == 'cli'
|
|
19
|
+
Requires-Dist: typer; extra == 'cli'
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# stringcalc
|
|
23
|
+
|
|
24
|
+
_Calculations for [string instrument](https://en.wikipedia.org/wiki/String_instrument)s' strings_
|
|
25
|
+
|
|
26
|
+
[](https://pypi.org/project/stringcalc/)
|
|
27
|
+
[](https://github.com/zmoon/stringcalc/actions/workflows/ci.yml)
|
|
28
|
+
[](https://stringcalc.readthedocs.io/en/latest/)
|
|
29
|
+
[](https://www.repostatus.org/#active)
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
stringcalc gauge --suggest -T 17 -L 23 -P G2 -P D3 -P A3 -P E4 -N 6 --type DA:LEW --type DA:LE --no-column-info
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
<img src="https://raw.githubusercontent.com/zmoon/stringcalc/refs/heads/main/docs/cli_gauge-suggest_tb23nw.svg"
|
|
36
|
+
alt="CLI gauge suggestion output for 23" TB for D'Addario loop-end nickel-wound strings"
|
|
37
|
+
width="550">
|
|
@@ -5,10 +5,12 @@ _Calculations for [string instrument](https://en.wikipedia.org/wiki/String_instr
|
|
|
5
5
|
[](https://pypi.org/project/stringcalc/)
|
|
6
6
|
[](https://github.com/zmoon/stringcalc/actions/workflows/ci.yml)
|
|
7
7
|
[](https://stringcalc.readthedocs.io/en/latest/)
|
|
8
|
-
[](https://www.repostatus.org/#active)
|
|
9
9
|
|
|
10
10
|
```sh
|
|
11
11
|
stringcalc gauge --suggest -T 17 -L 23 -P G2 -P D3 -P A3 -P E4 -N 6 --type DA:LEW --type DA:LE --no-column-info
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
<img src="
|
|
14
|
+
<img src="https://raw.githubusercontent.com/zmoon/stringcalc/refs/heads/main/docs/cli_gauge-suggest_tb23nw.svg"
|
|
15
|
+
alt="CLI gauge suggestion output for 23" TB for D'Addario loop-end nickel-wound strings"
|
|
16
|
+
width="550">
|
|
@@ -29,6 +29,7 @@ https://github.com/zmoon/stringcalc/tree/main/data.
|
|
|
29
29
|
stringcalc.tension.load_data
|
|
30
30
|
stringcalc.tension.load_aquila_data
|
|
31
31
|
stringcalc.tension.load_daddario_data
|
|
32
|
+
stringcalc.tension.load_daddario_stp_data
|
|
32
33
|
stringcalc.tension.load_ghs_data
|
|
33
34
|
stringcalc.tension.load_stringjoy_data
|
|
34
35
|
stringcalc.tension.load_worth_data
|
|
@@ -6,6 +6,14 @@ For example, ``stringcalc gauge --suggest`` can be used to suggest strings.
|
|
|
6
6
|
``-T``, ``-L``, ``-P`` (tension, scale length, pitch)
|
|
7
7
|
can be specified more than once to get results for multiple strings.
|
|
8
8
|
|
|
9
|
+
With `uv <https://docs.astral.sh/uv/>`__, you can install ``stringcalc`` globally with::
|
|
10
|
+
|
|
11
|
+
uv tool install stringcalc[cli]
|
|
12
|
+
|
|
13
|
+
or run it in an ephemeral environment with::
|
|
14
|
+
|
|
15
|
+
uvx stringcalc[cli]
|
|
16
|
+
|
|
9
17
|
.. click:: stringcalc.cli:_typer_click_object
|
|
10
18
|
:prog: stringcalc
|
|
11
19
|
:nested: full
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import stringcalc
|
|
2
2
|
|
|
3
3
|
project = "stringcalc"
|
|
4
|
-
copyright = "2022\
|
|
4
|
+
copyright = "2022\u20132026"
|
|
5
5
|
author = "zmoon"
|
|
6
6
|
|
|
7
7
|
version = stringcalc.__version__.split("+")[0]
|
|
@@ -54,6 +54,8 @@ html_theme_options = {
|
|
|
54
54
|
""",
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
html_static_path = ["_static"]
|
|
58
|
+
|
|
57
59
|
napoleon_google_docstring = False
|
|
58
60
|
napoleon_numpy_docstring = True
|
|
59
61
|
napoleon_preprocess_types = True
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Development
|
|
2
|
+
|
|
3
|
+
Using [uv](https://docs.astral.sh/uv/), prepare the venv:
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
uv sync --all-groups --all-extras
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Run the tests:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
uv run pytest
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Build the Panel app (for inclusion in the docs):
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
uv run panel convert panel/app.py --to pyodide --out docs/_static/panel/
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Build the docs:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
uv run sphinx-build docs docs/_build/html
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Check the version:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
uv run stringcalc --version
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
After adding a new annotated version tag,
|
|
34
|
+
you may need to touch one of the files
|
|
35
|
+
in order for uv/hatch to detect that a rebuild is needed,
|
|
36
|
+
or use:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
uv run --reinstall-package stringcalc stringcalc --version
|
|
40
|
+
```
|
|
@@ -1,88 +1,108 @@
|
|
|
1
|
-
---
|
|
2
|
-
file_format: mystnb
|
|
3
|
-
kernelspec:
|
|
4
|
-
name: python3
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Compare data
|
|
8
|
-
|
|
9
|
-
In this example, we compare data from different manufacturers
|
|
10
|
-
for
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
data
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
1
|
+
---
|
|
2
|
+
file_format: mystnb
|
|
3
|
+
kernelspec:
|
|
4
|
+
name: python3
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Compare data
|
|
8
|
+
|
|
9
|
+
In this example, we compare data from different manufacturers
|
|
10
|
+
for common ball-end string types:
|
|
11
|
+
|
|
12
|
+
- plain steel
|
|
13
|
+
- phosphor bronze
|
|
14
|
+
- nickel-wound
|
|
15
|
+
|
|
16
|
+
```{code-cell} ipython3
|
|
17
|
+
import pandas as pd
|
|
18
|
+
|
|
19
|
+
from stringcalc.tension import load_data
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
First we load all of the available data with the {func}`~stringcalc.tension.load_data` function.
|
|
23
|
+
|
|
24
|
+
```{code-cell} ipython3
|
|
25
|
+
data = load_data()
|
|
26
|
+
data
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Plain steel
|
|
30
|
+
|
|
31
|
+
Plain steel ball-end strings.
|
|
32
|
+
|
|
33
|
+
```{code-cell} ipython3
|
|
34
|
+
group_ids = ["DA:PL", "STP:PL", "GHS:PL", "SJ:PL"]
|
|
35
|
+
(
|
|
36
|
+
data.query("group_id in @group_ids")
|
|
37
|
+
.pivot_table(
|
|
38
|
+
index="gauge",
|
|
39
|
+
columns="group_id",
|
|
40
|
+
values=["uw"],
|
|
41
|
+
observed=True,
|
|
42
|
+
)
|
|
43
|
+
.mul(1000)
|
|
44
|
+
.style
|
|
45
|
+
.set_caption("Plain steel")
|
|
46
|
+
.background_gradient(axis=1, cmap="RdBu_r")
|
|
47
|
+
)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
```{note}
|
|
51
|
+
We multiplied `uw`, the unit weight (mass per unit length) [lbm/in]
|
|
52
|
+
by 1000 to facilitate easier comparison.
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```{note}
|
|
56
|
+
Within a given row, a red cell background indicates higher values and blue lower.
|
|
57
|
+
For example, Stringjoy plain steel strings are generally heavier than the others (red),
|
|
58
|
+
and D'Addario original and STP are always quite close (same color).
|
|
59
|
+
The lack of a number in a cell indicates that we don't have data for that gauge.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Phosphor bronze
|
|
63
|
+
|
|
64
|
+
Phosphor bronze ball-end strings.
|
|
65
|
+
|
|
66
|
+
```{code-cell} ipython3
|
|
67
|
+
group_ids = ["DA:PB", "STP:PB", "GHS:B", "SJ:PB"]
|
|
68
|
+
(
|
|
69
|
+
data.query("group_id in @group_ids")
|
|
70
|
+
.pivot_table(
|
|
71
|
+
index="gauge",
|
|
72
|
+
columns="group_id",
|
|
73
|
+
values=["uw"],
|
|
74
|
+
observed=True,
|
|
75
|
+
)
|
|
76
|
+
.mul(1000)
|
|
77
|
+
.style
|
|
78
|
+
.set_caption("Phosphor bronze")
|
|
79
|
+
.background_gradient(axis=1, cmap="RdBu_r")
|
|
80
|
+
)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Nickel-wound
|
|
84
|
+
|
|
85
|
+
Nickel-wound ball-end strings.
|
|
86
|
+
|
|
87
|
+
- `DA:NW` and `STP:NW`: D'Addario nickel-plated steel
|
|
88
|
+
- `GHS:N`: GHS Nickel Rockers (pure nickel, semi-flattened)
|
|
89
|
+
- `GHS:DY`: GHS Boomers (nickel-plated steel)
|
|
90
|
+
- `SJ:N`: Stringjoy nickel ("Signatures"; nickel-plated steel?)
|
|
91
|
+
- `SJ:PN`: Stringjoy pure nickel ("Broadways")
|
|
92
|
+
|
|
93
|
+
```{code-cell} ipython3
|
|
94
|
+
group_ids = ["DA:NW", "STP:NW", "GHS:N", "GHS:DY", "SJ:N", "SJ:PN"]
|
|
95
|
+
(
|
|
96
|
+
data.query("group_id in @group_ids")
|
|
97
|
+
.pivot_table(
|
|
98
|
+
index="gauge",
|
|
99
|
+
columns="group_id",
|
|
100
|
+
values=["uw"],
|
|
101
|
+
observed=True,
|
|
102
|
+
)
|
|
103
|
+
.mul(1000)
|
|
104
|
+
.style
|
|
105
|
+
.set_caption("Nickel-wound")
|
|
106
|
+
.background_gradient(axis=1, cmap="RdBu_r")
|
|
107
|
+
)
|
|
108
|
+
```
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
---
|
|
2
|
-
file_format: mystnb
|
|
3
|
-
kernelspec:
|
|
4
|
-
name: python3
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Gauge suggest
|
|
8
|
-
|
|
9
|
-
We can use the {doc}`/api` or the {doc}`/cli` to do this.
|
|
10
|
-
For example, consider this Irish tenor banjo situation
|
|
11
|
-
(also shown in [the GitHub README](https://github.com/zmoon/stringcalc/blob/main/README.md)):
|
|
12
|
-
|
|
13
|
-
- target tension: 17 lbf
|
|
14
|
-
- scale length: 23"
|
|
15
|
-
- tuning: G{sub}`2` D{sub}`3` A{sub}`3` E{sub}`4`
|
|
16
|
-
- string types: D'Addario loop-end nickel-wound and plain steel (`DA:LEW` and `DA:LE`)
|
|
17
|
-
|
|
18
|
-
## API
|
|
19
|
-
|
|
20
|
-
We use the function {func}`stringcalc.tension.suggest_gauge`.
|
|
21
|
-
|
|
22
|
-
```{code-cell} ipython3
|
|
23
|
-
:tags: [hide-output]
|
|
24
|
-
|
|
25
|
-
from stringcalc.tension import suggest_gauge
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
```{code-cell} ipython3
|
|
29
|
-
T = 17
|
|
30
|
-
L = 23
|
|
31
|
-
pitches = ["G2", "D3", "A3", "E4"]
|
|
32
|
-
types = {"DA:LEW", "DA:LE"}
|
|
33
|
-
|
|
34
|
-
for pitch in pitches:
|
|
35
|
-
df = suggest_gauge(T, L, pitch, types=types, n=6)
|
|
36
|
-
display(
|
|
37
|
-
df
|
|
38
|
-
.style
|
|
39
|
-
.set_caption(f'{pitch}, target T = {T} lbf')
|
|
40
|
-
.highlight_min(df.dT.abs().argmin())
|
|
41
|
-
)
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Most players would prefer a wound A string.
|
|
45
|
-
The 018w is probably a better choice than the 017p here, tone- and balance-wise,
|
|
46
|
-
even though it is farther from the target tension.
|
|
47
|
-
|
|
48
|
-
## CLI
|
|
49
|
-
|
|
50
|
-
On the command-line, we can do the same thing
|
|
51
|
-
with `stringcalc gauge --suggest`:
|
|
52
|
-
|
|
53
|
-
```sh
|
|
54
|
-
stringcalc gauge --suggest -T 17 -L 23 -P G2 -P D3 -P A3 -P E4 -N 6 --type DA:LEW --type DA:LE --no-column-info
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
```{image} ../cli_gauge-suggest_tb23nw.svg
|
|
58
|
-
:alt: CLI gauge suggestion output for 23" TB for D'Addario loop-end nickel-wound strings
|
|
59
|
-
:width: 550
|
|
60
|
-
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
`--no-column-info` suppresses the descriptions of the columns,
|
|
64
|
-
which currently are repeated for each boxed result.
|
|
65
|
-
For a single string query, it looks like this:
|
|
66
|
-
|
|
67
|
-
```sh
|
|
68
|
-
stringcalc gauge --suggest -T 17 -L 23 -P D3 --type DA:LEW
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
```{image} ../cli_gauge-suggest_tb23nw_d.svg
|
|
72
|
-
:alt: CLI gauge suggestion output for 23" TB D string using D'Addario loop-end nickel-wound strings
|
|
73
|
-
:width: 450
|
|
74
|
-
|
|
75
|
-
```
|
|
1
|
+
---
|
|
2
|
+
file_format: mystnb
|
|
3
|
+
kernelspec:
|
|
4
|
+
name: python3
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Gauge suggest
|
|
8
|
+
|
|
9
|
+
We can use the {doc}`/api` or the {doc}`/cli` to do this.
|
|
10
|
+
For example, consider this Irish tenor banjo situation
|
|
11
|
+
(also shown in [the GitHub README](https://github.com/zmoon/stringcalc/blob/main/README.md)):
|
|
12
|
+
|
|
13
|
+
- target tension: 17 lbf
|
|
14
|
+
- scale length: 23"
|
|
15
|
+
- tuning: G{sub}`2` D{sub}`3` A{sub}`3` E{sub}`4`
|
|
16
|
+
- string types: D'Addario loop-end nickel-wound and plain steel (`DA:LEW` and `DA:LE`)
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
We use the function {func}`stringcalc.tension.suggest_gauge`.
|
|
21
|
+
|
|
22
|
+
```{code-cell} ipython3
|
|
23
|
+
:tags: [hide-output]
|
|
24
|
+
|
|
25
|
+
from stringcalc.tension import suggest_gauge
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```{code-cell} ipython3
|
|
29
|
+
T = 17
|
|
30
|
+
L = 23
|
|
31
|
+
pitches = ["G2", "D3", "A3", "E4"]
|
|
32
|
+
types = {"DA:LEW", "DA:LE"}
|
|
33
|
+
|
|
34
|
+
for pitch in pitches:
|
|
35
|
+
df = suggest_gauge(T, L, pitch, types=types, n=6)
|
|
36
|
+
display(
|
|
37
|
+
df
|
|
38
|
+
.style
|
|
39
|
+
.set_caption(f'{pitch}, target T = {T} lbf')
|
|
40
|
+
.highlight_min(df.dT.abs().argmin())
|
|
41
|
+
)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Most players would prefer a wound A string.
|
|
45
|
+
The 018w is probably a better choice than the 017p here, tone- and balance-wise,
|
|
46
|
+
even though it is farther from the target tension.
|
|
47
|
+
|
|
48
|
+
## CLI
|
|
49
|
+
|
|
50
|
+
On the command-line, we can do the same thing
|
|
51
|
+
with `stringcalc gauge --suggest`:
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
stringcalc gauge --suggest -T 17 -L 23 -P G2 -P D3 -P A3 -P E4 -N 6 --type DA:LEW --type DA:LE --no-column-info
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```{image} ../cli_gauge-suggest_tb23nw.svg
|
|
58
|
+
:alt: CLI gauge suggestion output for 23" TB for D'Addario loop-end nickel-wound strings
|
|
59
|
+
:width: 550
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
`--no-column-info` suppresses the descriptions of the columns,
|
|
64
|
+
which currently are repeated for each boxed result.
|
|
65
|
+
For a single string query, it looks like this:
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
stringcalc gauge --suggest -T 17 -L 23 -P D3 --type DA:LEW
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
```{image} ../cli_gauge-suggest_tb23nw_d.svg
|
|
72
|
+
:alt: CLI gauge suggestion output for 23" TB D string using D'Addario loop-end nickel-wound strings
|
|
73
|
+
:width: 450
|
|
74
|
+
|
|
75
|
+
```
|