From 377f25fc83dc5b8e8fcf9ff7bbe0d86d5997f541 Mon Sep 17 00:00:00 2001 From: James Bradbury Date: Tue, 8 Feb 2022 21:54:42 +0000 Subject: [PATCH 1/6] add default transformer cases for cce_seealso --- flucoma/doc/transformers.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/flucoma/doc/transformers.py b/flucoma/doc/transformers.py index 40bd30a..bf7eb5b 100644 --- a/flucoma/doc/transformers.py +++ b/flucoma/doc/transformers.py @@ -36,7 +36,19 @@ def default_transform(object_name, data): data['discussion'] = data.pop('discussion','') data['seealso'] = [x for x in tidy_split(data.pop('see-also',''))] - + + try: + data['max_seealso'] = data['max-seealso'].split(',') + except (KeyError, AttributeError): + data['max_seealso'] = [''] + print(f'WARNING: No "max-seealso" for {object_name}. Inserting blank placeholder') + + try: + data['pd_seealso'] = data['pd-seealso'].split(',') + except (KeyError, AttributeError): + data['pd_seealso'] = [''] + print(f'WARNING: No "pd-seealso" for {object_name}. Inserting blank placeholder') + data['parameters'].append({ 'name':'warnings', 'constraints': {'max': 1, 'min': 0}, From b9a3e17bc18773b3c24b6567d3f692fb7c1939ee Mon Sep 17 00:00:00 2001 From: James Bradbury Date: Tue, 8 Feb 2022 21:54:50 +0000 Subject: [PATCH 2/6] add data so that it renders in the templates --- flucoma/doc/templates/maxref.xml | 3 +++ flucoma/doc/templates/pd_htmlref.html | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/flucoma/doc/templates/maxref.xml b/flucoma/doc/templates/maxref.xml index 50c7689..571397c 100644 --- a/flucoma/doc/templates/maxref.xml +++ b/flucoma/doc/templates/maxref.xml @@ -164,5 +164,8 @@ under the European Union’s Horizon 2020 research and innovation programme {% for s in seealso %} {% endfor %} + {% for s in max_seealso %} + + {% endfor %} diff --git a/flucoma/doc/templates/pd_htmlref.html b/flucoma/doc/templates/pd_htmlref.html index e8466e0..210f8ed 100644 --- a/flucoma/doc/templates/pd_htmlref.html +++ b/flucoma/doc/templates/pd_htmlref.html @@ -137,6 +137,10 @@

See Also

{%-for s in seealso -%}

{{ s }}

{%- endfor -%} + + {%-for s in pd_seealso -%} +

{{ s }}

+ {%- endfor -%} From 239fd9181286fee0bbc098de9318559923e10b66 Mon Sep 17 00:00:00 2001 From: James Bradbury Date: Tue, 8 Feb 2022 21:55:51 +0000 Subject: [PATCH 3/6] added {pd/max}_seealso example for Pitch.yaml --- doc/Pitch.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/Pitch.yaml b/doc/Pitch.yaml index 98413ab..2a83d14 100644 --- a/doc/Pitch.yaml +++ b/doc/Pitch.yaml @@ -11,6 +11,8 @@ species: descriptor sc-categories: Libraries>FluidDecomposition sc-related: Guides/FluidCorpusManipulationToolkit, Classes/Pitch see-also: BufPitch, MFCC, MelBands, Loudness, SpectralShape +max-seealso: fzero~, retune~ +pd-seealso: sigmund~ description: Three popular pitch descriptors, computed as frequency and the confidence in its value. discussion: The process will return a multichannel control steam with [pitch, confidence] values, which will be repeated if no change happens within the algorithm, i.e. when the hopSize is larger than the signal vector size. A pitch of 0 Hz is yield (or -999.0 when the unit is in MIDI note) when the algorithm cannot find a fundamental at all. process: The audio rate in, control rate out version of the object. From df785416c7cedbb855347848ea19916604b4b486 Mon Sep 17 00:00:00 2001 From: James Bradbury Date: Wed, 9 Feb 2022 00:28:03 +0000 Subject: [PATCH 4/6] simplify transformer --- flucoma/doc/transformers.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/flucoma/doc/transformers.py b/flucoma/doc/transformers.py index bf7eb5b..5b4707b 100644 --- a/flucoma/doc/transformers.py +++ b/flucoma/doc/transformers.py @@ -6,6 +6,8 @@ # under the European Union’s Horizon 2020 research and innovation programme # (grant agreement No 725899). +import logging +from flucoma.doc import logger from collections import OrderedDict """ @@ -37,17 +39,12 @@ def default_transform(object_name, data): data['seealso'] = [x for x in tidy_split(data.pop('see-also',''))] - try: - data['max_seealso'] = data['max-seealso'].split(',') - except (KeyError, AttributeError): - data['max_seealso'] = [''] - print(f'WARNING: No "max-seealso" for {object_name}. Inserting blank placeholder') - - try: - data['pd_seealso'] = data['pd-seealso'].split(',') - except (KeyError, AttributeError): - data['pd_seealso'] = [''] - print(f'WARNING: No "pd-seealso" for {object_name}. Inserting blank placeholder') + with logger.add_context([object_name]): + for k in ['max-seealso', 'pd-seealso']: + if k in data: + data[k.replace('-', '_')] = [x.strip() for x in data.get(k, '').split(',')] + else: + logging.warning(f"No {k} entry") data['parameters'].append({ 'name':'warnings', From ad7983781227af522d4409357ee75ea40d44c2e0 Mon Sep 17 00:00:00 2001 From: James Bradbury Date: Wed, 9 Feb 2022 00:29:37 +0000 Subject: [PATCH 5/6] remove from pd_seealso --- flucoma/doc/templates/pd_htmlref.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flucoma/doc/templates/pd_htmlref.html b/flucoma/doc/templates/pd_htmlref.html index 210f8ed..10ca662 100644 --- a/flucoma/doc/templates/pd_htmlref.html +++ b/flucoma/doc/templates/pd_htmlref.html @@ -139,7 +139,7 @@

{{ s }}{{ s }}

+

{{ s }}

{%- endfor -%} From 30038f15e1f85ed5669442247ce78cbfee745d67 Mon Sep 17 00:00:00 2001 From: James Bradbury Date: Thu, 10 Feb 2022 12:24:10 +0000 Subject: [PATCH 6/6] Revert "added {pd/max}_seealso example for Pitch.yaml" This reverts commit 239fd9181286fee0bbc098de9318559923e10b66. --- doc/Pitch.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/Pitch.yaml b/doc/Pitch.yaml index 2a83d14..98413ab 100644 --- a/doc/Pitch.yaml +++ b/doc/Pitch.yaml @@ -11,8 +11,6 @@ species: descriptor sc-categories: Libraries>FluidDecomposition sc-related: Guides/FluidCorpusManipulationToolkit, Classes/Pitch see-also: BufPitch, MFCC, MelBands, Loudness, SpectralShape -max-seealso: fzero~, retune~ -pd-seealso: sigmund~ description: Three popular pitch descriptors, computed as frequency and the confidence in its value. discussion: The process will return a multichannel control steam with [pitch, confidence] values, which will be repeated if no change happens within the algorithm, i.e. when the hopSize is larger than the signal vector size. A pitch of 0 Hz is yield (or -999.0 when the unit is in MIDI note) when the algorithm cannot find a fundamental at all. process: The audio rate in, control rate out version of the object.