Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into psf_model_fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe committed Jan 24, 2025
2 parents cc2457b + 2b9d631 commit 5a2ba72
Show file tree
Hide file tree
Showing 36 changed files with 786 additions and 256 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.cache/ctapipe
key: ctapipe-test-data
key: ctapipe-test-data-desy

- name: Prepare mamba installation
if: matrix.install-method == 'mamba' && contains(github.event.pull_request.labels.*.name, 'documentation-only') == false
Expand Down Expand Up @@ -207,9 +207,5 @@ jobs:
git describe --tags
python -c 'import ctapipe; print(ctapipe.__version__)'
- name: Produce Changelog
run: |
towncrier build --yes
- name: Build docs
run: make doc
16 changes: 15 additions & 1 deletion .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,26 @@ jobs:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success'
steps:
- uses: actions/checkout@v4
- name: Checkout branch or tag
uses: actions/checkout@v4
if: github.event.workflow_run.event != 'pull_request'
with:
repository: ${{ github.event.workflow_run.head_repository.full_name }}
ref: ${{ github.event.workflow_run.head_branch }}
fetch-depth: 0

- name: Checkout Pull Request merge result
uses: actions/checkout@v4
if: github.event.workflow_run.event == 'pull_request'
with:
ref: refs/pull/${{ github.event.workflow_run.pull_requests[0].number }}/merge
fetch-depth: 0

- name: Git info
run: |
git status
git log -n 5 --oneline
- name: 'Download code coverage'
uses: actions/github-script@v7
with:
Expand Down
2 changes: 2 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,5 @@ Vadym Voitsekhovskyi <[email protected]> <[email protected]>
Tjark Miener <[email protected]>

Michael Punch <[email protected]> <[email protected]>

Christian Arauner <[email protected]> <[email protected]>
5 changes: 4 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2

build:
os: ubuntu-22.04
os: ubuntu-24.04
apt_packages:
- ffmpeg
- graphviz
Expand All @@ -14,3 +14,6 @@ python:
path: .
extra_requirements:
- docs

sphinx:
configuration: docs/conf.py
5 changes: 3 additions & 2 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Jean Jacquemier <[email protected]>
Tino Michael <[email protected]>
Lukas Nickel <[email protected]>
Noah Biederbeck <[email protected]>
Tomas Bylund <[email protected]>
Lukas Beiske <[email protected]>
Tomas Bylund <[email protected]>
Georg Schwefer <[email protected]>
Jonas Hackfeld <[email protected]>
Christoph Toennis <[email protected]>
Expand Down Expand Up @@ -43,19 +43,20 @@ Thomas Gasparetto <[email protected]>
Ruben Lopez-Coto <[email protected]>
Orel Gueta <[email protected]>
Tristan Carel <[email protected]>
Daniel Morcuende <[email protected]>
Daniel Nieto <[email protected]>
Michael Punch <[email protected]>
Miguel Nievas <[email protected]>
Arnau Aguasca-Cabot <[email protected]>
Christophe COSSOU <[email protected]>
Cyril Alispach <[email protected]>
Daniel Morcuende <[email protected]>
Julien Lefaucheur <[email protected]>
Konstantin Pfrang <[email protected]>
Moritz Hütten <[email protected]>
Thomas Armstrong <[email protected]>
Alice Donini <[email protected]>
Andrés Baquero <[email protected]>
Christian Arauner <[email protected]>
David Landriu <[email protected]>
Gernot Maier <[email protected]>
Henning Ptaszyk <[email protected]>
Expand Down
56 changes: 56 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
ctapipe v0.23.2 (2025-01-21)
============================

Bug Fixes
---------

- Fill ``ctapipe.containers.SimulatedCameraContainer.true_image_sum`` in
``HDF5EventSource``. Always returned default value of -1 before the fix. [`#2680 <https://github.com/cta-observatory/ctapipe/pull/2680>`__]

Maintenance
-----------

- Add compatibility with numpy>=2.1. [`#2682 <https://github.com/cta-observatory/ctapipe/pull/2682>`__]


ctapipe v0.23.1 (2024-12-04)
============================

Bug Fixes
---------

- Fix ``<reconstruction_property>_uncert`` calculations in ``ctapipe.reco.StereoMeanCombiner``.
Add helper functions for vectorized numpy calculations as new ``ctapipe.reco.telescope_event_handling`` module. [`#2658 <https://github.com/cta-observatory/ctapipe/pull/2658>`__]

- Fix error in ``ctapipe-process`` when in the middle of a simtel file
that has true images available, a telescope event is missing the true image.
This can happen rarely in case a telescope triggered on pure NSB or
is oversaturated to the point where the true pe didn't fit into memory constraints.

The error was due to the ``DataWriter`` trying to write a ``None`` into an
already setup table for the true images.

The ``SimTelEventSource`` will now create an invalid true image filled with ``-1``
for such events. [`#2659 <https://github.com/cta-observatory/ctapipe/pull/2659>`__]

- In ``SimTelEventSource``, ignore telescope events that did not take part in the stereo event trigger.
This happens rarely in Prod6 files in conjunction with the random mono trigger system.

