Skip to content

Commit

Permalink
Merge a73cc66 into 8df916a
Browse files Browse the repository at this point in the history
  • Loading branch information
mlincett committed Sep 28, 2022
2 parents 8df916a + a73cc66 commit 1bde55e
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 95 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,2 +1,3 @@
flarestack.egg-info
*.pyc
docs/build
File renamed without changes.
50 changes: 30 additions & 20 deletions README.md
Expand Up @@ -14,7 +14,7 @@ Both time-dependent and time-independent analyses can be performed, as well as a
Performs single point source analyses, as well as the stacking of sources according to predefined weighting.
Also performs stacking analyses where the signal strength of each source is fit individually.

# Getting started
## Getting started

The easiest way to start using *flarestack* is to play with the introductory ipython notebooks, which can be opened with the following link:

Expand All @@ -24,67 +24,69 @@ The notebooks themselves are found under *examples/ipython_notebooks/*.

The "Binder" provides a pre-built Docker image containing all necessary dependencies, so you can simply click and play. It avoids the need for local installation, and should provide understanding of how the code works.

# Installation instructions

## How do I actually install *flarestack*?

The answer to this question depends on how lazy you're feeling, and how much of the backend you want to deal with.
## Installation instructions

### OPTION A: I only want to do an analysis, and trust the under-the-hood code

We recommend installing flarestack using [*poetry*](https://python-poetry.org)

In that case:
```bash
```shell
poetry add flarestack
```

This will resolve your environment and install all dependencies.

Another option is to use *pip*
```bash
pip install flarestack.
```shell
pip install flarestack
```

### OPTION B: Actually, I want to see the backend code myself. Maybe I want to contribute to it!

First clone the `git` repository:

```bash
```shell
git clone git@github.com:icecube/flarestack.git
```

We again recommend using `poetry` to install the code in your working tree.
For this, go to the directory you cloned the repo into (i.e. `~/flarestack`) and execute:

```bash
```shell
poetry install
```
This will install all packages as documented in the `poetry.lock` file.

If you want to also build the documentation locally, you should install the respective dependencies:

```shell
poetry install --with docs
```

You can still use `pip` if you want to:

```bash
```shell
pip install -e flarestack/
```

Either way will give you the very latest copy of the code, update the installed version if you git pull or modify scripts
yourself, and still enable you to import flarestack.
If you do want to contribute to _flarestack_, you can check out some guidelines [here](https://github.com/icecube/flarestack/blob/master/.github/CONTRIBUTING.md).

If you do want to contribute to _flarestack_, you can check out some guidelines [here](https://github.com/icecube/flarestack/blob/master/CONTRIBUTING.md).


### Right, anyway, I've now downloaded *flarestack*. Can I use it right away?

You can get started with *flarestack* immediatly using public IceCube datasets provided as part of the code. You can simply run scripts such as those under /flarestack/analyses/, and do your science!
You can get started with *flarestack* immediately using public IceCube datasets provided as part of the code. You can simply run scripts such as those under `/flarestack/analyses/`, and do your science!

You can optionally set custom directorioes for datasets, and for storing data calculated with the code.

### Setting up the dataset directory

If you are running on WIPAC or DESY, you do not need to specify a dataset directory, as IceCube data will be found automatically. Otherwise, you can add:

```bash
```shell
export FLARESTACK_DATASET_DIR=/path/to/datasets
```

Expand All @@ -94,17 +96,24 @@ to point the code to local copies of Icecube datasets.

*flarestack* will produce many files that do not need to be version-controlled. The principle is that everything within this directory can be reproduced by the code, so does not need to be backed up. By default, these files will be saved in a separate within the user home directory, but it might be preferrable to save them elsewhere, such as a scratch directory. You can specify the parent directory:

```bash
```shell
export FLARESTACK_SCRATCH_DIR=/path/to/scratch
```

A folder `flarestack__data` will be created in that directory. This is where you will find plots, pickle files and other files produced by the code.

# Testing *flarestack*
## Building documentation
*flarestack* documentation is available at [Read the Docs](flarestack.readthedocs.io), however you may want to build it locally (especially if you are contributing to the project). To do this, run `sphinx-build` from the root directory of the repository:

```shell
sphinx-build -b html docs/source/ docs/build/html
```

## Testing *flarestack*

Is *flarestack* actually working? You can check the functionality of *flarestack* with *unit tests*. There are a suite of unit tests to cover *flarestack* functionality, which can be run from the base *flarestack* directory with:

```bash
```shell
python -m unittest discover tests/
```

Expand All @@ -116,11 +125,11 @@ If you want to contribute to *flarestack*, please remember to add new tests! The

[![Coverage Status](https://coveralls.io/repos/github/icecube/flarestack/badge.svg?branch=master)](https://coveralls.io/github/icecube/flarestack?branch=master)

# Using *flarestack* for IceCube analysis
## Using *flarestack* for IceCube analysis

*flarestack* is currently used for internal IceCube analysis using unpublished Monte Carlo simulations, as outlined in analysis READMEs. Additional analysis of public IceCube data using effective areas would be possible with this code, but this feature **has not been tested or fully developed**. Any use of this code for public data is done without the endorsement of the IceCube collaboration.

# Citing *flarestack*
## Citing *flarestack*

If you use *flarestack* for analysis, please cite it! A DOI is provided by Zenodo, which can reference both the code repository, or specific releases of Flarestack.

Expand All @@ -130,5 +139,6 @@ If you use *flarestack* for analysis, please cite it! A DOI is provided by Zenod

* Federica Bradascio [@fbradascio](https://github.com/fbradascio)
* Simone Garrappa [@simonegarrappa](https://github.com/simonegarrappa)
* Massimiliano Lincetto [@mlincett](https://github.com/mlincett)
* Jannis Necker [@JannisNe](https://github.com/jannisne)
* Robert Stein [@robertdstein](https://github.com/robertdstein)
19 changes: 0 additions & 19 deletions docs/Makefile

This file was deleted.

35 changes: 0 additions & 35 deletions docs/make.bat

This file was deleted.

2 changes: 1 addition & 1 deletion docs/source/conf.py
Expand Up @@ -89,7 +89,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
4 changes: 0 additions & 4 deletions docs/source/getting_started.rst

This file was deleted.

41 changes: 25 additions & 16 deletions docs/source/setup.md
@@ -1,4 +1,4 @@
# Installation
## Getting started

The easiest way to start using *flarestack* is to play with the introductory ipython notebooks, which can be opened with the following link:

Expand All @@ -15,60 +15,62 @@ The "Binder" provides a pre-built Docker image containing all necessary dependen
We recommend installing flarestack using [*poetry*](https://python-poetry.org)

In that case:
```bash
```shell
poetry add flarestack
```

This will resolve your environment and install all dependencies.

Another option is to use *pip*
```bash
pip install flarestack.
```shell
pip install flarestack
```

### OPTION B: Actually, I want to see the backend code myself. Maybe I want to contribute to it!

Now you will need a couple of extra code lines.

First clone the `git` repository:

```bash
```shell
git clone git@github.com:icecube/flarestack.git
```

We again recommend using `poetry` to install the code in your working tree.
For this, go to the directory you cloned the repo into (i.e. `~/flarestack`) and execute:

```bash
```shell
poetry install
```
This will install all packages as documented in the `poetry.lock` file.

If you want to also build the documentation locally, you should install the respective dependencies:

```shell
poetry install --with docs
```

You can still use `pip` if you want to:

```bash
```shell
pip install -e flarestack/
```

Either way will give you the very latest copy of the code, update the installed version if you git pull or modify scripts
yourself, and still enable you to import flarestack.

If you do want to contribute to _flarestack_, you can check out some guidelines
[here](https://github.com/icecube/flarestack/blob/master/.github/CONTRIBUTING.md).
If you do want to contribute to _flarestack_, you can check out some guidelines [here](https://github.com/icecube/flarestack/blob/master/CONTRIBUTING.md).


## Right, anyway, I've now downloaded *flarestack*. Can I use it right away?
### Right, anyway, I've now downloaded *flarestack*. Can I use it right away?

You can get started with *flarestack* immediatly using public IceCube datasets provided as part of the code. You can simply run scripts such as those under /flarestack/analyses/, and do your science!
You can get started with *flarestack* immediately using public IceCube datasets provided as part of the code. You can simply run scripts such as those under `/flarestack/analyses/`, and do your science!

You can optionally set custom directorioes for datasets, and for storing data calculated with the code.

### Setting up the dataset directory

If you are running on WIPAC or DESY, you do not need to specify a dataset directory, as IceCube data will be found automatically. Otherwise, you can add:

```bash
```shell
export FLARESTACK_DATASET_DIR=/path/to/datasets
```

Expand All @@ -78,17 +80,24 @@ to point the code to local copies of Icecube datasets.

*flarestack* will produce many files that do not need to be version-controlled. The principle is that everything within this directory can be reproduced by the code, so does not need to be backed up. By default, these files will be saved in a separate within the user home directory, but it might be preferrable to save them elsewhere, such as a scratch directory. You can specify the parent directory:

```bash
```shell
export FLARESTACK_SCRATCH_DIR=/path/to/scratch
```

A folder `flarestack__data` will be created in that directory. This is where you will find plots, pickle files and other files produced by the code.

## Building documentation
*flarestack* documentation is available at [Read the Docs](flarestack.readthedocs.io), however you may want to build it locally (especially if you are contributing to the project). To do this, run `sphinx-build` from the root directory of the repository:

```shell
sphinx-build -b html docs/source/ docs/build/html
```

## Testing *flarestack*

Is *flarestack* actually working? You can check the functionality of *flarestack* with *unit tests*. There are a suite of unit tests to cover *flarestack* functionality, which can be run from the base *flarestack* directory with:

```bash
```shell
python -m unittest discover tests/
```

Expand Down

0 comments on commit 1bde55e

Please sign in to comment.