AlgebraicJulia / DiagrammaticEquations.jl

MIT License
12 stars 1 forks source link

Check black list when contracting operators #26

Closed lukem12345 closed 4 months ago

lukem12345 commented 6 months ago

The contract_operators function finds chains of unary operators, and replaces them with a single operator containing a vector of the operators from that chain.

We currently support the ability to only contract when operators are in some given white list of operators. When there is no white list given, we default to allowing any operator to be chained.

It will simplify future Decapode manipulation if we also support a black list of operators. If an operator is in the black list, such an operator will not be chained.

lukem12345 commented 6 months ago

Before

flowchart LR

A -->|g| B
B -->|f| C
C -->|e| D
D -->|d| E
E -->|c| F
F -->|b| G
G -->|a| H
contract_operators(t15_orig,
    white_list=Set([:a, :b, :c]),
    black_list=Set([:d]))

After

flowchart LR

A -->|g| B
B -->|f| C
C -->|e| D
D -->|d| E
E -->|c,b,a| H
codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 86.80%. Comparing base (e21e6c7) to head (4860877).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #26 +/- ## ========================================== + Coverage 86.62% 86.80% +0.17% ========================================== Files 13 13 Lines 890 894 +4 ========================================== + Hits 771 776 +5 + Misses 119 118 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.