Repository navigation
Conversation
The window [2, 9) held every node, so `window` and `score | window` kept all five. [2, 7) leaves e outside and d only inside. Also pins what a negated view keeps against a negated existence test, and the accepted forms of the refused negations of views.
Seven entries of `BLOCKS` repeated the expressions of `score`, `person`, `heavy`, `update`, `window`, `work` and `abc`. They now name those functions.
One table, EXPECTED, says per named filter what each site keeps or the refusal it gives, replacing the separate acceptance and kept tables. Rows are written with refused(on_filter=, on_nodes=, on_edges=, everywhere=) and ACCEPTED, and the sites are grouped as ON_FILTER, ON_NODES and ON_EDGES.
SHAPES becomes FILTERS and BLOCKS becomes PARTS, in the shared module, the matrix tests and the parity tests.
with_variants passes the test's arguments through, so the table tests can be parametrized and a failure names the filter and site it is about.
The matrix says which filters are refused and where. What accepted filters keep, the negation and distribution laws and the server parity run are covered by other suites and leave this file, and with one file left the fixture and the parts move into it. The sites of filter() on a graph become one site, since a refusal is raised by the call itself. The exploded listing of a filtered edge collection is an expected failure of its own.
ljeub-pometry
left a comment
There was a problem hiding this comment.
This needs a lot more structure so we can easily keep this up-to-date!
| "graph.filter": lambda graph, expr: graph.filter(expr), | ||
| "nodes.filter": lambda graph, expr: graph.nodes.filter(expr), | ||
| "node.filter": lambda graph, expr: graph.node("a").filter(expr), | ||
| "neighbours.filter": lambda graph, expr: graph.nodes.neighbours.filter(expr), |
There was a problem hiding this comment.
this is missing the PathFromNode, i.e., graph.node("a").neighbours.filter(expr)
| "node.filter": lambda graph, expr: graph.node("a").filter(expr), | ||
| "neighbours.filter": lambda graph, expr: graph.nodes.neighbours.filter(expr), | ||
| "edges.filter": lambda graph, expr: graph.edges.filter(expr), | ||
| "edge.filter": lambda graph, expr: graph.edge("a", "b").filter(expr), |
There was a problem hiding this comment.
this is missing the NestedEdges, i.e., graph.nodes.edges.filter(expr)
| "neighbours[]": lambda graph, expr: graph.nodes.neighbours[expr], | ||
| "node.neighbours[]": lambda graph, expr: graph.node("a").neighbours[expr], |
There was a problem hiding this comment.
Neighbours are different from nodes once the path filtering is fixed (see #2924), it is probably worth splitting them out now!
|
|
||
| def score(): | ||
| return Node.property("score") > 15 | ||
|
|
||
|
|
||
| def person(): | ||
| return Node.node_type() == "person" | ||
|
|
||
|
|
||
| def heavy(): | ||
| return Edge.property("w") > 3 | ||
|
|
||
|
|
||
| def update(): | ||
| return ExplodedEdge.property("w") > 3 | ||
|
|
||
|
|
||
| def window(): | ||
| return GraphView.window(2, 7) | ||
|
|
||
|
|
||
| def work(): | ||
| return GraphView.layer("work") | ||
|
|
||
|
|
||
| def abc(): | ||
| return GraphView.subgraph(["a", "b", "c"]) | ||
|
|
There was a problem hiding this comment.
why are these named functions instead of lambdas as everything else?
| } | ||
|
|
||
| # Where each form is refused, for each kind of part it is filled with. | ||
| COMBINATIONS = { |
There was a problem hiding this comment.
This structure makes it really non-obvious that everything is covered and very annoying to add anything. This should be structured in a nested way so we have a mapping from Form -> test type -> (examples, expected result). Using data classes to fix the structure would be very helpful as well!
The parts and the nested filters are lambdas like everything else in the file, instead of named helper functions.
SINGLE and PAIRS map each form to its test types (or pair of test types) and to where the filter is refused at each group of sites, through the ByType, BySite and Form dataclasses. ByType has a required field per test type, so a form that leaves one out fails at import and the coverage test goes. Each ordered pair of test types has its own cell.
node.neighbours.filter (PathFromNode) joins the filter sites.
nodes.edges.filter (NestedEdges) joins the filter sites.
neighbours[] and node.neighbours[] move out of the nodes group into their own, as neighbours will be filtered differently from nodes once path filtering is fixed (#2924).
Adds a matrix of the filters Raphtory refuses today, as tests. When a refused filter becomes supported, its row fails and names the filter and the site, so the change is made on purpose.
Sites. 14 of them, in three groups that behave alike:
.filter(f)on a graph, nodes, a node, neighbours, edges or an edge;[f]on nodes or neighbours;[f]on edges or exploded edges.COMBINATIONS&,|and~, with every part of each kind: the refusal at each site, or none, onGraphandPersistentGraphNESTEDg.edges.filter(f).explode()lists updatesfhideswith_variantsnow passes a test's arguments through, so it can be combined withpytest.mark.parametrize.Closes #2965