Skip to content

Commit

Permalink
Merge pull request #228 from robelgeda/pyos
Browse files Browse the repository at this point in the history
Clean up README and Citation
  • Loading branch information
robelgeda authored Nov 1, 2024
2 parents ea5e209 + f78f5b1 commit 5f663e1
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 95 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/01-bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ body:
attributes:
label: Problem description
description: |
A concise description of what you're experiencing.
Please provide a concise description of what you're experiencing.
Please explain:
Expand All @@ -21,7 +21,7 @@ body:
attributes:
label: Code sample
description: >
Create a [minimal, complete, verifiable example](https://stackoverflow.com/help/mcve).
Please create a [minimal, complete, verifiable example](https://stackoverflow.com/help/mcve).
Please, paste your code between the ``` tickmarks below or link to a [gist](https://gist.github.com/).
value: |
Code run:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/03-feature-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ body:
attributes:
label: Feature or Problem
description: >
A clear and concise description of what you are trying to achieve.
Please provide a clear and concise description of what you are trying to achieve.
placeholder: >
"I want to be able to [...] but I can't because [...]".
validations:
Expand Down
1 change: 0 additions & 1 deletion .github/SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Support

* Start a [discussion topic](https://github.com/PetroFit/petrofit/discussions)
* Email the authors or maintainers
8 changes: 7 additions & 1 deletion CITATION.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Citing and Credits
Publications
============

|AJ tag| |zonodo tag| |ascl tag|
|AJ tag| |zonodo tag| |ads tag| |ascl tag|

If you would like to cite PetroFit for a publication, please use the acknowledgments below.
Given the close relationship between PetroFit and Photutils, we ask that you also cite
Expand Down Expand Up @@ -94,10 +94,16 @@ HTML (.html):
:target: https://arxiv.org/abs/2202.13493
:alt: PetroFit arxiv


.. |ads tag| image:: https://img.shields.io/badge/ADS-2022AJ....163..202G-blue.svg?style=flat&color=3484e0
:target: https://ui.adsabs.harvard.edu/abs/2022AJ....163..202G/abstract
:alt: ADS PetroFit

.. |ascl tag| image:: https://img.shields.io/badge/ascl-2203.013-black.svg?colorB=262255
:target: https://ascl.net/2203.013
:alt: ascl:2203.013

.. |petrofit tag| image:: https://img.shields.io/badge/powered%20by-PetroFit-blue.svg?style=flat&color=00B0F0
:target: https://github.com/PetroFit/petrofit
:alt: PetroFit

26 changes: 22 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

PetroFit
--------
|repostatus tag| |CI tag| |rtd tag| |PyPI tag| |AJ tag| |zonodo tag| |python version tag| |astropy tag| |photutils tag|
|repostatus tag| |CI tag| |rtd tag| |PyPI tag| |AJ tag| |zonodo tag| |python version tag| |CodeCov| |astropy tag| |photutils tag|

PetroFit is a package for calculating Petrosian properties, such as radii and concentration indices, as well as fitting
galaxy light profiles. In particular, PetroFit includes tools for performing accurate photometry, segmentations,
Expand All @@ -17,9 +17,23 @@ for installation instructions and a guide to the ``petrofit`` module.
Installation
------------

You can install PetroFit using ``pip install petrofit``. Please see
You can install PetroFit using pip or build a `jupyter lab <https://jupyter.org/>`_ environment using `hatch <https://jupyter.org/>`_ . Please see
the `petrofit documentation <https://petrofit.readthedocs.io/en/latest/>`_ for detailed installation instructions.

**pip Install**:

.. code-block:: bash
pip install petrofit
**hatch Jupyter Lab**:

cd into the dir you want to launch jupyter lab in, and then run:

.. code-block:: bash
hatch run jupyter:lab
Examples
--------

Expand Down Expand Up @@ -88,8 +102,8 @@ Given a 2D image (``image``) the following code snippet demonstrates how to crea
Citation
--------

Please see the `petrofit documentation <https://petrofit.readthedocs.io/en/latest/>`_
for citation instructions. This information is also available in the `CITATION.rst``
Please see the `PetroFit citation documentation <https://petrofit.readthedocs.io/en/latest/citing.html>`_
for citation instructions. This information is also available in the ``CITATION.rst``
file in the PetroFit repo.

License
Expand Down Expand Up @@ -170,3 +184,7 @@ petrofit based on its use in the README file for the
.. |python version tag| image:: https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fpetrofit%2Fpetrofit%2Fmain%2Fpyproject.toml
:alt: Python Version from PEP 621 TOML
:target: https://www.python.org/downloads/

.. |CodeCov| image:: https://codecov.io/gh/petrofit/petrofit/graph/badge.svg
:alt: Tests code coverage
:target: https://codecov.io/gh/petrofit/petrofit
88 changes: 15 additions & 73 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ Installation
############

There are multiple ways to install the PetroFit package. The latest release of PetroFit can be installed from `PyPi <https://pypi.org/project/petrofit>`_ using the ``pip install petrofit`` command (see the `<pip_>`_ section below). To install the latest developer version of `PetroFit`, please clone the `PetroFit GitHub repository <https://github.com/PetroFit/petrofit>`_
and install the package (see the `<For Developers_>`_ section below). There are two recommended ways to install the requirements needed to run the PetroFit package, through
`Conda <https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html>`_ and
`Docker <https://docs.docker.com/get-docker/>`_.
and install the package (see the `<For Developers_>`_ section below).

pip
****
Expand All @@ -15,6 +13,17 @@ PetroFit can be installed using pip as follows:
pip install petrofit
hatch
******
PetroFit is comaptible with ``hatch``. If you would like to create a jupyter lab instance with PetroFit installed,
you can use the following command:

.. code-block:: bash
cd <dir you want to launch jupyter lab in>
hatch run jupyter:lab
Conda
*****

Expand All @@ -37,73 +46,14 @@ environment as follows:
conda env create -f environment.yml
**Step 3:** Activate the `petrofit` environment.

.. code-block:: bash
source activate petrofit
**Step 4:** Install PetroFit.

.. code-block:: bash
python setup.py install
or if installing from pip:

.. code-block:: bash
pip install petrofit
Docker
******

We have included a Docker file as well as a helper script to make the installation of the package as easy as possible.
The docker file will create a Jupyter Notebook image which makes creating and running Notebooks possible.
To install using the helper script, please follow the instructions below.


**Step 1:** Clone the PetroFit repo and ``cd`` into the cloned repo.

.. code-block:: bash
git clone https://github.com/PetroFit/petrofit.git
cd petrofit
**Step 2:** Use the helper script to create the new docker image.

.. code-block:: bash
python docker.py build
.. Note::

The cloned repo will be mounted when running using the helper script and any changes to the host code will
become available in the docker image (notebook restart may be required to import changed version).

**Step 3:** Start the notebook using the helper script. You can mount a host directory or a list of directories
(separated by space) by adding their paths at the end of the command. The host directories will be mounted under
the `mount` directory in the docker image.
**Step 3:** Install and activate the `petrofit` environment.

.. code-block:: bash
python docker.py run [extra_mount_paths]
.. important::

Please note that this type of mounting is called a ``bind`` which means the changes you make to the mounted virtual
directory will also apply in the host directory on your hard drive.

**Step 4:** Copy and paste the notebook URL into your internet browser. The link to the notebook home should look like this:

.. code-block:: bash
conda env create -f environment.yml
http://127.0.0.1:8888/?token=d020c13d029013c20d0329e6913c5df076d0a4a14e63dc77
source activate petrofit
**Step 5:** You can close the server like any other Jupyter notebook server by hitting ``Ctrl + C``
(make sure to have saved your notebook before shutting down the server).
For Developers
**************
Expand All @@ -122,13 +72,5 @@ For developers, we recommend setting up a conda environment and then using the f
If you will be contributing to the software, we recommend forking the repository on GitHub first, cloning your forked repository,
and then installing the developer version.

Before installing PetroFit, you may need to install the required dependencies.
You can do this using the requirements file located in the top directory of the repository. To do so, navigate to the
top directory of the PetroFit repository (where the requirements.txt file is located). Then run:

.. code-block:: bash
pip install -r requirements.txt
Frozen versions of conda environment files are provided via the `petrofit_environments repository <https://github.com/PetroFit/petrofit_environments>`_.

Loading

0 comments on commit 5f663e1

Please sign in to comment.