Skip to content

Jmafoster1/visualisation - #403

Open
jmafoster1 wants to merge 56 commits into
mainfrom
jmafoster1/visualisation
Open

jmafoster1 wants to merge 56 commits into
mainfrom
jmafoster1/visualisation

Conversation

@jmafoster1

@jmafoster1 jmafoster1 commented Jul 31, 2026 •

Copy link
Copy Markdown
Collaborator

This PR adds a visualisation dashboard to the CTF to serve as a nice pretty GUI. (Sorry it ended up being a bit of a monster PR!)

Closes #411

If you want to see the dashboard in action, check out this branch, install the dependencies to a virtual environment of your choice, and run causal-testing dashboard. You can then navigate to https://localhost:5006 and "upload" use dag/data from examples.

Main changes

  • Moved visualisation code out of abstract_discovery.py and into a separate dedicated visualisation package
  • Expanded this out into an entire visualisation dashboard package
  • Moved effect_direction into CausalTestResult class. Ideally, this would be part of EffectEstimate, but that leads to circular imports with CausalEffect :(
  • Bug fix on NoEffect estimate and making the other causal effects more consistent and robust
  • Renamed EffectEstimate.value to EffectEstimate.effect_estimate (this touches a lot of files)
  • Visualisation and dashboard tutorial.

@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 35 1 1.11s
✅ PYTHON pylint 35 0 6.34s

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

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.00%. Comparing base (b7c8e1e) to head (cb3f170).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #403      +/-   ##
==========================================
- Coverage   98.06%   98.00%   -0.07%     
==========================================
  Files          26       29       +3     
  Lines        1605     1901     +296     
==========================================
+ Hits         1574     1863     +289     
- Misses         31       38       +7     
Files with missing lines Coverage Δ
causal_testing/__main__.py 99.31% <100.00%> (+0.06%) ⬆️
causal_testing/causal_testing_framework.py 100.00% <100.00%> (ø)
causal_testing/discovery/abstract_discovery.py 98.38% <100.00%> (-0.67%) ⬇️
causal_testing/discovery/hill_climber_discovery.py 90.19% <100.00%> (ø)
causal_testing/estimation/effect_estimate.py 100.00% <100.00%> (ø)
causal_testing/testing/causal_effect.py 97.56% <100.00%> (ø)
causal_testing/testing/causal_test_case.py 100.00% <100.00%> (ø)
causal_testing/testing/causal_test_result.py 100.00% <100.00%> (ø)
causal_testing/testing/data_adequacy.py 100.00% <100.00%> (ø)
causal_testing/visualisation/geometry.py 100.00% <100.00%> (ø)
... and 2 more

... and 1 file with indirect coverage changes


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 373a413...cb3f170. Read the comment docs.

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

@jmafoster1
jmafoster1 force-pushed the jmafoster1/visualisation branch from 191e5c4 to d5b88a2 Compare September 22, 2026 13:02
@jmafoster1
jmafoster1 marked this pull request as ready for review September 30, 2026 12:51
@jmafoster1
jmafoster1 force-pushed the jmafoster1/visualisation branch 3 times, most recently from 4d19b71 to c3bf722 Compare October 4, 2026 16:51
@jmafoster1
jmafoster1 force-pushed the jmafoster1/visualisation branch from c3bf722 to 6be7948 Compare October 4, 2026 17:01
@jmafoster1

Copy link
Copy Markdown
Collaborator Author

Right, this should be fine now. Patch coverage is 100%, but Codecov sometimes gets confused when you move/delete code that was previously covered, which is what's happened here.

@jmafoster1

jmafoster1 commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator Author

TODO: Double check the kurtosis interpretation ("suspiciously stable"/"suspiciously unstable") before merging

See: https://fastercapital.com/content/Kurtosis--Kurtosis--Peeking-into-the-Tails-of-Normal-Distribution.html#Leptokurtic--Mesokurtic--and-Platykurtic-Distributions

EDIT: I think it's fine as is

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.

Testing dashboard

1 participant