Skip to content

Commit

Permalink
Change actions_ style in the guide
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaharid committed Mar 22, 2018
1 parent 78d420f commit 8f07cfd
Showing 1 changed file with 40 additions and 73 deletions.
113 changes: 40 additions & 73 deletions doc/validphys2/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ pdfs:
- NNPDF30_nnlo_as_0118
- CT14nlo

norm:
normalize_to: NNPDF30_nlo_as_0118

first:
Q: 1
flavours: [up, down, gluon]
Expand All @@ -143,13 +146,9 @@ second:
xgrid: linear

actions_:
- first:
- plot_pdfreplicas:
normalize_to: NNPDF30_nlo_as_0118

- plot_pdfs
- second:
- plot_pdfreplicas
- first::norm plot_pdfreplicas
- first plot_pdfs
- second plot_pdfreplicas
```

Correct by definition
Expand Down Expand Up @@ -246,11 +245,7 @@ experiments:
- { dataset: ATLASWZRAP36PB}

actions_:
- theoryids:
pdfs:
experiments:
experiment:
- plot_fancy
- theoryids::pdfs::experiments::experiment plot_fancy
```
Will produce a separate plot for each combination of the two theories
Expand Down Expand Up @@ -717,8 +712,8 @@ dataset_input:
cfac: [EWK]
actions_:
- - plot_fancy
- plot_chi2dist
- plot_fancy
- plot_chi2dist
```

Expand All @@ -730,11 +725,12 @@ We are saying that we do not want to use the cuts of the data
(so we don't have to specify a fit containing the cut data).

The special `actions_` key is used to declare the actions we want to
have executed. We want a data/theory comparison (plot_fancy) and to
plot the distribution of the chi² for each replica (plot_chi2dist). If we
save the above runcard to a file called `runcard.yaml`
we
can produce the plots with:
have executed. The syntax is the same as for the targets inside the
report, and discussed in detail in the [Report template
specification]. We want a data/theory comparison (plot_fancy) and to
plot the distribution of the chi² for each replica (plot_chi2dist). If
we save the above runcard to a file called `runcard.yaml` we can
produce the plots with:
```bash
validphys runcard.yaml
```
Expand Down Expand Up @@ -767,11 +763,8 @@ dataset_input:
cfac: [EWK]
actions_:
- with_cuts:
- plot_fancy
- without_cuts:
- plot_chi2dist
- with_cuts plot_fancy
- without_cuts plot_chi2dist
```

Expand Down Expand Up @@ -804,11 +797,9 @@ dataset_input:
cfac: [EWK]
actions_:
- with_cuts:
- plot_fancy
- with_cuts plot_fancy
- without_cuts:
- plot_chi2dist
- without_cuts plot_chi2dist
```

Expand Down Expand Up @@ -843,8 +834,7 @@ dataset_input:
cfac: [EWK]
actions_:
- specifications:
- plot_fancy
- specifications plot_fancy
```

Expand Down Expand Up @@ -880,7 +870,7 @@ dataset_input:
cfac: [EWK]
actions_:
- - plot_fancy
- plot_fancy
```

Expand All @@ -902,8 +892,7 @@ dataset_input:
cfac: [EWK]
actions_:
- pdfs:
- plot_fancy
- pdfs plot_fancy
```

Expand Down Expand Up @@ -954,12 +943,7 @@ experiments:
- { dataset: ATLASWZRAP36PB}
actions_:
- with_cuts:
theoryids:
pdfs:
experiments:
experiment:
- plot_fancy
- with_cuts::theoryids::pdfs::experiments::experiment plot_fancy
```

Expand Down Expand Up @@ -1017,13 +1001,9 @@ second:
xgrid: linear
actions_:
- first:
- plot_pdfreplicas:
normalize_to: NNPDF30_nlo_as_0118
- plot_pdfs
- second:
- plot_pdfreplicas
- first::plot_pdfreplicas (normalize_to=NNPDF30_nlo_as_0118)
- first plot_pdfs
- second plot_pdfreplicas
```

The `normalize_to` key only affects the `plot_pdfreplicas` action.
Expand Down Expand Up @@ -1069,8 +1049,7 @@ experiments:
from_: fit
actions_:
- - report:
out_filename: index.md
- report(out_filename=index.md)
```

Expand Down Expand Up @@ -1125,8 +1104,7 @@ experiments:
from_: fit
actions_:
- fits:
- report
- fits report
```
This will work exactly as the example above, except that a new action
(with its corresponding different set of resources) will be generated
Expand Down Expand Up @@ -1162,9 +1140,7 @@ pdfs:
- NNPDF30_nlo_as_0118
actions_:
- fits:
fitcontext:
- report
- fits::fitcontext report
```

Note that one still needs to set manually other keys like `description` and `pdfs`.
Expand Down Expand Up @@ -1231,9 +1207,7 @@ template_text: |
{@endwith@}

actions_:
- - report:
main: True
mathjax: True
- report(main=True, mathjax=True)

```

Expand Down Expand Up @@ -1308,8 +1282,7 @@ template_text: |
{@plot_dataspecs_as_value_error@}
actions_:
- - report:
main: True
- report(main=True)

```

Expand Down Expand Up @@ -1594,8 +1567,7 @@ template_text: |
{@plot_fancy_dataspecs@}
actions_:
- - report:
main: True
- report(main=True)
```

Expand Down Expand Up @@ -1645,8 +1617,7 @@ template_text: |
{@endwith@}
actions_:
- - report:
main: True
- report(main=True)
```
Here we are taking the experiments and cuts from a different fit,
Expand Down Expand Up @@ -1741,8 +1712,7 @@ of priority:
~~~yaml
template: mytemplate.md
actions_:
- - report:
main: True
- report(main=True)
~~~
and you would begin `mytemplate.md`, using YAML syntax, like:
```yaml
Expand Down Expand Up @@ -2059,8 +2029,8 @@ Then, an input card like the following:
pdf: NNPDF30_nlo_as_0118

actions_:
- - plot1
- plot2
- plot1
- plot2
```
Would result in the following DAG:
Expand Down Expand Up @@ -2100,9 +2070,8 @@ scan_params:


actions_:
- scan_params:
- plot1
- plot2
- scan_params plot1
- scan_params plot2
```
which would result in the following computation:
Expand All @@ -2128,9 +2097,7 @@ scan_params:
actions_:
- pdfs:
scan_params:
- plot1
- pdfs::scan_params plot1
```

The corresponding graph would be:
Expand Down Expand Up @@ -2485,7 +2452,7 @@ fits:
use_cuts: True
actions_:
- - print_fits_experiments_chi2
- print_fits_experiments_chi2
```


Expand Down

0 comments on commit 8f07cfd

Please sign in to comment.