https://github.com/cms-l1-globaltrigger/tm-diff
Convenient data comparison for XML trigger menus
https://github.com/cms-l1-globaltrigger/tm-diff
cern cms-l1-dpg lhc scientific
Last synced: 5 months ago
JSON representation
Convenient data comparison for XML trigger menus
- Host: GitHub
- URL: https://github.com/cms-l1-globaltrigger/tm-diff
- Owner: cms-l1-globaltrigger
- License: gpl-3.0
- Created: 2019-01-30T09:53:13.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2025-12-19T14:53:36.000Z (6 months ago)
- Last Synced: 2025-12-22T05:59:34.615Z (6 months ago)
- Topics: cern, cms-l1-dpg, lhc, scientific
- Language: Python
- Homepage:
- Size: 66.4 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
XML Menu Diff
=============
## Install
```bash
pip install --extra-index-url https://globaltrigger.web.cern.ch/pypi tm-diff
```
## Basic usage
Compare the content of two XML trigger menus.
```bash
tm-diff [-f|--format ] [-s|--skip ] [--sort ]
[-d|--dump] [-o ]
```
### Format
Use flag `-f|--format ` to select diff output format. Options are:
* `unified` for unified diff format
* `context` for contextual diff format
* `html` for a complete diff in as HTML file
* `report` to be copy-pasted into TWiki reports
Default format is `unified`.
**Example:**
```bash
tm-diff ... -fhtml -o diff.html # dumps diff as HTML table to file
```
### Skip
Use flag `-s|--skip ` to ignore certain attributes. Options are
* `module` to skip implementation details (attributes `uuid_firmware`, `n_modules`, `module_id`, `module_index`)
* `comment` to skip comments (attribute `comment`)
* `labels` to skip algorithm labels (attribute `labels`)
**Example:**
```bash
tm-diff ... -smodule -scomment # ignores module_is/index and any comments
```
### Sort
Use flag `--sort ` to sort algorithms by attribute. Options are
* `index` to sort by algorithm index
* `name` to sort by algorithm name
* `expression` to sort by algorithm expression
Default sort kay is `index`.
### Dump
Use flag `-d|--dump` to dump the raw text used to diff the menu contents. This
option will create two text files with the menu names at the current working location.
**Example:**
```bash
tm-diff foo.xml bar.xml -d # dumps raw text to foo.xml.txt bar.xml.txt
```
### Output
Use flag `-o ` to write the output to a file.
**Example:**
```bash
tm-diff foo.xml bar.xml -o diff.txt # write output to file
```
This is equivalent to:
```bash
tm-diff foo.xml bar.xml > diff.txt # pipe stdout to file
```