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
54 changes: 54 additions & 0 deletions .github/conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{% set name = "dl1_data_handler" %}
{% set version = os.environ.get('PACKAGE_VERSION', '0.0.0+dev') %}

package:
name: {{ name }}
version: {{ version }}

source:

path: ../../

build:
noarch: python
number: 0
script: "{{ PYTHON }} -m pip install . --no-deps -vv"

requirements:
host:
- python >=3.10
- pip
- setuptools >=65
- setuptools_scm >=6.2
run:
- python >=3.10
- astropy
- numpy
- pandas
- pyyaml
- scipy
- traitlets
- pydot
- setuptools
- ctapipe>=0.23,<0.26


test:
imports:
- dl1_data_handler

about:
home: https://github.com/cta-observatory/dl1-data-handler
license: BSD-3-Clause
summary: "Utilities for reading and processing CTA R1/DL0/DL1 data in a standardized format."
description: |
A package of utilities for reading and applying image processing to Cherenkov Telescope Array (CTA)
R1/DL0/DL1 data in a standardized format. Created primarily for testing machine learning image
analysis techniques on IACT data.
dev_url: https://github.com/cta-observatory/dl1-data-handler

extra:
recipe-maintainers:
- Daniel Nieto
- Tjark Miener
- Alexander Cervino
59 changes: 59 additions & 0 deletions .github/workflows/release_conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Release Conda

on:
release:
types: [published]
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-22.04

steps:
- name: Checkout repository and fetch tags
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Miniconda and Conda Tools
uses: conda-incubator/setup-miniconda@v3
with:
python-version: '3.10'
channels: conda-forge
auto-update-conda: true
mamba-version: "*"
activate-environment: false

- name: Install anaconda-client and conda-build
shell: bash
run: |
mamba install anaconda-client conda-build -y

- name: Conda Build and Upload Package
shell: bash
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
CONDA_RECIPE_DIR=".github/conda"
ANACONDA_CHANNEL="ctlearn-project"

FULL_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0+dev")
VERSION="${FULL_TAG#v}"
VERSION="${VERSION#V}"

echo "Building package version: $VERSION"
export PACKAGE_VERSION=$VERSION

conda run conda build $CONDA_RECIPE_DIR

PACKAGE_PATH=$(conda run conda build $CONDA_RECIPE_DIR --output)

if [[ "$VERSION" != "0.0.0+dev" ]]; then
echo "Uploading $PACKAGE_PATH to $ANACONDA_CHANNEL channel..."
conda run anaconda upload \
"$PACKAGE_PATH" \
--force \
--user $ANACONDA_CHANNEL
else
echo "Skipping upload: Version is $VERSION (development)."
fi
22 changes: 11 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,26 @@ Previously named image-extractor (v0.1.0 - v0.6.0). Currently under development,
Installation
------------

The following installation method (for Linux) is recommended:
The lastest version fo this package can be installed as a conda or pip package:

Installing as a conda package
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: bash

To install dl1-data-handler as a conda package, first install Anaconda by following the instructions here: https://www.anaconda.com/distribution/.
conda install ctlearn-project::dl1_data_handler

The following command will set up a conda virtual environment, add the
necessary package channels, and install dl1-data-handler specified version and its dependencies:
or

.. code-block:: bash

DL1DH_VER=0.14.5
wget https://raw.githubusercontent.com/cta-observatory/dl1-data-handler/v$DL1DH_VER/environment.yml
conda env create -n [ENVIRONMENT_NAME] -f environment.yml
conda activate [ENVIRONMENT_NAME]
conda install -c ctlearn-project dl1_data_handler=$DL1DH_VER
pip install dl1-data-handler

Installing as a conda package

This should automatically install all dependencies (NOTE: this may take some time, as by default MKL is included as a dependency of NumPy and it is very large).

Developers
------------

We welcome contributions to this package! If you're interested in contributing, please make sure to follow the `ctapipe developer guidelines <https://ctapipe.readthedocs.io/en/latest/developer-guide/getting-started.html>`_.

Links
-----
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
- numpy
- scipy
- pip
- ctapipe>=0.22,<0.26
- ctapipe >=0.23,<0.26
- traitlets
- pyyaml
- pandas
Expand Down