jana 0.2.13
Python dumpster module and tools for JANUS observation planning
License: MIT
Requires Python: >=3.10,<3.12

# jana

[![PyPI](https://img.shields.io/pypi/v/jana?style=flat-square)](https://pypi.python.org/pypi/jana/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/jana?style=flat-square)](https://pypi.python.org/pypi/jana/)
[![PyPI - License](https://img.shields.io/pypi/l/jana?style=flat-square)](https://pypi.python.org/pypi/jana/)
[![Coookiecutter - Wolt](https://img.shields.io/badge/cookiecutter-Wolt-00c2e8?style=flat-square&logo=cookiecutter&logoColor=D4AA00&link=https://github.com/woltapp/wolt-python-package-cookiecutter)](https://github.com/woltapp/wolt-python-package-cookiecutter)

---

**Documentation**: [https://luca-penasa.github.io/jana](https://luca-penasa.github.io/jana)

**Source Code**: [https://github.com/luca-penasa/jana](https://github.com/luca-penasa/jana)

**PyPI**: [https://pypi.org/project/jana/](https://pypi.org/project/jana/)

---
Documentation (internal) [here](http://juice-janus.pages.ict.inaf.it/jana/)

aka Luca's dumpster & incubator python module, which collects some python
code developed during the various activities I was involved in for
JANUS and which is not mature enough to be released as a separate
module.

As this collects almost anything that I found relevant at a certain point, it is not granted to be entirely
maintained in the future. It also contains quite a lot of stubs and unfinished code I would like to keep around for future needs.

Anyway, as it might contain something useful for someone trying to do similar things, here it is.

The code also features a CLI, which is not documented at the moment, but it is quite self-explanatory.
As it is rarely used and, hence maintained, it is not guaranteed to work.

The code is released under the BSD 3-clause license.

## Installation

```sh
pip install jana
```

## Development

* Clone this repository
* Requirements:
  * [Poetry](https://python-poetry.org/)
  * Python 3.10+
* Create a virtual environment and install the dependencies

```sh
poetry install
```

* Activate the virtual environment

```sh
poetry shell
```

### Testing

```sh
pytest
```

### Documentation

The documentation is automatically generated from the content of the [docs directory](./docs) and from the docstrings
 of the public signatures of the source code. The documentation is updated and published as a [Github project page
 ](https://pages.github.com/) automatically as part each release.

### Releasing

Trigger the [Draft release workflow](https://github.com/luca-penasa/jana/actions/workflows/draft_release.yml)
(press _Run workflow_). This will update the changelog & version and create a GitHub release which is in _Draft_ state.

Find the draft release from the
[GitHub releases](https://github.com/luca-penasa/jana/releases) and publish it. When
 a release is published, it'll trigger [release](https://github.com/luca-penasa/jana/blob/master/.github/workflows/release.yml) workflow which creates PyPI
 release and deploys updated documentation.

### Pre-commit

Pre-commit hooks run all the auto-formatters (e.g. `black`, `isort`), linters (e.g. `mypy`, `flake8`), and other quality
 checks to make sure the changeset is in good shape before a commit/push happens.

You can install the hooks with (runs for each commit):

```sh
pre-commit install
```

Or if you want them to run only for each push:

```sh
pre-commit install -t pre-push
```

Or if you want e.g. want to run all checks manually for all files:

```sh
pre-commit run --all-files
```

---

This project was generated using the [wolt-python-package-cookiecutter](https://github.com/woltapp/wolt-python-package-cookiecutter) template.

### additional info

## install from git

If you just need to use some routines:

```bash
pip install git+https://www.ict.inaf.it/gitlab/juice-janus/jana.git --upgrade 
```

login with your gitlab credentials.

## On windows

## without conda

jana should work on windows but it does have some problematic dependencies (cartopy). Unofficial wheels can be found at [this link](https://www.lfd.uci.edu/~gohlke/pythonlibs/) or by installing them via conda. If you install conda from there remember to also install pyproj and shapely from the same repo.

## with conda

conda install cartopy and then just install jana in a venv or in your conda system.

## Notes for developers

to crate a new version please use

```bash
poetry run bump2version patch
```

## To publish to the inaf-gitlab package registry

This is mostly for my future self.

add the registry to the project (this was already done once, and that's enough)

```bash
poetry source add --priority=supplemental inaf-gitlab https://www.ict.inaf.it/gitlab/api/v4/projects/1089/packages/pypi
```

configure your poetry instance to have access to the registry:

```bash
poetry config http-basic.inaf-gitlab RW-package-registry-access TOKEN_VALUE
```

where `RW-package-registry-access` is the name of the token. The token **must** have `API` permissions.

and then publish:

```bash
poetry publish -r inaf-gitlab
```