Skip to content

Commit a5899e8

Browse files
committed
fix: schematic image in dark-mode
1 parent 50bf942 commit a5899e8

File tree

3 files changed

+24
-25
lines changed

3 files changed

+24
-25
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
![Dynamic TOML Badge](https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2FCITCOM-project%2FCausalTestingFramework%2Fmain%2Fpyproject.toml&query=%24.project%5B'requires-python'%5D&label=python)
1010
![PyPI - Version](https://img.shields.io/pypi/v/causal-testing-framework)
1111
[![DOI](https://t.ly/FCT1B)](https://orda.shef.ac.uk/articles/software/CITCOM_Software_Release/24427516)
12-
![GitHub License](https://img.shields.io/github/license/CITCOM-project/CausalTestingFramework)
12+
![GitHub Licens[schematic.tex](images%2Fschematic.tex)e](https://img.shields.io/github/license/CITCOM-project/CausalTestingFramework)
1313

1414
Causal testing is a causal inference-driven framework for functional black-box testing. This framework utilises
1515
graphical causal inference (CI) techniques for the specification and functional testing of software from a black-box
@@ -19,7 +19,8 @@ design statistical procedures capable of making causal inferences. Each causal t
1919
an intervention made to the system-under test. That is, a prescribed change to the input configuration of the
2020
system-under-test that is expected to cause a change to some output(s).
2121

22-
![Causal Testing Workflow](images/schematic.png)
22+
![Causal Testing Workflow](images/schematic-dark.png#gh-dark-mode-only)
23+
![Causal Testing Workflow](images/schematic.png#gh-light-mode-only)
2324

2425
## Installation
2526

images/schematic.png

-14.7 KB
Loading

images/schematic.tex

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
\documentclass{standalone}
22

33
\usepackage{tikz}
4-
\usetikzlibrary{arrows,positioning,shapes,calc,fit,overlay-beamer-styles}
5-
4+
\usetikzlibrary{arrows,positioning,shapes,calc,fit,overlay-beamer-styles, backgrounds}
65
\usepackage{dsfont,pifont}
76
\newcommand*{\expe}{\mathds{E}}
87
\usepackage{amsmath}
@@ -21,18 +20,17 @@
2120
\newcommand{\cmark}{\ding{51}}%
2221
\newcommand{\xmark}{\ding{55}}%
2322

24-
\begin{tikzpicture}
25-
\scriptsize
23+
\begin{tikzpicture}[background rectangle/.style={fill=black}, show background rectangle, color=white]
2624

2725
\begin{scope}[name prefix=scenario-, local bounding box=specification]
2826
% Causal DAG
2927
\begin{scope}[name prefix=dag-]
30-
\node[node] (x1) at (0,0) {$X_2$};
31-
\node[node] (x2) at (0,1) {$X_1$};
28+
\node[node] (x1) at (-0.1,-0.2) {$X_1$};
29+
\node[node] (x2) at (-0.1, 1.2) {$X_2$};
3230
\node[node] (i) at (0.5,0.5) {$I$};
33-
\node[node] (y1) at (1.2,0) {$Y_1$};
34-
\node[node] (y2) at (1.2,0.5) {$Y_2$};
35-
\node[node] (y3) at (1.2,1) {$Y_3$};
31+
\node[node] (y1) at (1.3,-0.2) {$Y_{1}$};
32+
\node[node] (y2) at (1.3,0.5) {$Y_2$};
33+
\node[node] (y3) at (1.3,1.2) {$Y_3$};
3634

3735
\draw[edge] (x1) to (i);
3836
\draw[edge] (x2) to (i);
@@ -57,23 +55,23 @@
5755
\end{scope}
5856
\node[draw, rectangle] [fit=(scenario-scenario) (scenario-title)] {};
5957

60-
\begin{scope}[name prefix=test-, local bounding box=test-case, shift={($(specification.south)+(0, -1)$)}]
58+
\begin{scope}[name prefix=test-, local bounding box=test-case, shift={($(scenario-specification.south)+(0, -1)$)}]
6159
\node[draw=none, rectangle, anchor=north] (title) at (0, 0) {Causal Test Case};
6260
\node[anchor=north] (tuple) at (title.south) {$(X=i, \Delta=\text{increase}, Y=y_1)$};
6361
\coordinate (left) at (scenario-scenario.east |- {(0, 0)});
6462
\coordinate (right) at (scenario-scenario.west |- {(0, 0)});
6563
\node[draw, rectangle] [fit=(title) (tuple) (left) (right)] {};
6664
\end{scope}
6765

68-
\begin{scope}[name prefix=estimand-, local bounding box=estimand, anchor=south, shift={($(test-case.east |- test-tuple.south) + (1, 0)$)}]
66+
\begin{scope}[name prefix=estimand-, local bounding box=estimand, anchor=south, shift={($(test-test-case.east |- test-tuple.south) + (1, 0)$)}]
6967
\node[anchor=south west] (eqn) at (0,0) {
7068
$\Delta Y=\expe{[I=0 | X_1]} - \expe{[I=1 | X_1]} $
7169
};
7270
\node[draw=none, rectangle, anchor=south] (title) at (eqn.north) {Statistical Estimand};
7371
\node[draw, rectangle] [fit=(estimand-title) (estimand-eqn)] {};
7472
\end{scope}
7573

76-
\begin{scope}[name prefix=estimate-, local bounding box=estimate, shift={($(estimand.east)+(1, 0)$)}]
74+
\begin{scope}[name prefix=estimate-, local bounding box=estimate, shift={($(estimand-estimand.east)+(1, 0)$)}]
7775
\node[draw=none, rectangle, anchor=south west] (title) at (0, 0) {Causal Estimate};
7876
\node[anchor=north] (table) at (title.south) {
7977
$\Delta Y=5$
@@ -83,8 +81,8 @@
8381
\node[draw, rectangle] [fit=(title) (table) (top) (bot)] {};
8482
\end{scope}
8583

86-
\begin{scope}[name prefix=data-, local bounding box=test-data, shift={($(estimate.north)+(0, 1)$)},]
87-
\node[draw=none, rectangle] (title) at (estimate |- scenario-title) {Test Data};
84+
\begin{scope}[name prefix=data-, local bounding box=test-data, shift={($(estimate-estimate.north)+(0, 1)$)},]
85+
\node[draw=none, rectangle] (title) at (estimate-estimate |- scenario-title) {Test Data};
8886
\node[anchor=north] (table) at (title.south) {
8987
\begin{tabular}{rrrrrr}
9088
\toprule
@@ -99,7 +97,7 @@
9997
\node[draw, rectangle] [fit=(title) (table)] {};
10098
\end{scope}
10199

102-
\begin{scope}[name prefix=oracle-, local bounding box=test-oracle, shift={($(estimate.east) + (1.54, -0.4)$)}]
100+
\begin{scope}[name prefix=oracle-, local bounding box=test-oracle, shift={($(estimate-estimate.east) + (1.54, -0.4)$)}]
103101
\begin{scope}[shift={(0,0)}, local bounding box=brain, scale=1.2]
104102
\begin{scope}[shift={(-7.6932,3.5256)}, local bounding box=brain]
105103
\path[draw,line width=0.025cm] (8.162, -2.8955) circle (0.066cm);
@@ -128,7 +126,7 @@
128126
\node[draw, rectangle] [fit=(title) (brain)] {};
129127
\end{scope}
130128

131-
\begin{scope}[name prefix=outcome-, local bounding box=test-outcome, shift={($(brain.east |- estimate.east) + (1, 0)$)}]
129+
\begin{scope}[name prefix=outcome-, local bounding box=test-outcome, shift={($(oracle-brain.east |- estimate-estimate.east) + (1, 0)$)}]
132130
\node[draw=none, rectangle, anchor=south west] (title) at (0,0) {Test Outcomes};
133131
\node[draw=none, anchor=north] (ok) at (title.south) {\cmark ~ \xmark};
134132

@@ -137,13 +135,13 @@
137135
\node[draw, rectangle] (test-outcome) [fit=(outcome-title) (outcome-ok) (top) (bot)] {};
138136
\end{scope}
139137

140-
\draw[edge, dashed] ($(specification.east) + (0.1, 0)$) -- (estimand.north |- specification.east) -- (estimand.north);
141-
\draw[edge, dashed] (test-case) -- (estimand);
138+
\draw[edge, dashed] ($(scenario-specification.east) + (0.15, 0)$) -- (estimand-estimand.north |- scenario-specification.east) -- (estimand-estimand.north);
139+
\draw[edge, dashed] (test-test-case) -- (estimand-estimand);
142140

143-
\draw[edge, dashed] (test-data.south) -- (estimate.north);
144-
\draw[edge, dashed] (estimand) -- (estimate);
141+
\draw[edge, dashed] (data-test-data.south) -- (estimate-estimate.north);
142+
\draw[edge, dashed] (estimand-estimand) -- (estimate-estimate);
145143

146-
\draw[edge, dashed] (estimate) -- (test-oracle.west |- estimate);
147-
\draw[edge, dashed] (test-oracle.east |- test-outcome) -- (test-outcome);
144+
\draw[edge, dashed] (estimate-estimate) -- (oracle-test-oracle.west |- estimate-estimate);
145+
\draw[edge, dashed] (oracle-test-oracle.east |- outcome-test-outcome) -- (outcome-test-outcome);
148146
\end{tikzpicture}
149-
\end{document}
147+
\end{document}

0 commit comments

Comments
 (0)