Skip to content

Commit e997aac

Browse files
committed
Update: corrected docs and uploaded logo
1 parent 01e26bf commit e997aac

File tree

9 files changed

+60
-21
lines changed

9 files changed

+60
-21
lines changed

docs/source/_static/css/custom.css

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/* Custom CSS */
2+
3+
/* Note: /*
4+
The CSS below will only work if 'logo_only':True in conf.py, but will require adjusting if False.
5+
*/
6+
7+
.wy-side-nav-search a .logo {
8+
max-width: 200px;
9+
max-height: 170px;
10+
height: auto;
11+
width:auto;
12+
}
13+
14+
15+
16+
.wy-nav-top a {
17+
color: #131E29; /* Change the colour of the homepage navigation title on mobiles */
18+
}
19+
20+
.wy-menu-vertical p.caption {
21+
22+
color: #9ADBE8; /* Change the colour of captions*/
23+
}
24+
25+
26+
.rst-content code.literal, .highlight .s2, .highlight .s1, .rst-content tt.literal{
27+
color: #440099;
28+
font-weight: bold;
29+
}
19.8 KB
Loading

docs/source/conf.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,17 @@
5757
# Path to generate documentation from using sphinx AutoAPI
5858
autoapi_dirs = [os.path.abspath(os.path.join("..", "..", "causal_testing"))]
5959

60+
autoapi_generate_api_docs = True
61+
autoapi_keep_files = True
62+
63+
# Suppress label warnings
64+
suppress_warnings = ['autosectionlabel.*']
65+
66+
6067
html_logo = '_static/images/CITCOM-logo.png'
6168

6269
html_theme_options = {
6370
'style_nav_header_background': '#9ADBE8', # Set the colour using CSS
6471
'logo_only' : True,
65-
}
72+
}
73+

docs/source/frontends/json_front_end.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ An example is provided in `examples/poisson` which contains a README with more d
2020

2121
run_causal_tests.py
2222
*******************
23-
`examples/poisson/run_causal_tests.py <https://github.com/CITCOM-project/CausalTestingFramework/blob/main/examples/poisson/run_causal_tests.py>`_
23+
The `examples/poisson/example_run_causal_tests.py <https://github.com/CITCOM-project/CausalTestingFramework/blob/main/examples/poisson/example_run_causal_tests.py>`_
2424
contains python code written by the user to implement scenario specific features
2525
such as:
2626

@@ -34,9 +34,9 @@ Use-case specific information is also declared here such as the paths to the rel
3434

3535
causal_tests.json
3636
*****************
37-
`examples/poisson/causal_tests.json <https://github.c#om/CITCOM-project/CausalTestingFramework/blob/main/examples/poisson/causal_tests.json>`_ contains Python code written by the user to implement scenario specific features
38-
is the JSON file that allows for the easy specification of multiple causal tests. Tests can be specified two ways; firstly by specifying a mutation lke in the example tests with the following structure:
39-
Each test requires:
37+
The `examples/poisson/causal_tests.json <https://github.com/CITCOM-project/CausalTestingFramework/blob/main/examples/poisson/causal_tests.json>`_ contains Python code written by the user to implement scenario specific features
38+
is the JSON file that allows for the easy specification of multiple causal tests.
39+
Tests can be specified two ways; firstly by specifying a mutation lke in the example tests with the following structure:
4040

4141
#. name
4242
#. mutations
@@ -57,17 +57,22 @@ The second method of specifying a test is to specify the test in a concrete form
5757
#. expected_effect
5858
#. skip
5959

60+
61+
Alternatively, a ``causal_tests.json`` file can be created from a ``dag.dot`` file using the ``causal_testing/specification/metamorphic_relation.py`` script as follows::
62+
63+
python causal_testing/specification/metamorphic_relation.py --dag_path dag.dot --output_path causal_tests.json
64+
6065
Run Commands
6166
************
6267
This example uses the ``Argparse`` utility built into the JSON frontend, which allows the frontend to be run from a commandline interface as shown here.
6368

6469
To run the JSON frontend example from the root directory of the project, use::
6570

66-
python examples\poisson\run_causal_tests.py --data_path="examples\poisson\data.csv" --dag_path="examples\poisson\dag.dot" --json_path="examples\poisson\causal_tests.json
71+
python examples\poisson\example_run_causal_tests.py --data_path="examples\poisson\data.csv" --dag_path="examples\poisson\dag.dot" --json_path="examples\poisson\causal_tests.json
6772

6873
A failure flag `-f` can be specified to stop the framework running if a test is failed::
6974

70-
python examples\poisson\run_causal_tests.py -f --data_path="examples\poisson\data.csv" --dag_path="examples\poisson\dag.dot" --json_path="examples\poisson\causal_tests.json
75+
python examples\poisson\example_run_causal_tests.py -f --data_path="examples\poisson\data.csv" --dag_path="examples\poisson\dag.dot" --json_path="examples\poisson\causal_tests.json
7176

7277
There are two main outputs of this frontend, both are controlled by the logging module. Firstly outputs are printed to stdout (terminal).
7378
Secondly a log file is produced, by default a file called `json_frontend.log` is produced in the directory the script is called from.

