Closed JabobKrauskopf closed 2 months ago
This PR updates the query engine interface according to new findings during the rust implementation.
Usage itself remains mainly the same.
E.g
def query(node: NodeOperand): edges_to_treatment = node.outgoing_edges() edges_to_treatment.target_node().in_group("treatment") edges_to_outcome = node.outgoing_edges() edges_to_outcome.target_node().in_group("outcome") max_time_edge = edges_to_treatment.attribute("time").max() max_time_edge.less_than(edges_to_outcome.attribute("time")) medrecord.select_nodes(query)
but this refactoring allows for some other stuff like node.attributes().starts_with("test_") and disallows e.g. comparing node indices with edge indices or values
node.attributes().starts_with("test_")
Expected tests to fail (same as in the previous PR):
medmodels/medrecord/tests/test_builder.py
medmodels/medrecord/tests/test_datatype.py
medmodels/medrecord/tests/test_indexers.py
medmodels/medrecord/tests/test_medrecord.py
medmodels/medrecord/tests/test_overview.py
medmodels/medrecord/tests/test_schema.py
medmodels/treatment_effect/matching/tests/test_classic_distance_models.py
medmodels/treatment_effect/matching/tests/test_metrics.py
medmodels/treatment_effect/matching/tests/test_propensity_score.py
medmodels/treatment_effect/tests/test_continuous_estimators.py
medmodels/treatment_effect/tests/test_temporal_analysis.py
medmodels/treatment_effect/tests/test_treatment_effect.py
This PR updates the query engine interface according to new findings during the rust implementation.
Usage itself remains mainly the same.
E.g
but this refactoring allows for some other stuff like
node.attributes().starts_with("test_")
and disallows e.g. comparing node indices with edge indices or valuesExpected tests to fail (same as in the previous PR):
medmodels/medrecord/tests/test_builder.py
medmodels/medrecord/tests/test_datatype.py
medmodels/medrecord/tests/test_indexers.py
medmodels/medrecord/tests/test_medrecord.py
medmodels/medrecord/tests/test_overview.py
medmodels/medrecord/tests/test_schema.py
medmodels/treatment_effect/matching/tests/test_classic_distance_models.py
medmodels/treatment_effect/matching/tests/test_metrics.py
medmodels/treatment_effect/matching/tests/test_propensity_score.py
medmodels/treatment_effect/tests/test_continuous_estimators.py
medmodels/treatment_effect/tests/test_temporal_analysis.py
medmodels/treatment_effect/tests/test_treatment_effect.py