Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
be15ea5
upgrade some versions
TjarkMiener Dec 13, 2025
f040131
polish CI
TjarkMiener Dec 15, 2025
1946d07
run shell hook after mamba install in CI
TjarkMiener Dec 15, 2025
319b227
use conda to activate the envs
TjarkMiener Dec 15, 2025
895d575
fixs some CI
TjarkMiener Dec 15, 2025
79102c7
remove support for keras2
TjarkMiener Dec 15, 2025
226eaf5
remove support for keras2 also in loader
TjarkMiener Dec 15, 2025
0d1955d
update installation instructions
TjarkMiener Dec 15, 2025
e78e19c
remove conda deploy workflow and polish pypi one
TjarkMiener Dec 15, 2025
22b6f6c
test building of pypi run on PRs when workflow are touched, but only …
TjarkMiener Dec 16, 2025
ae42165
bump python to v3.12 also for the docs
TjarkMiener Dec 17, 2025
608ce71
update installation instructions
TjarkMiener Dec 17, 2025
84f549c
fix some keras3 updates
TjarkMiener Dec 17, 2025
3a3faa0
add first tests for TrainCTLearnModel
TjarkMiener Dec 17, 2025
b4d2269
added test for the 'type' reco task
TjarkMiener Dec 17, 2025
b2a5f6b
add test for prediction tool
TjarkMiener Dec 19, 2025
f524fb8
fixes prediction tools when selecting a subset of tel_ids
TjarkMiener Jan 9, 2026
842174f
fixing couple of stuff
TjarkMiener Jan 21, 2026
78b0f22
added unittests for R1 waveforms to DL2
TjarkMiener Jan 22, 2026
9660ca5
overwrite DataLevels in metadata
TjarkMiener Jan 22, 2026
41fac09
added unittest for StereoPredictCTLearnModel
TjarkMiener Jan 22, 2026
0f26252
format via black
TjarkMiener Jan 22, 2026
2c9dc65
bump ctapipe and dl1dh
TjarkMiener Jan 23, 2026
59303dd
updated installation for IT-cluster
TjarkMiener Jan 23, 2026
3a4b3c2
updated Dockerfile with tensorflow:25.02-tf2-py3
TjarkMiener Jan 23, 2026
3af6b5a
bug fix keras3 upgrade
TjarkMiener Jan 23, 2026
8536cd8
added lstchain LST1 real data mock and test also LST1PredictionTool i…
TjarkMiener Jan 23, 2026
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
2 changes: 0 additions & 2 deletions .github/conda/bld.bat

This file was deleted.

2 changes: 0 additions & 2 deletions .github/conda/build.sh

This file was deleted.

7 changes: 0 additions & 7 deletions .github/conda/conda_build_config.yaml

This file was deleted.

56 changes: 0 additions & 56 deletions .github/conda/meta.yaml

This file was deleted.

91 changes: 56 additions & 35 deletions .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: CI

on:
Expand All @@ -15,39 +14,61 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04]
pyv: [ '3.10','3.11', '3.12', '3.13']
max-parallel: 5
python-version: ['3.12', '3.13', '3.14']
dl1dh-version: ['latest', 'nightly']
max-parallel: 6
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.dl1dh-version == 'nightly' || matrix.python-version == '3.14' }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.pyv }}
run: |
# Install Miniconda
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
echo "$HOME/miniconda/bin" >> $GITHUB_PATH
source $HOME/miniconda/bin/activate
# Install Mamba via conda (since we don't have mamba yet)
$HOME/miniconda/bin/conda config --add channels conda-forge
$HOME/miniconda/bin/conda install -y mamba=2.0.8
mamba install -y python=${{ matrix.pyv }}
- name: Add MKL_THREADING_LAYER variable
run: echo "MKL_THREADING_LAYER=GNU" >> $GITHUB_ENV
- name: Install dependencies with Mamba
run: |
source $HOME/miniconda/bin/activate
mamba env update --file environment.yml --name base
- name: Lint with flake8
run: |
source $HOME/miniconda/bin/activate
mamba install flake8
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install with pip
run: |
pip install -e .
- name: Test with pytest
run: |
source $HOME/miniconda/bin/activate
mamba install pytest
pytest
- uses: actions/checkout@v4

- name: Set up Miniconda
run: |
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
echo "$HOME/miniconda/bin" >> $GITHUB_PATH
source $HOME/miniconda/etc/profile.d/conda.sh
conda config --add channels conda-forge
conda install -y mamba

- name: Create Python environment
run: |
source $HOME/miniconda/etc/profile.d/conda.sh
mamba create -y -n ctlearn python==${{ matrix.python-version }} -c conda-forge
conda activate ctlearn

- name: Install dependencies
run: |
source $HOME/miniconda/etc/profile.d/conda.sh
conda activate ctlearn
sudo apt-get update
sudo apt-get install -y git
pip install --upgrade pip
pip install pylint pylint-exit anybadge eventio pytest flake8
if [ "${{ matrix.dl1dh-version }}" = "nightly" ]; then
pip install git+https://github.com/cta-observatory/dl1-data-handler.git
else
pip install dl1-data-handler
fi

- name: Add MKL_THREADING_LAYER variable
run: echo "MKL_THREADING_LAYER=GNU" >> $GITHUB_ENV

- name: Lint with flake8
run: |
source $HOME/miniconda/etc/profile.d/conda.sh
conda activate ctlearn
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Install package with pip
run: |
source $HOME/miniconda/etc/profile.d/conda.sh
conda activate ctlearn
pip install -e .

- name: Run pytest
run: |
source $HOME/miniconda/etc/profile.d/conda.sh
conda activate ctlearn
pytest
85 changes: 27 additions & 58 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ name: Release CD

on:
release:
types: [published]
types: [published]
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/**'

jobs:
pypi-publish:
name: Publish release to PyPI
environment:
name: pypi
name: pypi
url: https://pypi.org/project/ctlearn/
permissions:
id-token: write
Expand All @@ -20,64 +24,29 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04]
pyv: ['3.10']
pyv: ['3.12']
max-parallel: 5
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.pyv }}
run: |
conda install -y python=${{ matrix.pyv }}

- name: Add conda to system path
run: |
#$CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH

- name: Install dependencies
run: |
conda env update --file environment.yml --name base

- name: Build package
run: |
python --version
pip install -U build
python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- uses: actions/checkout@v4

- name: Set up micromamba (Python ${{ matrix.pyv }})
uses: mamba-org/setup-micromamba@v1
with:
environment-name: ctlearn
create-args: >-
python=${{ matrix.pyv }}
pip
cache-environment: true

condapublish:
strategy:
matrix:
os: [ubuntu-22.04]
pyv: ["3.10"]
max-parallel: 5
runs-on: ${{ matrix.os }}
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.pyv }}
run: |
conda install -y python=${{ matrix.pyv }}

- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH

- name: Install dependencies
run: |
conda env update --file environment.yml --name base
sudo apt-get install python3-numpy

- name: publish-to-conda
uses: fcakyon/conda-publish-action@v1.3
with:
subdir: '.github/conda'
anacondatoken: ${{ secrets.ANACONDA_TOKEN }}
- name: Build package
shell: micromamba-shell {0}
run: |
python --version
pip install -U build
python -m build

- name: Publish package distributions to PyPI
if: github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sphinx:
build:
os: ubuntu-22.04
tools:
python: "3.10"
python: "3.12"

python:
install:
Expand Down
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Stage 1: Build the ctlearn wheel using a standard Python image
FROM python:3.11 AS builder
FROM python:3.12 AS builder

# Install git (needed for setuptools_scm during build) and build tool
RUN apt-get update \
Expand All @@ -18,9 +18,7 @@ COPY ./.git ./.git/
RUN python -m build --wheel

# Stage 2: Create the final runtime image BASED ON NVIDIA's TF image
# TODO what version to use ? after 24.?? TF 2.14 is not found in the container
FROM nvcr.io/nvidia/tensorflow:24.01-tf2-py3

FROM nvcr.io/nvidia/tensorflow:25.02-tf2-py3
# Copy only the built wheel from the builder stage's dist directory
COPY --from=builder /repo/dist /tmp/dist

Expand Down
22 changes: 11 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ CTLearn is a package under active development to run deep learning models to ana
Installation for users
----------------------

Download and install `Anaconda <https://www.anaconda.com/download/>`_\ , or, for a minimal installation, `Miniconda <https://conda.io/miniconda.html>`_.

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

First, create and activate a fresh conda environment:

.. code-block:: bash

CTLEARN_VER=0.10.3
wget https://raw.githubusercontent.com/ctlearn-project/ctlearn/v$CTLEARN_VER/environment.yml
conda env create -n [ENVIRONMENT_NAME] -f environment.yml
conda activate [ENVIRONMENT_NAME]
pip install ctlearn==$CTLEARN_VER
ctlearn -h
mamba create -n ctlearn -c conda-forge python==3.12 llvmlite
conda activate ctlearn

The lastest version fo this package can be installed as a pip package:

.. code-block:: bash

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).
pip install ctlearn

See the documentation for further information like `installation instructions for developers <https://ctlearn.readthedocs.io/en/latest/installation.html#installing-with-pip-setuptools-from-source-for-development>`_, `package usage <https://ctlearn.readthedocs.io/en/stable/usage.html>`_, and `dependencies <https://ctlearn.readthedocs.io/en/stable/installation.html#dependencies>`_ among other topics.
See the documentation for further information like `installation instructions for the IT-cluster <https://ctlearn.readthedocs.io/en/latest/installation.html#install-a-released-version>`_, `installation instructions for developers <https://ctlearn.readthedocs.io/en/latest/installation.html#installing-with-pip-setuptools-from-source-for-development>`_, `package usage <https://ctlearn.readthedocs.io/en/stable/usage.html>`_, and `dependencies <https://ctlearn.readthedocs.io/en/stable/installation.html#dependencies>`_ among other topics.

Citing this software
--------------------
Expand Down
Loading
Loading