docs/source/index.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ Welcome to the Causal Testing Framework
44
|status| |ci-tests| |code-cov| |docs| |python| |pypi| |doi| |license|
55

66
Overview
7-
*******
7+
**********
88

99
Causal testing is a :term:`causal inference`-driven framework for functional black-box testing. This framework utilises
1010
graphical causal inference (CI) techniques for the specification and functional testing of software from a black-box
11-
perspective. In this framework, we use causal :term:`directed acyclic graphs` (DAGs) to express the anticipated cause-effect
11+
perspective. In this framework, we use causal directed acyclic graphs (DAGs) to express the anticipated cause-effect
12+
relationships amongst the inputs and outputs of the system-under-test and the supporting mathematical framework to
1213
relationships amongst the inputs and outputs of the system-under-test and the supporting mathematical framework to
1314
design statistical procedures capable of making causal inferences. Each causal test case focuses on the causal effect
1415
of an intervention made to the system-under test. That is, a prescribed change to the input configuration of the
@@ -118,7 +119,7 @@ system-under-test that is expected to cause a change to some output(s).
118119
:hidden:
119120
:titlesonly:
120121

121-
/autoapi/causal_testing/index
122+
/autoapi/index
122123

123124
.. toctree::
124125
:hidden:
@@ -155,7 +156,7 @@ system-under-test that is expected to cause a change to some output(s).
155156

156157
.. toctree::
157158
:hidden:
158-
:maxdepth: 1
159+
:maxdepth: 2
159160
:caption: Credits
160161

161162
credits
@@ -192,4 +193,4 @@ system-under-test that is expected to cause a change to some output(s).
192193

193194
.. |license| image:: https://img.shields.io/github/license/CITCOM-project/CausalTestingFramework
194195
:target: https://github.com/CITCOM-project/CausalTestingFramework
195-
:alt: License
196+
:alt: License

docs/source/installation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Getting started
2-
============
2+
================
33

44
Requirements
5-
------------
5+
---------------
66
* Python >= 3.9.
77
* `Microsoft Visual C++ <https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist>`_ 14.0+ (Windows only).
88

99

1010
Installation
11-
-----------
11+
-----------------
1212
The Causal Testing Framework can be installed through either the `Python Package Index (PyPI)`_ (recommended), or directly from source.
1313

1414
.. _Python Package Index (PyPI): https://dl.acm.org/doi/10.1145/3607184

docs/source/modules/causal_specification.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ there are a couple of requirements that should be satisfied.
4040

4141
- Collectively, the components of the causal specification provide both contextual information in the form of constraints and requirements,
4242
as well as causal information in the form of a causal DAG. Later on, these components will be used to design statistical experiments that
43-
can answer causal questions about the scenario-under-test, such as ``Does opening a window impair the viruses ability to spread?``
43+
can answer causal questions about the scenario-under-test, such as `Does opening a window impair the viruses ability to spread?`

docs/source/modules/causal_tests.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ We then define a number of causal test cases to apply to the scenario-under-test
4242
* ``mask_wearing_test = (X={precaution = None}, \Delta = {precaution = Mask}, Y = {-20% < n_infected_t5 < -10% })`` (Mask wearing is expected to result in between 10% and 20% fewer infections).
4343
* ``hand_washing_test = (X={precaution = None}, \Delta = {precaution = Hand Washing}, Y = {-40% < n_infected_t5 < -25%})`` (Hand washing is expected to result in between 25% and 40% fewer infections).
4444

45-
Data Collection
46-
---------------
47-
4845
- To run these test cases experimentally, we need to execute both ``X`` and ``\Delta(X)`` - that is, with and without the interventions. Since the only difference between these test cases is the intervention, we can conclude that the observed difference in ``n_infected_t5`` was caused by the interventions. While this is the simplest approach, it can be extremely inefficient at scale, particularly when dealing with complex software such as computational models.
4946

5047
- To run these test cases observationally, we need to collect *valid* observational data for the scenario-under-test. This means we can only use executions with between 20 and 30 people, a square environment of size betwen 20x20 and 40x40, and where a single person was initially infected. In addition, this data must contain executions both with and without the intervention. Next, we need to identify any sources of bias in this data and determine a procedure to counteract them. This is achieved automatically using graphical causal inference techniques that identify a set of variables that can be adjusted to obtain a causal estimate. Finally, for any categorical biasing variables, we need to make sure we have executions corresponding to each category otherwise we have a positivity violation (i.e. missing data). In the worst case, this at least guides the user to an area of the system-under-test that should be executed.

docs/source/usage.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,4 @@ various information. Here, we simply assert that the observed result is (on aver
103103
test_passes = causal_test_case.expected_causal_effect.apply(causal_test_result)
104104
assert test_passes, "Expected to see a positive change in y."
105105
106-
Multiple tests can be executed at once using the test engines `test_suite <https://causal-testing-framework.readthedocs.io/en/test_suite.html>`_
107-
feature.
106+
Multiple tests can be executed at once using the test engines :doc:`Test Suite </frontends/test_suite>` feature.

0 commit comments

Comments
 (0)