Git Product home page Git Product logo

flashcam-simulation's Introduction

FlashCam Simulations

Low-level simulation package for the FlashCam. This project is intended to make simple changes to simtelarray simulations without the need to re-simulate those files. It can also generate fake gamma showers and pulses with different NSB and noise.

Installation

With the package structure used here, you do not have to point Python to the location of your package. You absolutely SHOULD NOT be adding the package directory to your $PYTHONPATH. Instead, you can use pip to install it locally:

cd ~/path/to/new_project
pip install -e .

pip will install all the dependencies specified in the setup.cfg file. The -e flag makes the install editable which means that you do not have to install the package again and again after each change. Changes to your files inside the project folder will automatically reflect in changes on your installed package. If you are working in an interactive environment (ipython, Jupyter) you will need to re-import any modules that have changed. For example, after editing module_x.py you will need to do the following to have the changes available in the Python interpreter:

import importlib
importlib.reload(module_x)

To install a non-editable version, do:

cd ~/path/to/new_project
pip install .

Testing your code

Ideally, you should be writing tests along with the new code. To test your code, first install the test dependencies:

pip install -e ".[test]"

Then run the tests from the new_project directory:

pytest --cov=.

The --cov=. flag generates a report on how much of you code is covered by tests. Ideally this should be >80%.

flashcam-simulation's People

Contributors

clara-escanuela avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.