Skip to content

Commit f2b0022

Browse files
Update json frontend docs
1 parent 6e21500 commit f2b0022

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

docs/source/frontends/json_front_end.rst

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,37 @@ JSON Frontend
33
The JSON frontend allows Causal Tests and parameters to be specified in JSON to allow for tests to be quickly written
44
whilst retaining the flexibility of the Causal Testing Framework (CTF).
55

6+
basic workflow
7+
--------------
8+
The basic workflow of using the JSON frontend is as follows:
9+
10+
#. Specify your test cases in the JSON format (more details below)
11+
#. Create your DAG in a dot file
12+
#. Initialise the JsonUtility class in python with a path of where you want the outputs saved
13+
#. Set the paths pointing the Json class to your json file, dag file and optionally your data file (see data section below) using the .set_paths method
14+
#. Run the .setup method providing your scenario
15+
#. Run the .run_json_tests method, which will execute the test cases provided by the JSON file.
16+
17+
Example Walkthrough
18+
-------------------
619
An example is provided in `examples/poisson` which will be walked through in this README to better understand
720
the framework
821

922
run_causal_tests.py
10-
-------------------
23+
*******************
1124
`examples/poisson/run_causal_tests.py <https://github.com/CITCOM-project/CausalTestingFramework/blob/main/examples/poisson/run_causal_tests.py>`_
1225
contains python code written by the user to implement scenario specific features
1326
such as:
14-
1. Custom Estimators
15-
2. Causal Variable specification
16-
3. Causal test case outcomes
17-
4. Meta constraint functions
18-
5. Mapping JSON distributions, effects, and estimators to python objects
27+
#. Custom Estimators
28+
#. Causal Variable specification
29+
#. Causal test case outcomes
30+
#. Meta constraint functions
31+
#. Mapping JSON distributions, effects, and estimators to python objects
1932

2033
Use case specific information is also declared here such as the paths to the relevant files needed for the tests.
2134

2235
causal_tests.json
23-
-----------------
36+
*****************
2437
`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
2538
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:
2639
Each test requires:
@@ -45,7 +58,9 @@ The second method of specifying a test is to specify the test in a concrete form
4558
#. skip
4659

4760
Run Commands
48-
------------
61+
************
62+
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.
63+
4964
To run the JSON frontend example from the root directory of the project, use::
5065

5166
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

0 commit comments

Comments
 (0)