Metadata-Version: 2.4
Name: ctao-simpipe
Version: 0.1.0
Summary: CTAO DPPS Simulation Production Pipeline
Author-email: simpipe developers <simtools-developer@desy.de>
License: BSD 3-Clause License
        
        Copyright (c) 2025, CTAO, simpipe developers
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        
Project-URL: documentation, https://gitlab.cta-observatory.org/cta-computing/dpps/simpipe/simpipe
Project-URL: repository, https://gitlab.cta-observatory.org/cta-computing/dpps/simpipe/simpipe
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Astronomy
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: gammasimtools==0.15.0
Provides-Extra: all
Requires-Dist: ctao-simpipe[dev,doc,test]; extra == "all"
Provides-Extra: dev
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: pylint; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: towncrier; extra == "dev"
Provides-Extra: doc
Requires-Dist: ctao-sphinx-theme~=0.1.2; extra == "doc"
Requires-Dist: myst-parser; extra == "doc"
Requires-Dist: numpydoc; extra == "doc"
Requires-Dist: sphinx; extra == "doc"
Requires-Dist: sphinx-changelog; extra == "doc"
Requires-Dist: towncrier; extra == "doc"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-mock; extra == "test"
Requires-Dist: pytest-requirements; extra == "test"
Requires-Dist: pytest-xdist; extra == "test"
Dynamic: license-file

# DPPS SimPipe: Integration and Release

The **CTAO DPPS Simulation Production Pipeline (SimPipe)** provides the software, workflows, and data models for generating accurate Monte Carlo simulations of the CTAO observatory.

This packages defines the central `ctao-simpipe` packages, integrating the following components:

- [simtools](https://github.com/gammasim/simtools) - toolkit for model parameter management, production configuration, setting, validation workflows
- [CORSIKA](https://www.iap.kit.edu/corsika/) air shower simulations
- [sim_telarray](https://gitlab.cta-observatory.org/Konrad.Bernloehr/sim_telarray) telescope simulations
- simulation model database - mongoDB database for simulation model parameters and production model definitions

## Deployment

simtools, CORSIKA, and sim_telarray are planned to be deployed on the WMS nodes (CMFS) for simulation productions using docker images:

- one image per simtools/CORSIKA/sim_telarray version (plus build option variations including CPU vector optimization)
  - example for a [docker file](https://github.com/gammasim/simtools/blob/main/docker/Dockerfile-prod-opt) and [building workflow](https://github.com/gammasim/simtools/blob/main/.github/workflows/build-docker-corsika-simtelarray-image.yml) (using GitHub actions at this point)
- simulation model database is versioned (due to ongoing structure changing) and should be configured accordingly

## Software Installation

- simtools is installed using pip / conda
- CORSIKA is installed using a tar-file (currently downloaded from a cloud storage)
- sim_telarray is installed using a tar-file (currently downloaded from a cloud storage); planned to be installed from gitlab
- simulation model databases - no installed required; configuration of secrets for access

Download of corsika / sim_telarray is facilitated by a private upload to the DESY Sync&Share.
Ask the maintainers to provide the token to you and define it in a `.env` file in this repository:

```console
SOFTWARE_DOWNLOAD_SECRET=<the token received from the maintainers>
```

Then run `make build-dev-docker` to build the simpipe container locally.

## SimPipe Maintainer Documentation

The following section is preliminary and the setup is still in development (especially a simplification of the updating process).

### Updating submodules `dpps-aiv-toolkit` and `simtools`

The `dpps-aiv-toolkit` and `simtools` are submodules of the `dpps-simpipe` repository. To update them, follow these steps (identical for both):

```bash
cd dpps-aiv-toolkit
git checkout <branch-or-commit>
cd ..
git add dpps-aiv-toolkit
git commit -m "Update dpps-aiv-toolkit submodule to latest version"
git push
```

### Updating SimPipe components

1. `simtools`:
   - update the submodule in `simtools` to the latest version (see above)
   - update gammasimtools version in `pyproject.toml`
   - update gammasimtools version in `chart/templates/bootstrapSimulationModel.yaml`
   - update gammasimtools version in `Dockerfile`
2. Production and model parameters (SimulationModels):
   - update `SimulationModels` version in `./chart/values.yaml`
3. `CORSIKA` and `sim_telarray`:
   - update versions in `.gitlab-ci.yml` (this is propagted into the docker file)
