Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update YAML RTD page with Hints field
  • Loading branch information
gselzer committed Sep 9, 2024
commit f8aae28b817ba09de7bd4289947fde351080a300
12 changes: 12 additions & 0 deletions docs/ops/doc/WritingYourOwnOpPackage.md
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ Assuming your project is following Maven's [standard directory layout](https://m
```yaml
- op:
names: [your.op.name1, your.op.name2, ...] # Array of Strings
hints: [op.hint1, op.hint2, ...] # Array of Strings
description: 'your Op description' # String
source: yourOpSource # String - see below
priority: 0.0 # Number
Expand All @@ -493,6 +494,17 @@ Assuming your project is following Maven's [standard directory layout](https://m

Of particular note are the following sections:

#### Hints

Each Op can define a set of hints (i.e. flags to the matcher) that can enable/disable particular aspects of the matcher.

Some of the most useful Op hints are described below:

| Hint | Use Case |
|------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `Adaptation.FORBIDDEN` | Some algorithms like a [Fast Fourier Transform](https://en.wikipedia.org/wiki/Fast_Fourier_transform) require their outputs be <br>of a particular size (not equivalent to the input size). If they are a `Computer`, <br>adaptation to `Function`s may cause errors. |
| `Conversion.FORBIDDEN` | `engine.convert` Ops often require this hint to avoid infinite loops in <br>converted Op matching. |

#### Source

For **java objects**, the `source` will start with one of the following prefix, followed by a `:/`, followed by a [percent-encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding) stringification of the Op (i.e. calling `toString()` on the object). Examples are shown below:
Expand Down