Skip to content

Jmafoster1/visualisation - #403

Draft
jmafoster1 wants to merge 6 commits into
mainfrom
jmafoster1/visualisation
Draft

Jmafoster1/visualisation#403
jmafoster1 wants to merge 6 commits into
mainfrom
jmafoster1/visualisation

Conversation

@jmafoster1

@jmafoster1 jmafoster1 commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

This PR adds the capability to visualise causal test results on the DAG.

Main changes

  • Moved visualisation code out of abstract_discovery.py and into a separate dedicated visualisation module, which can grow sustainably over time
  • Moved effect_direction into CausalTestResult class. Ideally, this would be part of EffectEstimate, but that leads to circular imports with CausalEffect

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Elapsed time
⚠️ PYTHON black 31 1 1.05s
✅ PYTHON pylint 31 0 6.25s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

raise ValueError(f"Test Value type {effect_estimate.type} is not valid for this CausalEffect")

return (~((effect_estimate.ci_low <= value_to_check) & (value_to_check <= effect_estimate.ci_high))).all()
return (~((effect_estimate.ci_low <= value_to_check) & (value_to_check <= effect_estimate.ci_high))).any()

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug fix: This should have been .any() all along

@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.77778% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 98.47%. Comparing base (1318ec3) to head (7a77aee).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ing/visualisation/causal_test_result_visualiser.py 96.66% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #403      +/-   ##
==========================================
- Coverage   98.54%   98.47%   -0.08%     
==========================================
  Files          25       26       +1     
  Lines        1514     1510       -4     
==========================================
- Hits         1492     1487       -5     
- Misses         22       23       +1     
Files with missing lines Coverage Δ
causal_testing/__main__.py 99.16% <100.00%> (+<0.01%) ⬆️
causal_testing/discovery/abstract_discovery.py 100.00% <100.00%> (ø)
causal_testing/discovery/hill_climber_discovery.py 100.00% <100.00%> (ø)
causal_testing/testing/causal_effect.py 97.56% <100.00%> (ø)
causal_testing/testing/causal_test_result.py 100.00% <100.00%> (ø)
...ing/visualisation/causal_test_result_visualiser.py 96.66% <96.66%> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1318ec3...7a77aee. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant