From b08dcb779ec72554bf69a88366fbbca28a263463 Mon Sep 17 00:00:00 2001 From: JoFrhwld Date: Sat, 18 May 2024 18:34:08 -0400 Subject: [PATCH] sprucing up docs --- docs/.gitignore | 5 +- docs/_quarto.yml | 14 +- docs/objects.py | 17 ++ docs/reference/_sidebar.yml | 29 ---- ...ave_recode.relations.contains_relation.qmd | 24 --- .../fave_recode.relations.equals_relation.qmd | 18 --- ...ave_recode.relations.excludes_relation.qmd | 18 --- .../fave_recode.relations.in_relation.qmd | 23 --- .../fave_recode.relations.negate.qmd | 30 ---- .../fave_recode.relations.not_in_relation.qmd | 24 --- ...ve_recode.relations.rematches_relation.qmd | 18 --- docs/reference/index.qmd | 43 ----- .../labelset_parser.LabelSetParser.qmd | 75 --------- ...belset_parser.LabelSetParserProperties.qmd | 36 ----- docs/reference/relations.equals_relation.qmd | 18 --- docs/reference/relations.in_relation.qmd | 23 --- .../relations.not_equals_relation.qmd | 18 --- docs/reference/relations.not_in_relation.qmd | 24 --- docs/reference/relations.qmd | 149 ------------------ .../relations.rematches_relation.qmd | 18 --- .../relations.reunmatches_relation.qmd | 18 --- docs/reference/rule_classes.Condition.qmd | 56 ------- docs/reference/rule_classes.Rule.qmd | 62 -------- docs/reference/rule_classes.RuleSet.qmd | 75 --------- 24 files changed, 31 insertions(+), 804 deletions(-) create mode 100644 docs/objects.py delete mode 100644 docs/reference/_sidebar.yml delete mode 100644 docs/reference/fave_recode.relations.contains_relation.qmd delete mode 100644 docs/reference/fave_recode.relations.equals_relation.qmd delete mode 100644 docs/reference/fave_recode.relations.excludes_relation.qmd delete mode 100644 docs/reference/fave_recode.relations.in_relation.qmd delete mode 100644 docs/reference/fave_recode.relations.negate.qmd delete mode 100644 docs/reference/fave_recode.relations.not_in_relation.qmd delete mode 100644 docs/reference/fave_recode.relations.rematches_relation.qmd delete mode 100644 docs/reference/index.qmd delete mode 100644 docs/reference/labelset_parser.LabelSetParser.qmd delete mode 100644 docs/reference/labelset_parser.LabelSetParserProperties.qmd delete mode 100644 docs/reference/relations.equals_relation.qmd delete mode 100644 docs/reference/relations.in_relation.qmd delete mode 100644 docs/reference/relations.not_equals_relation.qmd delete mode 100644 docs/reference/relations.not_in_relation.qmd delete mode 100644 docs/reference/relations.qmd delete mode 100644 docs/reference/relations.rematches_relation.qmd delete mode 100644 docs/reference/relations.reunmatches_relation.qmd delete mode 100644 docs/reference/rule_classes.Condition.qmd delete mode 100644 docs/reference/rule_classes.Rule.qmd delete mode 100644 docs/reference/rule_classes.RuleSet.qmd diff --git a/docs/.gitignore b/docs/.gitignore index 92d902f..0d3a9e4 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1,2 +1,5 @@ /.quarto/ -_site/ \ No newline at end of file +_site/ +_inv/ +objects.txt +reference/ \ No newline at end of file diff --git a/docs/_quarto.yml b/docs/_quarto.yml index 30e51fe..663f4bb 100644 --- a/docs/_quarto.yml +++ b/docs/_quarto.yml @@ -3,6 +3,7 @@ project: output-dir: _site website: + title: fave-recode page-navigation: true image: assets/logo.png favicon: assets/logo.png @@ -47,8 +48,7 @@ format: dark: [darkly, styles/dark.scss] css: styles/styles.css toc: true - filters: - - codeblocklabel + # tell quarto to read the generated sidebar metadata-files: @@ -56,14 +56,20 @@ metadata-files: filters: - "interlinks" + - codeblocklabel interlinks: + fast: true sources: + numpy: + url: https://numpy.org/doc/stable/ python: url: https://docs.python.org/3/ - griffe: - url: https://mkdocstrings.github.io/griffe/ + aligned_textgrid: + url: https://forced-alignment-and-vowel-extraction.github.io/alignedTextGrid/ +resources: + - objects.inv quartodoc: # the name used to import the package you want to create reference docs for diff --git a/docs/objects.py b/docs/objects.py new file mode 100644 index 0000000..c8f0ba4 --- /dev/null +++ b/docs/objects.py @@ -0,0 +1,17 @@ +import fave_recode +import sphobjinv as soi +from pathlib import Path +inv = soi.Inventory(fname_plain = Path("objects.txt")) + +for idx in range(len(inv.objects)): + obj = inv.objects[idx] + basename = obj.name.split(".")[-1] + if hasattr(fave_recode, basename): + obj_dict = obj.json_dict() + obj_dict["name"] = "fave_recode." + basename + new_obj = soi.DataObjStr(**obj_dict) + inv.objects.append(new_obj) + +df = inv.data_file() +dfc = soi.compress(df) +soi.writebytes("objects.inv", dfc) \ No newline at end of file diff --git a/docs/reference/_sidebar.yml b/docs/reference/_sidebar.yml deleted file mode 100644 index eba87de..0000000 --- a/docs/reference/_sidebar.yml +++ /dev/null @@ -1,29 +0,0 @@ -website: - sidebar: - - contents: - - reference/index.qmd - - contents: - - reference/rule_classes.Condition.qmd - - reference/rule_classes.Rule.qmd - - reference/rule_classes.RuleSet.qmd - section: Rule Classes - - contents: - - reference/labelset_parser.LabelSetParser.qmd - - reference/labelset_parser.LabelSetParserProperties.qmd - section: Label Set Parsers - - contents: - - contents: - - reference/relations.in_relation.qmd - - reference/relations.not_in_relation.qmd - section: '`in`, `not in`' - - contents: - - reference/relations.equals_relation.qmd - - reference/relations.not_equals_relation.qmd - section: equals, not equals - - contents: - - reference/relations.rematches_relation.qmd - - reference/relations.reunmatches_relation.qmd - section: Regex match - section: Relations - id: reference - - id: dummy-sidebar diff --git a/docs/reference/fave_recode.relations.contains_relation.qmd b/docs/reference/fave_recode.relations.contains_relation.qmd deleted file mode 100644 index cfadac6..0000000 --- a/docs/reference/fave_recode.relations.contains_relation.qmd +++ /dev/null @@ -1,24 +0,0 @@ -# contains_relation { #fave_recode.relations.contains_relation } - -`relations.contains_relation(lhs, rhs)` - -Does `lhs` contain `rhs`? - -```{python} -from fave_recode.relations import contains_relation - -contains_relation('xyz', 'x') -``` - -## Parameters - -| Name | Type | Description | Default | -|--------|---------------------|--------------------------------------|------------| -| `lhs` | [Any](`typing.Any`) | left hand side (must work with `in`) | _required_ | -| `rhs` | [Any](`typing.Any`) | right hand side | _required_ | - -## Returns - -| Type | Description | -|----------------|-------------------| -| [bool](`bool`) | `True` or `False` | \ No newline at end of file diff --git a/docs/reference/fave_recode.relations.equals_relation.qmd b/docs/reference/fave_recode.relations.equals_relation.qmd deleted file mode 100644 index ad3e322..0000000 --- a/docs/reference/fave_recode.relations.equals_relation.qmd +++ /dev/null @@ -1,18 +0,0 @@ -# equals_relation { #fave_recode.relations.equals_relation } - -`relations.equals_relation(lhs, rhs)` - -Is lhs `==` to `rhs` - -## Parameters - -| Name | Type | Description | Default | -|--------|---------------------|-----------------|------------| -| `lhs` | [Any](`typing.Any`) | left hand side | _required_ | -| `rhs` | [Any](`typing.Any`) | right hand side | _required_ | - -## Returns - -| Type | Description | -|----------------|---------------| -| [bool](`bool`) | _description_ | \ No newline at end of file diff --git a/docs/reference/fave_recode.relations.excludes_relation.qmd b/docs/reference/fave_recode.relations.excludes_relation.qmd deleted file mode 100644 index 5e532b0..0000000 --- a/docs/reference/fave_recode.relations.excludes_relation.qmd +++ /dev/null @@ -1,18 +0,0 @@ -# excludes_relation { #fave_recode.relations.excludes_relation } - -`relations.excludes_relation(lhs, rhs)` - -Does `lhs` *not* contain `rhs` - -## Parameters - -| Name | Type | Description | Default | -|--------|---------------------|--------------------------------------|------------| -| `lhs` | [Any](`typing.Any`) | left hand side (must work with `in`) | _required_ | -| `rhs` | [Any](`typing.Any`) | right handnside | _required_ | - -## Returns - -| Type | Description | -|----------------|---------------| -| [bool](`bool`) | True or False | \ No newline at end of file diff --git a/docs/reference/fave_recode.relations.in_relation.qmd b/docs/reference/fave_recode.relations.in_relation.qmd deleted file mode 100644 index fbb3e86..0000000 --- a/docs/reference/fave_recode.relations.in_relation.qmd +++ /dev/null @@ -1,23 +0,0 @@ -# in_relation { #fave_recode.relations.in_relation } - -`relations.in_relation(lhs, rhs)` - -Is `lhs` in `rhs`? - -```{python} -from fave_recode.relations import in_relation -in_relation('x', 'xyz') -``` - -## Parameters - -| Name | Type | Description | Default | -|--------|---------------------|----------------------------------------------|------------| -| `lhs` | [Any](`typing.Any`) | left hand side object | _required_ | -| `rhs` | [Any](`typing.Any`) | right hand side object (must work with `in`) | _required_ | - -## Returns - -| Type | Description | -|----------------|-------------------| -| [bool](`bool`) | `True` or `False` | \ No newline at end of file diff --git a/docs/reference/fave_recode.relations.negate.qmd b/docs/reference/fave_recode.relations.negate.qmd deleted file mode 100644 index 596f148..0000000 --- a/docs/reference/fave_recode.relations.negate.qmd +++ /dev/null @@ -1,30 +0,0 @@ -# negate { #fave_recode.relations.negate } - -`relations.negate(f)` - -Negate a function - -Given a function `f()` that returns a boolean, this will -return `g() = not f()` - -```{python} -from fave_recode.relations import negate - -def f(): - return True - -g = negate(f) -g() -``` - -## Parameters - -| Name | Type | Description | Default | -|--------|----------------------------------------|-----------------------------------|------------| -| `f` | [Callable](`collections.abc.Callable`) | A function that returns a boolean | _required_ | - -## Returns - -| Type | Description | -|----------------------------------------|---------------| -| [Callable](`collections.abc.Callable`) | not f() | \ No newline at end of file diff --git a/docs/reference/fave_recode.relations.not_in_relation.qmd b/docs/reference/fave_recode.relations.not_in_relation.qmd deleted file mode 100644 index b4d4d6b..0000000 --- a/docs/reference/fave_recode.relations.not_in_relation.qmd +++ /dev/null @@ -1,24 +0,0 @@ -# not_in_relation { #fave_recode.relations.not_in_relation } - -`relations.not_in_relation(lhs, rhs)` - -Is `lhs` *not* in `rhs` - -```{python} -from fave_recode.relations import not_in_relation - -not_in_relation('x', 'xyz') -``` - -## Parameters - -| Name | Type | Description | Default | -|--------|---------------------|---------------------------------------|------------| -| `lhs` | [Any](`typing.Any`) | left hand side | _required_ | -| `rhs` | [Any](`typing.Any`) | right hand side (must work with `in`) | _required_ | - -## Returns - -| Type | Description | -|----------------|-------------------| -| [bool](`bool`) | `True` or `False` | \ No newline at end of file diff --git a/docs/reference/fave_recode.relations.rematches_relation.qmd b/docs/reference/fave_recode.relations.rematches_relation.qmd deleted file mode 100644 index c15cda7..0000000 --- a/docs/reference/fave_recode.relations.rematches_relation.qmd +++ /dev/null @@ -1,18 +0,0 @@ -# rematches_relation { #fave_recode.relations.rematches_relation } - -`relations.rematches_relation(lhs, rhs)` - -_summary_ - -## Parameters - -| Name | Type | Description | Default | -|--------|--------------|---------------|------------| -| `lhs` | [str](`str`) | _description_ | _required_ | -| `rhs` | [str](`str`) | _description_ | _required_ | - -## Returns - -| Type | Description | -|----------------|---------------| -| [bool](`bool`) | _description_ | \ No newline at end of file diff --git a/docs/reference/index.qmd b/docs/reference/index.qmd deleted file mode 100644 index c9ff83d..0000000 --- a/docs/reference/index.qmd +++ /dev/null @@ -1,43 +0,0 @@ -# Function reference - -## Rule Classes - -Rule application classes - -| | | -| --- | --- | -| [rule_classes.Condition](rule_classes.Condition.qmd#fave_recode.rule_classes.Condition) | _A rule condition_ | -| [rule_classes.Rule](rule_classes.Rule.qmd#fave_recode.rule_classes.Rule) | _A rule class_ | -| [rule_classes.RuleSet](rule_classes.RuleSet.qmd#fave_recode.rule_classes.RuleSet) | A rule set class | - -## Label Set Parsers - -Label set parsers - -| | | -| --- | --- | -| [labelset_parser.LabelSetParser](labelset_parser.LabelSetParser.qmd#fave_recode.labelset_parser.LabelSetParser) | A labelset parser object | -| [labelset_parser.LabelSetParserProperties](labelset_parser.LabelSetParserProperties.qmd#fave_recode.labelset_parser.LabelSetParserProperties) | A property of the labelset, including rules that | - -## Relations - -### `in`, `not in` - -| | | -| --- | --- | -| [relations.in_relation](relations.in_relation.qmd#fave_recode.relations.in_relation) | Is `lhs` in `rhs`? | -| [relations.not_in_relation](relations.not_in_relation.qmd#fave_recode.relations.not_in_relation) | Is `lhs` *not* in `rhs` | - -### equals, not equals - -| | | -| --- | --- | -| [relations.equals_relation](relations.equals_relation.qmd#fave_recode.relations.equals_relation) | Is lhs `==` to `rhs` | -| [relations.not_equals_relation](relations.not_equals_relation.qmd#fave_recode.relations.not_equals_relation) | is lhs *not* `==` rhs | - -### Regex match - -| | | -| --- | --- | -| [relations.rematches_relation](relations.rematches_relation.qmd#fave_recode.relations.rematches_relation) | Does the lhs match a regex for rhs? | -| [relations.reunmatches_relation](relations.reunmatches_relation.qmd#fave_recode.relations.reunmatches_relation) | Does the lhs *not* match a regex for the rhs | \ No newline at end of file diff --git a/docs/reference/labelset_parser.LabelSetParser.qmd b/docs/reference/labelset_parser.LabelSetParser.qmd deleted file mode 100644 index 5881348..0000000 --- a/docs/reference/labelset_parser.LabelSetParser.qmd +++ /dev/null @@ -1,75 +0,0 @@ -# labelset_parser.LabelSetParser { #fave_recode.labelset_parser.LabelSetParser } - -`labelset_parser.LabelSetParser(self, parser=None, parser_path=None)` - -A labelset parser object - -## Parameters - -| Name | Type | Description | Default | -|---------------|------------------------|-------------------------------------------------------------------|-----------| -| `parser` | [dict](`dict`) | A dictionary defining the parser rules. Defaults to None. | `None` | -| `parser_path` | [Path](`pathlib.Path`) | A path to a yaml file definition of the parser. Defaults to None. | `None` | - -## Methods - -| Name | Description | -| --- | --- | -| [apply_parser](#fave_recode.labelset_parser.LabelSetParser.apply_parser) | Apply the parser to a single interval | -| [map_parser](#fave_recode.labelset_parser.LabelSetParser.map_parser) | Map the parser to an entire sequence tier. | -| [read_parser](#fave_recode.labelset_parser.LabelSetParser.read_parser) | Read in a yaml file defining the parser | -| [validate_parser](#fave_recode.labelset_parser.LabelSetParser.validate_parser) | Validate wellformedness of parser | - -### apply_parser { #fave_recode.labelset_parser.LabelSetParser.apply_parser } - -`labelset_parser.LabelSetParser.apply_parser(obj)` - -Apply the parser to a single interval - -#### Parameters - -| Name | Type | Description | Default | -|--------|-----------------------------------------------------------------------------|--------------------|------------| -| `obj` | [SequenceInterval](`aligned_textgrid.sequences.sequences.SequenceInterval`) | A SequenceInterval | _required_ | - -### map_parser { #fave_recode.labelset_parser.LabelSetParser.map_parser } - -`labelset_parser.LabelSetParser.map_parser(obj)` - -Map the parser to an entire sequence tier. - -#### Parameters - -| Name | Type | Description | Default | -|--------|-----------------------------------------------------------------|----------------|------------| -| `obj` | [SequenceTier](`aligned_textgrid.sequences.tiers.SequenceTier`) | A SequenceTier | _required_ | - -### read_parser { #fave_recode.labelset_parser.LabelSetParser.read_parser } - -`labelset_parser.LabelSetParser.read_parser(path)` - -Read in a yaml file defining the parser - -#### Parameters - -| Name | Type | Description | Default | -|--------|------------------------|-----------------------------------|------------| -| `path` | [Path](`pathlib.Path`) | Path to the yaml file definition. | _required_ | - -### validate_parser { #fave_recode.labelset_parser.LabelSetParser.validate_parser } - -`labelset_parser.LabelSetParser.validate_parser(parser)` - -Validate wellformedness of parser - -#### Parameters - -| Name | Type | Description | Default | -|----------|----------------|-------------------|------------| -| `parser` | [dict](`dict`) | parser dictionary | _required_ | - -#### Raises - -| Type | Description | -|--------------------------|------------------------------------| -| [Exception](`Exception`) | Any errors raised by the validator | \ No newline at end of file diff --git a/docs/reference/labelset_parser.LabelSetParserProperties.qmd b/docs/reference/labelset_parser.LabelSetParserProperties.qmd deleted file mode 100644 index fd4f7a2..0000000 --- a/docs/reference/labelset_parser.LabelSetParserProperties.qmd +++ /dev/null @@ -1,36 +0,0 @@ -# labelset_parser.LabelSetParserProperties { #fave_recode.labelset_parser.LabelSetParserProperties } - -`labelset_parser.LabelSetParserProperties(self, property=None)` - -A property of the labelset, including rules that -ought to be applied and the SequenceInterval property to update. - -## Parameters - -| Name | Type | Description | Default | -|------------|----------------|-------------------------------------------------------|-----------| -| `property` | [dict](`dict`) | A dictionary defining the property. Defaults to None. | `None` | - -## Methods - -| Name | Description | -| --- | --- | -| [validate_property](#fave_recode.labelset_parser.LabelSetParserProperties.validate_property) | Validate wellformedness of parser property | - -### validate_property { #fave_recode.labelset_parser.LabelSetParserProperties.validate_property } - -`labelset_parser.LabelSetParserProperties.validate_property(property)` - -Validate wellformedness of parser property - -#### Parameters - -| Name | Type | Description | Default | -|----------|----------------|---------------------|------------| -| `parser` | [dict](`dict`) | property dictionary | _required_ | - -#### Raises - -| Type | Description | -|--------------------------|------------------------------------| -| [Exception](`Exception`) | Any errors raised by the validator | \ No newline at end of file diff --git a/docs/reference/relations.equals_relation.qmd b/docs/reference/relations.equals_relation.qmd deleted file mode 100644 index 42f26ff..0000000 --- a/docs/reference/relations.equals_relation.qmd +++ /dev/null @@ -1,18 +0,0 @@ -# relations.equals_relation { #fave_recode.relations.equals_relation } - -`relations.equals_relation(lhs, rhs)` - -Is lhs `==` to `rhs` - -## Parameters - -| Name | Type | Description | Default | -|--------|---------------------|-----------------|------------| -| `lhs` | [Any](`typing.Any`) | left hand side | _required_ | -| `rhs` | [Any](`typing.Any`) | right hand side | _required_ | - -## Returns - -| Type | Description | -|----------------|---------------| -| [bool](`bool`) | True or False | \ No newline at end of file diff --git a/docs/reference/relations.in_relation.qmd b/docs/reference/relations.in_relation.qmd deleted file mode 100644 index c19d856..0000000 --- a/docs/reference/relations.in_relation.qmd +++ /dev/null @@ -1,23 +0,0 @@ -# relations.in_relation { #fave_recode.relations.in_relation } - -`relations.in_relation(lhs, rhs)` - -Is `lhs` in `rhs`? - -```{python} -from fave_recode.relations import in_relation -in_relation('x', 'xyz') -``` - -## Parameters - -| Name | Type | Description | Default | -|--------|---------------------|----------------------------------------------|------------| -| `lhs` | [Any](`typing.Any`) | left hand side object | _required_ | -| `rhs` | [Any](`typing.Any`) | right hand side object (must work with `in`) | _required_ | - -## Returns - -| Type | Description | -|----------------|-------------------| -| [bool](`bool`) | `True` or `False` | \ No newline at end of file diff --git a/docs/reference/relations.not_equals_relation.qmd b/docs/reference/relations.not_equals_relation.qmd deleted file mode 100644 index 9d7aeaa..0000000 --- a/docs/reference/relations.not_equals_relation.qmd +++ /dev/null @@ -1,18 +0,0 @@ -# relations.not_equals_relation { #fave_recode.relations.not_equals_relation } - -`relations.not_equals_relation(lhs, rhs)` - -is lhs *not* `==` rhs - -## Parameters - -| Name | Type | Description | Default | -|--------|---------------------|-----------------|------------| -| `lhs` | [Any](`typing.Any`) | left hand side | _required_ | -| `rhs` | [any](`any`) | right hand side | _required_ | - -## Returns - -| Type | Description | -|----------------|---------------| -| [bool](`bool`) | True or False | \ No newline at end of file diff --git a/docs/reference/relations.not_in_relation.qmd b/docs/reference/relations.not_in_relation.qmd deleted file mode 100644 index 1fdeced..0000000 --- a/docs/reference/relations.not_in_relation.qmd +++ /dev/null @@ -1,24 +0,0 @@ -# relations.not_in_relation { #fave_recode.relations.not_in_relation } - -`relations.not_in_relation(lhs, rhs)` - -Is `lhs` *not* in `rhs` - -```{python} -from fave_recode.relations import not_in_relation - -not_in_relation('x', 'xyz') -``` - -## Parameters - -| Name | Type | Description | Default | -|--------|---------------------|---------------------------------------|------------| -| `lhs` | [Any](`typing.Any`) | left hand side | _required_ | -| `rhs` | [Any](`typing.Any`) | right hand side (must work with `in`) | _required_ | - -## Returns - -| Type | Description | -|----------------|-------------------| -| [bool](`bool`) | `True` or `False` | \ No newline at end of file diff --git a/docs/reference/relations.qmd b/docs/reference/relations.qmd deleted file mode 100644 index ff81006..0000000 --- a/docs/reference/relations.qmd +++ /dev/null @@ -1,149 +0,0 @@ -# relations { #fave_recode.relations } - -`relations` - -Functions defining Boolean relations between -`lhs` (the rule conditions `attribute`) and the -`rhs` (the rule condition `set1`) - -## Functions - -| Name | Description | -| --- | --- | -| [contains_relation](#fave_recode.relations.contains_relation) | Does `lhs` contain `rhs`? | -| [equals_relation](#fave_recode.relations.equals_relation) | Is lhs `==` to `rhs` | -| [excludes_relation](#fave_recode.relations.excludes_relation) | Does `lhs` *not* contain `rhs` | -| [in_relation](#fave_recode.relations.in_relation) | Is `lhs` in `rhs`? | -| [not_in_relation](#fave_recode.relations.not_in_relation) | Is `lhs` *not* in `rhs` | -| [rematches_relation](#fave_recode.relations.rematches_relation) | _summary_ | - -## contains_relation { #fave_recode.relations.contains_relation } - -`relations.contains_relation(lhs, rhs)` - -Does `lhs` contain `rhs`? - -```{python} -from fave_recode.relations import contains_relation - -contains_relation('xyz', 'x') -``` - -### Parameters - -| Name | Type | Description | Default | -|--------|---------------------|--------------------------------------|------------| -| `lhs` | [Any](`typing.Any`) | left hand side (must work with `in`) | _required_ | -| `rhs` | [Any](`typing.Any`) | right hand side | _required_ | - -### Returns - -| Type | Description | -|----------------|-------------------| -| [bool](`bool`) | `True` or `False` | - -## equals_relation { #fave_recode.relations.equals_relation } - -`relations.equals_relation(lhs, rhs)` - -Is lhs `==` to `rhs` - -### Parameters - -| Name | Type | Description | Default | -|--------|---------------------|-----------------|------------| -| `lhs` | [Any](`typing.Any`) | left hand side | _required_ | -| `rhs` | [Any](`typing.Any`) | right hand side | _required_ | - -### Returns - -| Type | Description | -|----------------|---------------| -| [bool](`bool`) | _description_ | - -## excludes_relation { #fave_recode.relations.excludes_relation } - -`relations.excludes_relation(lhs, rhs)` - -Does `lhs` *not* contain `rhs` - -### Parameters - -| Name | Type | Description | Default | -|--------|---------------------|--------------------------------------|------------| -| `lhs` | [Any](`typing.Any`) | left hand side (must work with `in`) | _required_ | -| `rhs` | [Any](`typing.Any`) | right handnside | _required_ | - -### Returns - -| Type | Description | -|----------------|---------------| -| [bool](`bool`) | True or False | - -## in_relation { #fave_recode.relations.in_relation } - -`relations.in_relation(lhs, rhs)` - -Is `lhs` in `rhs`? - -```{python} -from fave_recode.relations import in_relation -in_relation('x', 'xyz') -``` - -### Parameters - -| Name | Type | Description | Default | -|--------|---------------------|----------------------------------------------|------------| -| `lhs` | [Any](`typing.Any`) | left hand side object | _required_ | -| `rhs` | [Any](`typing.Any`) | right hand side object (must work with `in`) | _required_ | - -### Returns - -| Type | Description | -|----------------|-------------------| -| [bool](`bool`) | `True` or `False` | - -## not_in_relation { #fave_recode.relations.not_in_relation } - -`relations.not_in_relation(lhs, rhs)` - -Is `lhs` *not* in `rhs` - -```{python} -from fave_recode.relations import not_in_relation - -not_in_relation('x', 'xyz') -``` - -### Parameters - -| Name | Type | Description | Default | -|--------|---------------------|---------------------------------------|------------| -| `lhs` | [Any](`typing.Any`) | left hand side | _required_ | -| `rhs` | [Any](`typing.Any`) | right hand side (must work with `in`) | _required_ | - -### Returns - -| Type | Description | -|----------------|-------------------| -| [bool](`bool`) | `True` or `False` | - -## rematches_relation { #fave_recode.relations.rematches_relation } - -`relations.rematches_relation(lhs, rhs)` - -_summary_ - -### Parameters - -| Name | Type | Description | Default | -|--------|--------------|---------------|------------| -| `lhs` | [str](`str`) | _description_ | _required_ | -| `rhs` | [str](`str`) | _description_ | _required_ | - -### Returns - -| Type | Description | -|----------------|---------------| -| [bool](`bool`) | _description_ | \ No newline at end of file diff --git a/docs/reference/relations.rematches_relation.qmd b/docs/reference/relations.rematches_relation.qmd deleted file mode 100644 index 3228a3f..0000000 --- a/docs/reference/relations.rematches_relation.qmd +++ /dev/null @@ -1,18 +0,0 @@ -# relations.rematches_relation { #fave_recode.relations.rematches_relation } - -`relations.rematches_relation(lhs, rhs)` - -Does the lhs match a regex for rhs? - -## Parameters - -| Name | Type | Description | Default | -|--------|--------------|----------------------------------------|------------| -| `lhs` | [str](`str`) | left hand side | _required_ | -| `rhs` | [str](`str`) | right hand side (must be valid regex.) | _required_ | - -## Returns - -| Type | Description | -|----------------|---------------| -| [bool](`bool`) | True or False | \ No newline at end of file diff --git a/docs/reference/relations.reunmatches_relation.qmd b/docs/reference/relations.reunmatches_relation.qmd deleted file mode 100644 index d24b8ac..0000000 --- a/docs/reference/relations.reunmatches_relation.qmd +++ /dev/null @@ -1,18 +0,0 @@ -# relations.reunmatches_relation { #fave_recode.relations.reunmatches_relation } - -`relations.reunmatches_relation(lhs, rhs)` - -Does the lhs *not* match a regex for the rhs - -## Parameters - -| Name | Type | Description | Default | -|--------|--------------|-----------------|------------| -| `lhs` | [str](`str`) | left hand side | _required_ | -| `rhs` | [str](`str`) | right hand side | _required_ | - -## Returns - -| Type | Description | -|----------------|---------------| -| [bool](`bool`) | True or False | \ No newline at end of file diff --git a/docs/reference/rule_classes.Condition.qmd b/docs/reference/rule_classes.Condition.qmd deleted file mode 100644 index 3bd7e95..0000000 --- a/docs/reference/rule_classes.Condition.qmd +++ /dev/null @@ -1,56 +0,0 @@ -# rule_classes.Condition { #fave_recode.rule_classes.Condition } - -`rule_classes.Condition(self, condition)` - -_A rule condition_ - -## Attributes - -| Name | Type | Description | -|-----------|--------------------------------------------------|---------------------------------------------| -| attribute | [str](`str`) | The attribute path for a `SequenceInterval` | -| relation | [Callable](`collections.abc.Callable`) | The relation function to be used | -| set | [Union](`Union`)\[[str](`str`), [list](`list`)\] | The comparison set | - -## Methods - -| Name | Description | -| --- | --- | -| [check_condition](#fave_recode.rule_classes.Condition.check_condition) | _Check if the condition is met_ | -| [validate_condition](#fave_recode.rule_classes.Condition.validate_condition) | Validate wellformedness of condititions | - -### check_condition { #fave_recode.rule_classes.Condition.check_condition } - -`rule_classes.Condition.check_condition(obj)` - -_Check if the condition is met_ - -#### Parameters - -| Name | Type | Description | Default | -|--------|-----------------------------------------------------------------------------|--------------------------------------------------------------|------------| -| `obj` | [SequenceInterval](`aligned_textgrid.sequences.sequences.SequenceInterval`) | The sequence interval against which the condition is checked | _required_ | - -#### Returns - -| Type | Description | -|----------------|---------------| -| [bool](`bool`) | True or False | - -### validate_condition { #fave_recode.rule_classes.Condition.validate_condition } - -`rule_classes.Condition.validate_condition(condition)` - -Validate wellformedness of condititions - -#### Parameters - -| Name | Type | Description | Default | -|-------------|----------------|----------------------|------------| -| `condition` | [dict](`dict`) | condition dictionary | _required_ | - -#### Raises - -| Type | Description | -|--------------------------|------------------------------------| -| [Exception](`Exception`) | Any errors raised by the validator | \ No newline at end of file diff --git a/docs/reference/rule_classes.Rule.qmd b/docs/reference/rule_classes.Rule.qmd deleted file mode 100644 index 82f5aaa..0000000 --- a/docs/reference/rule_classes.Rule.qmd +++ /dev/null @@ -1,62 +0,0 @@ -# rule_classes.Rule { #fave_recode.rule_classes.Rule } - -`rule_classes.Rule(self, rule)` - -_A rule class_ - -## Attributes - -| Name | Type | Description | -|------------|--------------------------------------------------------------------------|-----------------------| -| rule | [str](`str`) | The name of the rule | -| conditions | [list](`list`)\[[Condition](`fave_recode.rule_classes.Condition`), ...\] | A list of conditions | -| output | [str](`str`) | The rewrite output | - -## Methods - -| Name | Description | -| --- | --- | -| [apply_rule](#fave_recode.rule_classes.Rule.apply_rule) | _Apply a single rile_ | -| [validate_rule](#fave_recode.rule_classes.Rule.validate_rule) | _Validate the rule wellformedness_ | - -### apply_rule { #fave_recode.rule_classes.Rule.apply_rule } - -`rule_classes.Rule.apply_rule(obj)` - -_Apply a single rile_ - -#### Parameters - -| Name | Type | Description | Default | -|--------|-----------------------------------------------------------------------------|-------------------------------------------|------------| -| `obj` | [SequenceInterval](`aligned_textgrid.sequences.sequences.SequenceInterval`) | The interval potentially being relabelled | _required_ | - -#### Raises - -| Type | Description | -|--------------------------|---------------------------------------| -| [Exception](`Exception`) | Any errors in checking the conditions | - -#### Returns - -| Type | Description | -|----------------|----------------------------| -| [bool](`bool`) | `True` if the rule applied | - -### validate_rule { #fave_recode.rule_classes.Rule.validate_rule } - -`rule_classes.Rule.validate_rule(rule)` - -_Validate the rule wellformedness_ - -#### Parameters - -| Name | Type | Description | Default | -|--------|----------------|---------------------|------------| -| `rule` | [dict](`dict`) | The rule dictionary | _required_ | - -#### Raises - -| Type | Description | -|--------------------------|-------------------------------| -| [Exception](`Exception`) | Any errors from the validator | \ No newline at end of file diff --git a/docs/reference/rule_classes.RuleSet.qmd b/docs/reference/rule_classes.RuleSet.qmd deleted file mode 100644 index 421bd7d..0000000 --- a/docs/reference/rule_classes.RuleSet.qmd +++ /dev/null @@ -1,75 +0,0 @@ -# rule_classes.RuleSet { #fave_recode.rule_classes.RuleSet } - -`rule_classes.RuleSet(self, rules=[], rule_path=None)` - -A rule set class - -Pass `RuleSet` either a rules dictionary, or a path -to a rules yaml file - -## Parameters - -| Name | Type | Description | Default | -|-------------|---------------------------------------|-----------------------------|-----------| -| `rules` | [list](`list`)\[[dict](`dict`), ...\] | A list of rule dictionaries | `[]` | -| `rule_path` | [str](`str`) | A path to a rules .yml file | `None` | - -## Attributes - -| Name | Type | Description | -|--------|----------------------------------------------------------------|---------------| -| rules | [list](`list`)\[[Rule](`fave_recode.rule_classes.Rule`), ...\] | | - -## Methods - -| Name | Description | -| --- | --- | -| [apply_ruleset](#fave_recode.rule_classes.RuleSet.apply_ruleset) | _Apply the ruleset_ | -| [map_ruleset](#fave_recode.rule_classes.RuleSet.map_ruleset) | _Apply the ruleset to all sequences_ | -| [read_ruleset](#fave_recode.rule_classes.RuleSet.read_ruleset) | _read in a ruleset_ | - -### apply_ruleset { #fave_recode.rule_classes.RuleSet.apply_ruleset } - -`rule_classes.RuleSet.apply_ruleset(obj)` - -_Apply the ruleset_ - -The rules are checked against the Sequence interval -in sequence, and the first one applies, ceasing rule' -application. - -#### Parameters - -| Name | Type | Description | Default | -|--------|-----------------------------------------------------------------------------|--------------------------------------------------|------------| -| `obj` | [SequenceInterval](`aligned_textgrid.sequences.sequences.SequenceInterval`) | The SequenceInterval undergoing rule application | _required_ | - -### map_ruleset { #fave_recode.rule_classes.RuleSet.map_ruleset } - -`rule_classes.RuleSet.map_ruleset(obj)` - -_Apply the ruleset to all sequences_ - -#### Parameters - -| Name | Type | Description | Default | -|--------|-----------------------------------------------------------------|-------------------------------|------------| -| `obj` | [SequenceTier](`aligned_textgrid.sequences.tiers.SequenceTier`) | A sequence tier to be recoded | _required_ | - -### read_ruleset { #fave_recode.rule_classes.RuleSet.read_ruleset } - -`rule_classes.RuleSet.read_ruleset(path)` - -_read in a ruleset_ - -#### Parameters - -| Name | Type | Description | Default | -|--------|--------------|---------------------|------------| -| `path` | [str](`str`) | A path to a ruleset | _required_ | - -#### Raises - -| Type | Description | -|--------------------------|--------------------------------------| -| [Exception](`Exception`) | Any errors in reading in the ruleset | \ No newline at end of file