- Fix the order in which ``Tool`` runs final operations to fix an issue
of provenance not being correctly recorded. [`#2662 <https://github.com/cta-observatory/ctapipe/pull/2662>`__]

- Fix data type of ``tel_id`` in the output of ``SubarrayDescription.to_table``

- Fixed a bug where if a configuration file with unknown file extension was passed
to a tool, e.g. ``--config myconf.conf`` instead of ``--config myconf.yaml``, it
was silently ignored, despite an info log saying "Loading config file
myconf.conf". Configuration files must now have one of the following extensions
to be recognized: yml, yaml, toml, json, py. If not a ``ToolConfigurationError``
is raised. [`#2666 <https://github.com/cta-observatory/ctapipe/pull/2666>`__]

Maintenance
-----------

- Add support for astropy 7.0. [`#2639 <https://github.com/cta-observatory/ctapipe/pull/2639>`__]
- Change data server for test datasets from in2p3 to DESY hosted server. [`#2664 <https://github.com/cta-observatory/ctapipe/pull/2664>`__]

ctapipe v0.23.0 (2024-11-18)
============================

Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
ctapipe |pypi| |conda| |doilatest| |ci| |sonarqube_coverage| |sonarqube_quality|
==================================================================================

.. |ci| image:: https://github.com/cta-observatory/ctapipe/workflows/CI/badge.svg?branch=main
:target: https://github.com/cta-observatory/ctapipe/actions?query=workflow%3ACI+branch%3Amain
.. |ci| image:: https://github.com/cta-observatory/ctapipe/actions/workflows/ci.yml/badge.svg?branch=main
:target: https://github.com/cta-observatory/ctapipe/actions/workflows/ci.yml
:alt: Test Status
.. |sonarqube_quality| image:: https://sonar-cta-dpps.zeuthen.desy.de/api/project_badges/measure?project=cta-observatory_ctapipe_AY52EYhuvuGcMFidNyUs&metric=alert_status&token=sqb_a533204f382b350568e922385cab7c2394587458
:target: https://sonar-cta-dpps.zeuthen.desy.de/dashboard?id=cta-observatory_ctapipe_AY52EYhuvuGcMFidNyUs
:alt: sonarqube quality gate
.. |sonarqube_coverage| image:: https://sonar-cta-dpps.zeuthen.desy.de/api/project_badges/measure?project=cta-observatory_ctapipe_AY52EYhuvuGcMFidNyUs&metric=coverage&token=sqb_a533204f382b350568e922385cab7c2394587458
:target: https://sonar-cta-dpps.zeuthen.desy.de/api/project_badges/measure?project=cta-observatory_ctapipe_AY52EYhuvuGcMFidNyUs&metric=coverage&token=sqb_a533204f382b350568e922385cab7c2394587458)](https://sonar-cta-dpps.zeuthen.desy.de/dashboard?id=cta-observatory_ctapipe_AY52EYhuvuGcMFidNyUs
:target: https://sonar-cta-dpps.zeuthen.desy.de/component_measures?metric=coverage&selected=cta-observatory_ctapipe_AY52EYhuvuGcMFidNyUs%3Asrc%2Fctapipe&view=treemap&id=cta-observatory_ctapipe_AY52EYhuvuGcMFidNyUs
:alt: sonarqube code coverage
.. |conda| image:: https://anaconda.org/conda-forge/ctapipe/badges/version.svg
:target: https://anaconda.org/conda-forge/ctapipe
Expand Down
6 changes: 3 additions & 3 deletions docs/_static/switcher.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"url": "https://ctapipe.readthedocs.io/en/stable/"
},
{
"name": "v0.23.0",
"version": "v0.23.0",
"url": "https://ctapipe.readthedocs.io/en/v0.23.0/"
"name": "v0.23.2",
"version": "v0.23.2",
"url": "https://ctapipe.readthedocs.io/en/v0.23.2/"
},
{
"name": "v0.22.0",
Expand Down
6 changes: 5 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
Change Log
**********

.. include:: ../CHANGES.rst

.. changelog::
:towncrier: ../
:changelog_file: ../CHANGES.rst
:towncrier-skip-if-empty:
1 change: 0 additions & 1 deletion docs/changes/2639.feature.rst

This file was deleted.

1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"sphinx_design",
"IPython.sphinxext.ipython_console_highlighting",
"sphinx_gallery.gen_gallery",
"sphinx_changelog",
]


Expand Down
33 changes: 17 additions & 16 deletions docs/developer-guide/maintainer-info.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,30 +37,31 @@ The docs are automatically built and deployed using readthedocs.
How To Make a Release?
======================

1. Open a new pull request to prepare the release.
#. Open a new pull request to prepare the release.
This should be the last pull request to be merged before making the actual release.

Run ``towncrier`` in to render the changelog:
#. Run ``towncrier`` to render the changelog:

.. code-block:: console
.. code-block:: console
$ git fetch
$ git switch -c prepare_<VERSION NUMBER> origin/main
$ towncrier build --version=<VERSION NUMBER>
$ git fetch
$ git switch -c prepare_<VERSION NUMBER> origin/main
$ towncrier build --version=<VERSION NUMBER>
Add the planned new version to the ``docs/_static/switcher.json`` file, so it will be
available from the version dropdown once the documentation is built.
#. Add the planned new version to the ``docs/_static/switcher.json`` file, so it will be
available from the version dropdown once the documentation is built.

Update the ``AUTHORS`` file using the following command:
#. Update the ``AUTHORS`` file using the following command:

.. code-block:: console
.. code-block:: console
$ bash -c "git shortlog -sne | grep -v dependabot | sed -E 's/^\s+[0-9]+\s+//' > AUTHORS"
$ bash -c "git shortlog -sne | grep -v dependabot | sed -E 's/^\s+[0-9]+\s+//' > AUTHORS"
2. Create a new github release, a good starting point should already be made by the
release drafter plugin.
#. Create a new GitHub release.
A good starting point should already be made by the release drafter plugin.

3. The PyPI upload will be done automatically by Github Actions.
#. The PyPI upload will be done automatically by GitHub Actions.

4. conda packages are built by conda-forge, the recipe is maintained here: https://github.com/conda-forge/ctapipe-feedstock/
A pull request to update the recipe should be opened automatically by a conda-forge bot when a new version is published to PyPi. This can take a couple of hours.
#. conda packages are built by conda-forge, the recipe is maintained here: https://github.com/conda-forge/ctapipe-feedstock/.
A pull request to update the recipe should be opened automatically by a conda-forge bot when a new version is published to PyPI. This can take a couple of hours.
You can make it manually to speed things up.
2 changes: 1 addition & 1 deletion docs/developer-guide/style-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ All functions, classes, and modules should contain appropriate API
documentation in their *docstrings*. The *docstrings* should be
written in ReStructuredText format (same as the Sphinx high-level
documentation), and should follow the `NumPy Docstring Standards
<https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt#docstring-standard>`_
<https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard>`_

Documentation for all algorithms should contain citations to external
works, which should be collected in ``bibliography.rst``. An example of
Expand Down
14 changes: 14 additions & 0 deletions docs/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,17 @@ @manual{ctao-software-standards
institution={CTAO},
url={https://redmine.cta-observatory.org/dmsf/files/8628/view},
}

@article{lst1-crab-paper,
doi = {10.3847/1538-4357/ace89d},
url = {https://dx.doi.org/10.3847/1538-4357/ace89d},
year = {2023},
month = {oct},
publisher = {The American Astronomical Society},
volume = {956},
number = {2},
pages = {80},
author = {LST},
title = {Observations of the Crab Nebula and Pulsar with the Large-sized Telescope Prototype of the Cherenkov Telescope Array},
journal = {The Astrophysical Journal},
}
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ dependencies:
- pydata-sphinx-theme
- sphinx-design
- sphinxcontrib-bibtex
- sphinx_changelog
- tomli
- towncrier
- tqdm
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ docs = [
"sphinx-gallery >= 0.16.0",
"sphinx_automodapi",
"sphinxcontrib-bibtex",
"sphinx-changelog",
"tomli; python_version < '3.11'",
]

Expand Down
2 changes: 1 addition & 1 deletion src/ctapipe/calib/camera/calibrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def _calibrate_dl0(self, event, tel_id):

dl0_pixel_status = r1.pixel_status.copy()
# set dvr pixel bit in pixel_status for pixels kept by DVR
dl0_pixel_status[signal_pixels] |= PixelStatus.DVR_STORED_AS_SIGNAL
dl0_pixel_status[signal_pixels] |= np.uint8(PixelStatus.DVR_STORED_AS_SIGNAL)
# unset dvr bits for removed pixels
dl0_pixel_status[~signal_pixels] &= ~np.uint8(PixelStatus.DVR_STATUS)

Expand Down
4 changes: 2 additions & 2 deletions src/ctapipe/coordinates/tests/test_impact_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ def test_shower_impact_distance(reference_location):
assert np.allclose(impact_distances, [0, 1, 2] * u.m)

# alt=0 az=0 should be aligned to x-axis (north in ground frame)
# therefore the distances should also be just the y-offset of the telecope
# therefore the distances should also be just the y-offset of the telescope
shower_geom = ReconstructedGeometryContainer(
core_x=0 * u.m, core_y=0 * u.m, alt=0 * u.deg, az=0 * u.deg
)
impact_distances = shower_impact_distance(shower_geom=shower_geom, subarray=sub)
assert np.allclose(impact_distances, [0, 1, 2] * u.m)

# alt=0 az=90 should be aligned to y-axis (east in ground frame)
# therefore the distances should also be just the x-offset of the telecope
# therefore the distances should also be just the x-offset of the telescope
shower_geom = ReconstructedGeometryContainer(
core_x=0 * u.m, core_y=0 * u.m, alt=0 * u.deg, az=90 * u.deg
)
Expand Down
Loading

0 comments on commit 5a2ba72

Please sign in to comment.