Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare first upload to PyPI #107

Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
__pycache__

# ignore version cache file (generated automatically when setup.py is run)
ctapipe/_version_cache.py
protopipe/_version_cache.py
protopipe/_version.py

# Ignore .c files by default to avoid including generated code. If you want to
# add a non-generated .c extension, use `git add -f filename.c`.
Expand Down
8 changes: 3 additions & 5 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"metadata": {
"title" : "protopipe",
"description": "A ctapipe-based pipeline prototype for the Cherenkov Telescope Array (CTA).",
"description": "Pipeline prototype for the Cherenkov Telescope Array (CTA).",
"license": {
"id": "CECILL-B"
},
"version": "v0.4.0",
"doi": "10.5281/zenodo.4303995",
"keywords": [
"gamma-ray astronomy",
"Imaging Atmospheric Cherenkov Telescope",
Expand Down Expand Up @@ -66,6 +65,5 @@
"type": "Other",
"name": "Garcia, Enrique"
}
]
]
}
}
17 changes: 10 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
==================================================
protopipe |CI| |codacy| |coverage| |documentation|
==================================================
==============================================================
protopipe |CI| |codacy| |coverage| |documentation| |doilatest|
==============================================================

.. |CI| image:: https://github.com/cta-observatory/protopipe/workflows/CI/badge.svg?branch=master
:target: https://github.com/cta-observatory/protopipe/actions?query=workflow%3ACI
Expand All @@ -10,7 +10,9 @@ protopipe |CI| |codacy| |coverage| |documentation|
:target: https://codecov.io/gh/cta-observatory/protopipe
.. |documentation| image:: https://readthedocs.org/projects/protopipe/badge/?version=latest
:target: https://protopipe.readthedocs.io/en/latest/?badge=latest
.. |doilatest| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4303996.svg
.. |doilatest| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4303995.svg
:target: https://doi.org/10.5281/zenodo.4303995
.. |doi_v0.3.0| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4303996.svg
:target: https://doi.org/10.5281/zenodo.4303996

A pipeline prototype for the `Cherenkov Telescope Array (CTA) <www.cta-observatory.org>`_.
Expand All @@ -28,6 +30,7 @@ Resources
- Current performance: `RedMine <https://forge.in2p3.fr/projects/benchmarks-reference-analysis/wiki/Protopipe_performance_data>`__

- Slack channels:

- `#protopipe <https://cta-aswg.slack.com/archives/CPTN4U7U7>`__
- `#protopipe_github <https://cta-aswg.slack.com/archives/CPUSPPHST>`__
- `#protopipe-grid <https://cta-aswg.slack.com/archives/C01FWH8E0TT>`__
Expand All @@ -38,7 +41,7 @@ Citing this software
If you use a released version of this software for a publication,
please cite it by using the corresponding DOI.

Please, check the development version of this file for up-to-date links.

- v0.3.0 : |doilatest|
- latest : |doilatest|
- v0.4.0 : TBD
- v0.3.0 : |doi_v0.3.0|

13 changes: 6 additions & 7 deletions docs/install/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ Development version
===================

1. `fork <https://help.github.com/en/articles/fork-a-repo>`__ the `repository <https://github.com/cta-observatory/protopipe>`_
2. ``conda env create -f environment.yml``
3. ``conda activate protopipe``
4. ``pip install -e .``

In this way, you will always use the version of the source code on which you
are working.
2. create and enter a basic virtual environment (or use the ``environment.yaml`` file)
3. ``pip install -e '.[all]'``

The ``all`` keyword will install all extra requirements,
which can be also installed separately using ``tests`` and ``docs``.

Next steps:

* get accustomed to the basic pipeline workflow (:ref:`use-pipeline`),
* make your own complete analysis (:ref:`use-grid`),
* for bugs and new features, please contribute to the project (:ref:`contribute`).
* learn how to contribute to the project (:ref:`contribute`).
22 changes: 14 additions & 8 deletions docs/install/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,30 @@
Installation
============

