Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mmikhasenko/threebodydecaysio.jl
https://github.com/mmikhasenko/threebodydecaysio.jl
Last synced: about 12 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/mmikhasenko/threebodydecaysio.jl
- Owner: mmikhasenko
- Created: 2024-02-16T14:06:09.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-09-15T20:57:14.000Z (4 months ago)
- Last Synced: 2024-09-15T21:57:25.494Z (4 months ago)
- Language: Julia
- Size: 123 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ThreeBodyDecaysIO
## Overview
`ThreeBodyDecaysIO` is a Julia module designed for the serialization and deserialization of models related to three-body decays in particle physics. It leverages the `ThreeBodyDecays` framework to provide comprehensive support for reading and writing model descriptions, facilitating the exchange of complex decay models and their kinematic configurations.
## Features
- Serialization and deserialization of three-body decay models to and from JSON format.
- Support for detailed kinematics, lineshapes, and interaction chains descriptions.
- Utilities for validation and manipulation of model components.## Installation
To install `ThreeBodyDecaysIO`, use the Julia package manager. From the Julia REPL, type the following:
```julia
Pkg.add(url="https://github.com/mmikhasenko/ThreeBodyDecaysIO.jl")
```## Usage
### Basic Example
Here is a basic example of using `ThreeBodyDecaysIO` to serialize a three-body decay model to JSON:
```julia
using ThreeBodyDecaysIO# Define your model here
model = defineYourModel()# Serialize to dictionary
dict = serializeToDict(model)# Write to a JSON file
open("model.json", "w") do io
JSON.print(io, dict, 4)
end
```### Reading a Model
To read a model from a JSON file and parse it:
```julia
using ThreeBodyDecaysIO# Read from JSON
json_content = open("model.json") do io
JSON.parse(io)
end# Parse the model
model = dict2instance(ThreeBodyDecay, json_content)
```## Running Tests
To ensure `ThreeBodyDecaysIO` is working correctly, you can run its test suite:
```julia
using Pkg
Pkg.test("ThreeBodyDecaysIO")
```This will execute a series of tests, verifying the functionality of model serialization/deserialization, kinematics parsing, and more. See details in [`test/runtests.jl`](test/runtests.jl)
## Contributing
Contributions to `ThreeBodyDecaysIO` are welcome. To contribute, please fork the repository, make your changes, and submit a pull request.