You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/frontends/json_front_end.rst
+23-8Lines changed: 23 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,24 +3,37 @@ JSON Frontend
3
3
The JSON frontend allows Causal Tests and parameters to be specified in JSON to allow for tests to be quickly written
4
4
whilst retaining the flexibility of the Causal Testing Framework (CTF).
5
5
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
+
-------------------
6
19
An example is provided in `examples/poisson` which will be walked through in this README to better understand
contains python code written by the user to implement scenario specific features
13
26
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
19
32
20
33
Use case specific information is also declared here such as the paths to the relevant files needed for the tests.
21
34
22
35
causal_tests.json
23
-
-----------------
36
+
*****************
24
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
25
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:
26
39
Each test requires:
@@ -45,7 +58,9 @@ The second method of specifying a test is to specify the test in a concrete form
45
58
#. skip
46
59
47
60
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
+
49
64
To run the JSON frontend example from the root directory of the project, use::
0 commit comments