The only requirement is an Anaconda (or Miniconda) installation which supports
Python 3.
Requirements:

There are two different ways to install `protopipe`,
- ``Python >= 3.7``
- ``pip``

* if you just want to use it as it is (:ref:`install-release`),
* or if you also want to develop it (:ref:`install-development`).
It is recommended to work within a virtual environment, using for example
``venv`` or Anaconda's ``conda``.

.. note::
For both types of installation the use of `mamba <https://github.com/mamba-org/mamba#readme>`__
might provide improved speed during the creation of the `conda` environment.
In case you want to use Anaconda it is recommended to use
`mamba <https://github.com/mamba-org/mamba#readme>`__
for improved speed during the creation of the virtual environment.

There are two different ways to install ``protopipe``,

* if you just want to use it as it is (:ref:`install-release`),
* or if you also want to develop it (:ref:`install-development`).

In both cases, if you want to perform a full analysis, you will need some
computational power in order to produce enough
data files for model and performance estimation.
This can be accomplished through the use of a GRID environment.

After installing `protopipe`,
After installing ``protopipe``,

* install the code necessary to interface it with the grid (:ref:`install-grid`),
* use protopipe on the grid (:ref:`use-grid`).
Expand Down
16 changes: 11 additions & 5 deletions docs/install/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@
Released version
================

1. download the `latest released version <https://github.com/cta-observatory/protopipe/releases>`__
2. ``cd protopipe-X.Y.Z``
3. ``conda env create -f environment.yml -n protopipe-X.Y.Z``
4. ``conda activate protopipe``
5. ``pip install .``
You can find all released versions .

To install a released version >= ``0.4.0`` it is sufficient to install the
package from ``PyPI`` with ``pip install protopipe``.

For previous releases,

1. download the corresponding tarball stored `here <https://github.com/cta-observatory/protopipe/releases>`__
2. ``conda env create -f environment.yml -n protopipe-X.Y.Z``
3. ``conda activate protopipe-X.Y.Z``
4. ``pip install .``

Next steps:

Expand Down
2 changes: 1 addition & 1 deletion protopipe/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.0-dev"
__version__ = "0.4.0.post1"
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def readme():
"pytest",
"pytest-cov",
"codecov",
"ctapipe-extra @ https://github.com/cta-observatory/ctapipe-extra/archive/v0.3.1.tar.gz",
],
}

Expand All @@ -42,7 +43,7 @@ def readme():
packages=find_packages(),
package_data={"protopipe": ["aux/example_config_files/protopipe/analysis.yaml"]},
include_package_data=True,
install_requires=["ctapipe"],
install_requires=["ctapipe==0.9.1", "jupyterlab", "pyirf", "vitables"],
Copy link
Contributor

@kosack kosack Mar 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is jupyterlab and vitables really required? or only to generate docs? install_requires should only be things that are required to run, not useful things in the user's environment (which would go into environment.yml, or similar). I think the only requirements should be ctapipe and pyirf.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for a pure pip installation, so after pip install protopipe the user should have all the necessary tools to use protopipe and like this it doesn't really need even conda.
For now "use protopipe" means also benchmarking and checking data, so for me these 2 tools are necessary for the package as a whole.

Copy link
Contributor

@kosack kosack Mar 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that is the incorrect way to do it. Pip is not meant for making environments, only for installing required dependencies. For environments you need to use pipenv or poetry, or just provide a requirements.txt file that is the output of pip freeze. In the package itself (in setup.py) you should only list the bare minimum to allow it to work. Otherwise you will run into dependency resolution problems later.

So here you should have only ctapipe and pyirf as dependencies.

For reference: https://packaging.python.org/discussions/install-requires-vs-requirements/:

Whereas install_requires requirements are minimal, requirements files often contain an exhaustive listing of pinned versions for the purpose of achieving repeatable installations of a complete environment.

zip_safe=False,
extras_require={
"all": extras_require["all"],
Expand Down