diff --git a/.github/dependabot.yml b/.github/dependabot.yml index dfd0e30..bd2df04 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,3 +1,4 @@ +--- # Set update schedule for GitHub Actions version: 2 diff --git a/.github/workflows/citation-validation.yml b/.github/workflows/citation-validation.yml index 886126d..cce0a90 100644 --- a/.github/workflows/citation-validation.yml +++ b/.github/workflows/citation-validation.yml @@ -1,3 +1,4 @@ +--- on: pull_request: branches: [main] diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 98c2986..362e585 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -80,7 +80,6 @@ jobs: VALIDATE_ALL_CODEBASE: false VALIDATE_GITHUB_ACTIONS: true VALIDATE_YAML: true - VALIDATE_MARKDOWN: true VALIDATE_NATURAL_LANGUAGE: true VALIDATE_DOCKERFILE_HADOLINT: true VALIDATE_BASH: true diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 2fd24d7..693a3b4 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -1,3 +1,4 @@ +--- # Derived from https://github.com/cta-observatory/project-template-python-pure/blob/main/.github/workflows/pypi.yml name: Deploy to PyPi diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 692b559..0b983c5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,9 +6,9 @@ repos: hooks: - id: isort args: ["--profile", "black", "--filter-files"] - - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff - rev: v0.11.4 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.11.12 hooks: - id: ruff args: ["--fix"] @@ -20,12 +20,6 @@ repos: - id: end-of-file-fixer - id: check-added-large-files args: ['--maxkb=500'] - # https://github.com/HunterMcGushion/docstr_coverage -# - repo: https://github.com/HunterMcGushion/docstr_coverage -# rev: v2.3.2 # most recent docstr-coverage release or commit sha -# hooks: -# - id: docstr-coverage -# args: ["--verbose", "2", "--fail-under", "70.", "v2dl5"] # Github action - repo: https://github.com/rhysd/actionlint rev: v1.7.7 @@ -33,7 +27,7 @@ repos: - id: actionlint # https://pyproject-fmt.readthedocs.io/en/latest/ - repo: https://github.com/tox-dev/pyproject-fmt - rev: "v2.5.1" + rev: "v2.6.0" hooks: - id: pyproject-fmt # codespell @@ -41,3 +35,33 @@ repos: rev: v2.4.1 hooks: - id: codespell + # markdownlint + - repo: https://github.com/igorshubovych/markdownlint-cli + rev: v0.45.0 + hooks: + - id: markdownlint + args: ["--disable", "MD041"] + # yamllint + - repo: https://github.com/adrienverge/yamllint.git + rev: v1.37.1 + hooks: + - id: yamllint + args: + - "--strict" + - "-d" + - > + { + extends: default, + rules: { + line-length: {max: 300}, + indentation: {spaces: 2, indent-sequences: consistent}, + truthy: {allowed-values: ["true", "false", "on", "off"]} + } + } + # towncrier + - repo: https://github.com/twisted/towncrier + rev: 24.8.0 + hooks: + - id: towncrier-update + files: $docs/changes/ + args: ['--keep'] diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..cc4480c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,10 @@ +# CHANGELOG + +All notable changes to the V2DL5-Binary-Analysis project will be documented in this file. +Changes for upcoming releases can be found in the [docs/changes](docs/changes) directory. +Note that changes before release 0.5.0 are not documented here, but can be found in the +[GitHub repository](https://github.com/VERITAS-Observatory/V2DL5-Binary-Analysis/releases). + +This changelog is generated using [Towncrier](https://towncrier.readthedocs.io/). + + diff --git a/docs/changes/.gitkeep b/docs/changes/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/changes/53.maintenance.md b/docs/changes/53.maintenance.md new file mode 100644 index 0000000..5c10f7b --- /dev/null +++ b/docs/changes/53.maintenance.md @@ -0,0 +1 @@ +Add towncrier functionality for changelogs. diff --git a/environment.yml b/environment.yml index 5972173..557aad3 100644 --- a/environment.yml +++ b/environment.yml @@ -1,3 +1,4 @@ +--- # installation: # create: mamba env create -f environment.yml # activate: conda activate v2dl5 diff --git a/examples/binary_lightcurve_plotting.yml b/examples/binary_lightcurve_plotting.yml index 7764edb..485db5b 100644 --- a/examples/binary_lightcurve_plotting.yml +++ b/examples/binary_lightcurve_plotting.yml @@ -1,8 +1,9 @@ +--- data: - - instrument: VERITAS - file_name: results/light_curve_nightly.ecsv - plot_instrument: true - plot_variable: flux - flux_axis_label: "Flux E>350 GeV (1/(cm$^2$s))" - marker_type: 'o' - marker_color: 'r' + - instrument: VERITAS + file_name: results/light_curve_nightly.ecsv + plot_instrument: true + plot_variable: flux + flux_axis_label: "Flux E>350 GeV (1/(cm$^2$s))" + marker_type: 'o' + marker_color: 'r' diff --git a/examples/reflected_region.yml b/examples/reflected_region.yml index 6b9dd64..1e0f61c 100644 --- a/examples/reflected_region.yml +++ b/examples/reflected_region.yml @@ -2,61 +2,61 @@ # Configuration for a reflected region analysis observations: - datastore: ../../../VTS/DL3/v491/dl3_pointlike_moderate2tel/ - # search for observations around the target direction - # within a maximum offset of obs_cone_radius - obs_cone_radius: 1.5 deg - required_irf: ['aeff', 'edisp'] + datastore: ../../../VTS/DL3/v491/dl3_pointlike_moderate2tel/ + # search for observations around the target direction + # within a maximum offset of obs_cone_radius + obs_cone_radius: 1.5 deg + required_irf: ['aeff', 'edisp'] on_region: - target: "Crab" -# frame: icrs -# lon: 83.628700 deg -# lat: 22.014700 deg + target: "Crab" +# frame: icrs +# lon: 83.628700 deg +# lat: 22.014700 deg datasets: - type: 1d - stack: false - geom: - axes: - energy: {min: 0.1 TeV, max: 100 TeV, nbins: 30} - energy_true: {min: 0.05 TeV, max: 100 TeV, nbins: 40} - exclusion_region: - on_radius: 0.5 deg - magnitude_B: 7 - star_exclusion_radius: 0.30 deg - fov: 3.5 deg - star_file: hip_mag9.fits.gz - containment_correction: false - safe_mask: - methods: ['aeff-max'] - parameters: {aeff_percent: 10.} - background: - method: reflected + type: 1d + stack: false + geom: + axes: + energy: {min: 0.1 TeV, max: 100 TeV, nbins: 30} + energy_true: {min: 0.05 TeV, max: 100 TeV, nbins: 40} + exclusion_region: + on_radius: 0.5 deg + magnitude_B: 7 + star_exclusion_radius: 0.30 deg + fov: 3.5 deg + star_file: hip_mag9.fits.gz + containment_correction: false + safe_mask: + methods: ['aeff-max'] + parameters: {aeff_percent: 10.} + background: + method: reflected fit: - model: pl - index: 2.5 - reference_energy: 1 TeV + model: pl + index: 2.5 + reference_energy: 1 TeV flux_points: - energy: {min: 0.1 TeV, max: 20 TeV, nbins: 10} - flux: {min: 1.e-15, max: 1.e-9} + energy: {min: 0.1 TeV, max: 20 TeV, nbins: 10} + flux: {min: 1.e-15, max: 1.e-9} light_curve: - energy: {min: 1. TeV, max: 100 TeV} - time_zone: -7 - n_jobs: 4 - # time_bin_files: - # - ./light_curve_3days_timebins.ecsv + energy: {min: 1. TeV, max: 100 TeV} + time_zone: -7 + n_jobs: 4 + # time_bin_files: + # - ./light_curve_3days_timebins.ecsv # bad time intervals (time intervals removed from data) bti: - - run: 64080 - bti_start: 600 - bti_length: 360 - - run: 69976 - bti_start: 600 - bti_length: 360 - - run: 69976 - bti_start: 1000 - bti_length: 200 + - run: 64080 + bti_start: 600 + bti_length: 360 + - run: 69976 + bti_start: 600 + bti_length: 360 + - run: 69976 + bti_start: 1000 + bti_length: 200