Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
27 changes: 0 additions & 27 deletions .github/workflows/flake8.yml

This file was deleted.

66 changes: 55 additions & 11 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
## Super Linter GitHub Actions ##
name: Lint Code Base
name: CI-linting

# Start the job on all push #
on:
workflow_dispatch:
pull_request:
branches: [main]
types: [opened, synchronize]
Expand All @@ -12,35 +11,80 @@ on:
- main

jobs:
build:
name: Lint Code Base

linting:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -leo pipefail {0}

permissions:
contents: read
packages: read
statuses: write

steps:
- name: Checkout Code
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"


- name: Check for non-ASCII characters
run: |
output=$(find . -type f \
\( -name "*.py" -o -name "*.rst" -o -name "*.yml" -o -name "*.toml" \) \
-exec perl -ne 'print if /[^[:ascii:]]/ && !/latin/i' {} \;)
if [ -n "$output" ]; then
echo "Non-ASCII characters found in documentation."
exit 1
fi

- name: install packages not included in super-linter
run: |
pip install validate-pyproject

- name: pyproject.toml
run: |
validate-pyproject pyproject.toml

- name: Check whether the citation metadata from CITATION.cff is valid
uses: citation-file-format/cffconvert-github-action@2.0.0
with:
args: "--validate"

# Dependencies required to avoid errors
# reported by linters
- name: Install mamba dependencies
uses: mamba-org/setup-micromamba@v2
with:
environment-file: environment.yml
init-shell: bash

- name: Python dependencies
run: |
pip install -e '.[tests,dev,doc]'

- name: Pre-commit
run: |
pre-commit run --all-files

- name: Lint Code Base
uses: super-linter/super-linter@v7
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_GITHUB_ACTIONS: true
VALIDATE_YAML: true
VALIDATE_PYTHON_ISORT: true
VALIDATE_PYTHON_FLAKE8: true
VALIDATE_PYTHON_BLACK: true
VALIDATE_MARKDOWN: true
VALIDATE_NATURAL_LANGUAGE: true
VALIDATE_DOCKERFILE_HADOLINT: true
VALIDATE_BASH: true
LINTER_RULES_PATH: ./
PYTHON_BLACK_CONFIG_FILE: pyproject.toml
PYTHON_ISORT_CONFIG_FILE: pyproject.toml

DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ __pycache__/
v2dl5.egg-info

v2dl5/_version.py

.vscode
6 changes: 1 addition & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
---
repos:
# https://pycqa.github.io/isort/docs/configuration/black_compatibility.html#integration-with-pre-commit
- repo: https://github.com/pycqa/isort
rev: 6.0.1
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]
- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black
args: ["--line-length=100"]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff
rev: v0.11.4
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Allows to run analysis scripts for a given list of runs or for a cone search aro

- source detection analysis including integral flux (or flux upper limits), reflection region model
- spectral analysis, reflected region model
- run-list generation
- light-curve analysis and plotting

## Installation

Expand All @@ -28,17 +30,17 @@ conda activate v2dl5
pip install -e .
```

## V2DL5 Analysis
## Analysis

### Run list generator

The tool `runlist.py` allows to generate a list of runs for a given observation time and zenith angle.
The tool `generate_run_list.py` allows to generate a list of runs for a given observation time and zenith angle.
It generates a lot of printout which should be used to fine tune the run selection.

Example:

```console
python v2dl5/scripts/generate_runlist.py \
python v2dl5/scripts/generate_run_list.py \
--obs_table ../../../VTS/DL3/v490/dl3_pointlike_moderate2tel/obs-index.fits.gz \
--config examples/run_selection.yml \
--output_dir my_output_dir
Expand Down Expand Up @@ -68,7 +70,7 @@ python v2dl5/scripts/plot_binary_light_curves.py \

### Auxiliary data

Auxiliary data is stored in v2dl5/data and available at run time. This includes:
Auxiliary data is stored in v2dl5/data and available at runtime. This includes:

#### Star catalogues

Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ dependencies:
- pytest-xdist
- python
- scipy
- uproot
8 changes: 4 additions & 4 deletions eventdisplay_anasum/light_curve_analysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ fi

light_curves()
{
ANASUM_FILE="/data/$(basename $1)"
TIME_FILE="/time_data/$(basename $2)"
ANASUM_FILE="/data/$(basename "$1")"
TIME_FILE="/time_data/$(basename "$2")"
podman run --platform linux/amd64 --rm -it -v "$(pwd)/:/workdir" \
-v "$(dirname $1):/data" \
-v "$(dirname $2):/time_data" \
-v "$(dirname "$1"):/data" \
-v "$(dirname "$2"):/time_data" \
ghcr.io/veritas-observatory/eventdisplay_v4:main \
/bin/bash -c \
"cd /workdir/; root -l -q -b 'light_curve_analysis.C(\"$ANASUM_FILE\", \"$TIME_FILE\", $3, $4, $5)';"
Expand Down
50 changes: 0 additions & 50 deletions eventdisplay_anasum/nightly_time_bins.C

This file was deleted.

22 changes: 0 additions & 22 deletions eventdisplay_anasum/nightly_time_bins.sh

This file was deleted.

8 changes: 4 additions & 4 deletions eventdisplay_anasum/runlist_from_time_bins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ fi

runlist_from_time_bins()
{
ANASUM_FILE="/data/$(basename $1)"
TIME_FILE="/time_data/$(basename $2)"
ANASUM_FILE="/data/$(basename "$1")"
TIME_FILE="/time_data/$(basename "$2")"
podman run --platform linux/amd64 --rm -it -v "$(pwd)/:/workdir" \
-v "$(dirname $1):/data" \
-v "$(dirname $2):/time_data" \
-v "$(dirname "$1"):/data" \
-v "$(dirname "$2"):/time_data" \
ghcr.io/veritas-observatory/eventdisplay_v4:main \
/bin/bash -c \
"cd /workdir/; root -l -q -b 'runlist_from_time_bins.C(\"$ANASUM_FILE\", \"$TIME_FILE\", $3)';"
Expand Down
Loading