-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:cta-observatory/lstosa into cfg_pac…
…kage
- Loading branch information
Showing
26 changed files
with
252 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,81 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- '**' | ||
pull_request: | ||
|
||
env: | ||
MPLBACKEND: Agg | ||
PYTEST_ADDOPTS: --color=yes | ||
|
||
jobs: | ||
pyflakes: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: pyflakes | ||
run: | | ||
pip install pyflakes | ||
pyflakes osa | ||
tests: | ||
needs: pyflakes | ||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
strategy: | ||
matrix: | ||
python-version: [ 3.7, 3.8 ] | ||
python-version: [3.7, 3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
- name: Setup Miniconda | ||
uses: conda-incubator/setup-miniconda@v2.1.1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
mamba-version: "*" | ||
auto-update-conda: true | ||
activate-environment: "osa-ci" | ||
environment-file: environment.yml | ||
|
||
- name: Install dependencies | ||
env: | ||
PYTHON_VERSION: ${{ matrix.python-version }} | ||
|
||
run: | | ||
. $CONDA/etc/profile.d/conda.sh | ||
conda config --set always_yes yes --set changeps1 no | ||
sed -i -e "s/- python=.*/- python=$PYTHON_VERSION/g" environment.yml | ||
echo "Creating conda env" | ||
conda install -c conda-forge mamba | ||
mamba env create -n ci -f environment.yml | ||
conda activate ci | ||
python --version | ||
echo "Installing additional pip packages" | ||
pip install pyflakes | ||
echo "pip install ." | ||
pip install . | ||
- name: Run pyflakes | ||
# need to use a login shell for the conda setup to work | ||
run: | | ||
. $CONDA/etc/profile.d/conda.sh | ||
conda activate ci | ||
pyflakes osa | ||
- name: Tests | ||
env: | ||
COVERAGE_PROCESS_START: .coveragerc | ||
PYTHONPATH: . | ||
|
||
run: | | ||
# github actions starts a new shell for each "step", so we need to | ||
# activate our env again | ||
source $CONDA/etc/profile.d/conda.sh | ||
conda activate ci | ||
# to measure coverage when using subprocess for testing scripts we create sitecustomize.py | ||
# as specified in https://coverage.readthedocs.io/en/latest/subprocess.html | ||
# to initialize the coverage start up. | ||
echo "create sitecustomize.py" | ||
echo "import coverage; coverage.process_startup()" > $PYTHONPATH/sitecustomize.py | ||
pytest --basetemp=test_osa -v --cov --cov-report=xml osa | ||
cat coverage.xml | ||
- name: Codecov | ||
uses: codecov/codecov-action@v2 | ||
uses: codecov/codecov-action@v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,3 +92,6 @@ target | |
NightSummary/ | ||
testweb.sh | ||
misc/ | ||
|
||
# Ignore generated _version.py | ||
_version.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# lstosa | ||
|
||
[![ci](https://github.com/cta-observatory/lstosa/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/cta-observatory/lstosa/actions/workflows/ci.yml) | ||
[![Documentation Status](https://readthedocs.org/projects/lstosa/badge/?version=latest)](https://lstosa.readthedocs.io/en/latest/?badge=latest) | ||
[![coverage](https://codecov.io/gh/cta-observatory/lstosa/branch/main/graph/badge.svg?token=Zjk1U1ytaG)](https://codecov.io/gh/cta-observatory/lstosa) | ||
[![quality](https://app.codacy.com/project/badge/Grade/a8743a706e7c45fc989d5ebc4d61d54f)](https://www.codacy.com/gh/cta-observatory/lstosa/dashboard?utm_source=github.com&utm_medium=referral&utm_content=cta-observatory/lstosa&utm_campaign=Badge_Grade) | ||
|
||
|
||
On-Site processing pipeline for the the Large Size Telescope prototype | ||
of [CTA](https://www.cta-observatory.org/) (Cherenkov Telescope Array). | ||
|
||
This is a prototype data processing framework under development based on | ||
[cta-lstchain](https://github.com/cta-observatory/cta-lstchain) . | ||
|
||
- Code: <https://github.com/cta-observatory/lstosa> | ||
- Docs: <https://lstosa.readthedocs.io/> | ||
- License: | ||
[BSD-3-Clause](https://github.com/cta-observatory/lstosa/blob/main/LICENSE) | ||
|
||
# Install | ||
|
||
- Install miniconda first. | ||
- Create and activate the conda environment including | ||
[cta-lstchain](https://github.com/cta-observatory/cta-lstchain) and | ||
[ctapipe_io_lst](https://github.com/cta-observatory/ctapipe_io_lst): | ||
|
||
```bash | ||
git clone https://github.com/cta-observatory/lstosa.git | ||
cd lstosa | ||
conda env create -n osa -f environment.yml | ||
conda activate osa | ||
``` | ||
|
||
In case you want to install the lstchain master version instead of a fixed tag you can run inside the `osa` environment: | ||
|
||
```bash | ||
pip install git+https://github.com/cta-observatory/cta-lstchain | ||
``` | ||
|
||
- To update the environment (provided dependencies get updated) use: | ||
|
||
```bash | ||
conda env update -n osa -f environment.yml | ||
``` | ||
|
||
- Install `lstosa`: | ||
|
||
```bash | ||
pip install . | ||
``` | ||
|
||
# Data workflow | ||
|
||
```mermaid | ||
graph TD | ||
A[R0] -->|r0_to_dl1| B(DL1a) & C(muons) | ||
B --> |dl1ab| D(DL1ab) | ||
D --> |dl1_to_dl2| E[DL2] | ||
D & C--> |check_dl1| F[DL1 datacheck] | ||
E --> |merge_hdf5_files| G(DL2 merged) | ||
G & J--> |create_dl3_file| H(DL3) | ||
I(DL2 gamma MC) --> |create_irf_files| J(IRF) | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Try to use setuptools_scm to get the current version; this is only used | ||
# in development installations from the git repository. | ||
# see lstosa/version.py for details. Taken from ctapipe project. | ||
try: | ||
from setuptools_scm import get_version | ||
|
||
version = get_version(root="../..", relative_to=__file__) | ||
except Exception as e: | ||
raise ImportError(f"setuptools_scm broken or not installed: {e}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.