Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DX: add spelling checker and improve texts #28

Merged
merged 10 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"dictionaries": ["physics", "project"],
"dictionaryDefinitions": [
{
"addWords": true,
"name": "julia",
"path": "./.cspell/julia.txt"
},
{
"addWords": true,
"name": "project",
"path": "./.cspell/project.txt"
},
{
"addWords": true,
"name": "physics",
"path": "./.cspell/physics.txt"
}
],
"enableFiletypes": ["julia", "quarto"],
"ignorePaths": [
".cspell.json",
".cspell/*.txt",
".editorconfig",
".github/workflows",
".gitignore",
".pre-commit-config.yaml",
".taplo.toml",
".vscode/*.json",
"json_options.jl",
"Manifest.toml",
"models/*.json",
"pixi.lock",
"pixi.toml",
"Project.toml",
"pyproject.toml",
"read_json.jl"
],
"language": "en-US",
"languageSettings": [
{
"dictionaries": ["julia", "physics", "project"],
"languageId": ["julia", "quarto", "text"]
}
],
"version": "0.2"
}
15 changes: 15 additions & 0 deletions .cspell/julia.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
compat
eachslice
guidefonthalign
guidefontvalign
joinpath
lims
minorticks
mlims
Mmap
quadgk
struct
xlab
xlim
ylab
ylim
15 changes: 15 additions & 0 deletions .cspell/physics.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Blatt
Breit
Bugg
Clebsch
Dalitz
Flatté
Gordan
helicities
helicity
Jpsi
lineshape
lineshapes
parametrizations
recoupling
Weisskopf
4 changes: 4 additions & 0 deletions .cspell/project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Mikhasenko
Misha
multline
Semileptonic
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v8.8.0
hooks:
- id: cspell

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
Expand Down
1 change: 1 addition & 0 deletions docs/_quarto.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# cspell:ignore pkpi subdir
execute:
cache: true
enabled: true
Expand Down
114 changes: 69 additions & 45 deletions docs/description.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Each decay chain is described by a JSON object containing five mandatory fields:

### Topology

Tolopogy of a decay is a tree of intermediate decays given in a compact form using brackets.
Topology of a decay is a tree of intermediate decays given in a compact form using brackets.
In this notation, each pair of brackets indicate the node and it's children.
The name of the node is simply given by its decay in the same bracket notations.

Expand Down Expand Up @@ -108,7 +108,7 @@ quantization axes must be adjusted by using appropriate wigner rotations.

### Appendix

The `appendix` gives definition to the text keys used elsewhere in the desciption. These definions are inserted recursively, while processing the json file.
The `appendix` gives definition to the text keys used elsewhere in the description. These definitions are inserted recursively, while processing the json file.

### Complex numbers

Expand Down
22 changes: 10 additions & 12 deletions docs/julia/lc2pkpi.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jupyter: julia-amplitude-serialization-1.10

# $\Lambda_c^+ \to p K^- \pi^+$

This page demostrates deserialization and evaluation of an amplitude model for the decay $\Lambda_c^+ \to p K^- \pi^+$. The amplitude analysis is performed based on roughly half a millon of $\Lambda_c^{\pm}$ decay candidates by the LHCb collaboration, [INSPIRE-HEP 2683025](https://inspirehep.net/literature/2683025). Detains on the mapped of the ampltude model onto the standard helicity formalism can be found in appendix of [INSPIRE-HEP 2623821](https://inspirehep.net/literature/2623821).
This page demonstrates deserialization and evaluation of an amplitude model for the decay $\Lambda_c^+ \to p K^- \pi^+$. The amplitude analysis is performed based on roughly half a million of $\Lambda_c^{\pm}$ decay candidates by the LHCb collaboration, [INSPIRE-HEP 2683025](https://inspirehep.net/literature/2683025). Details on the mapped of the amplitude model onto the standard helicity formalism can be found in appendix of [INSPIRE-HEP 2623821](https://inspirehep.net/literature/2623821).

```{julia}
#| code-fold: true
Expand Down Expand Up @@ -34,8 +34,8 @@ theme(:wong2, frame=:box, grid=false, minorticks=true,

## Function definitions

Non-standard lineshapes are used to model resonances that do not conform to a simple `BreitWigner` distributions, or a `MultichannelBreitWigner` has to be defined explicitly.
The code below defines a new lineshape, and its deserialization method.
The model contains non-standard lineshapes that do not conform to a simple `BreitWigner` or `MultichannelBreitWigner` distribution, so they have to be defined explicitly.
The code below defines a new lineshape and implements its deserialization method (specializing `dict2instance()` using [multiple dispatch](https://docs.julialang.org/en/v1/manual/methods/#man-method-specializations)).

```{julia}
struct BreitWignerWidthExpLikeBugg <: HadronicLineshapes.AbstractFlexFunc
Expand All @@ -59,7 +59,7 @@ end

## Deserialization of Objects to a Workspace

Model components are deserialized from a JSON file into computational objects within a workspace for further manipulation. First, functions representing lineshapes and formfactors are built. Following this, distributions are processed and added to the workspace.
Model components are deserialized from a JSON file into computational objects within a workspace for further manipulation. First, functions representing lineshapes and form factors are built. Following this, distributions are processed and added to the workspace.

```{julia}
input = open(joinpath(@__DIR__, "..", "..", "models", "Lc2ppiK.json")) do io
Expand All @@ -86,7 +86,7 @@ end
## Validation

The integrity of the model is checked by validating the value of distributions at a few phase space points.
The table lists the validation checkes and their status ("🟢" or "🔴").
The table lists the validation checks and their status ("🟢" or "🔴").

```{julia}
#| code-fold: true
Expand Down Expand Up @@ -119,7 +119,7 @@ end

## Visualization

The model descibing the decay is fetched from the workspace
The model describing the decay is fetched from the workspace

```{julia}
model_dist = [v for (k, v) in workspace if v isa HadronicUnpolarizedIntensity] |> first;
Expand All @@ -144,8 +144,6 @@ let iσx = 2, iσy = 1
end
```


c
The projection of the model onto a mass variable is shown by black line.
Contributions from individual resonances are shown by the colored lines.

Expand Down Expand Up @@ -201,13 +199,13 @@ let
#
chain_names = Set(model.names) |> collect |> sort
_int_i = map(chain_names) do name
_calv = unpolarized_intensity.(model[model.names.==name] |> Ref, data)
_value = mean(_calv)
_err = sqrt(cov(_calv, _calv) / length(data))
_intensities = unpolarized_intensity.(model[model.names.==name] |> Ref, data)
_value = mean(_intensities)
_err = sqrt(cov(_intensities, _intensities) / length(data))
_value ± _err
end
_int0 = sum(unpolarized_intensity.(model |> Ref, data)) / length(data)
ff = round.(_int_i ./ _int0 .* 100; digits=2)
DataFrame("Resonance" => chain_names, "Fit Franction [%]" => ff)
DataFrame("Resonance" => chain_names, "Fit Fraction [%]" => ff)
end
```
2 changes: 1 addition & 1 deletion json_options.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ using JSON
md"""
# Example of Serialized Model

The notebook prototypes the way to desctibe model in a dictionary that can be mapped into a readable dictionary.
The notebook prototypes the way to describe model in a dictionary that can be mapped into a readable dictionary.
"""

# ╔═╡ ce089b5b-c3ea-4926-b03f-f2d8b969e475
Expand Down