Skip to content

Commit

Permalink
Update pyproject.toml and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MetinSa committed May 7, 2024
1 parent 688e9ab commit 622501b
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 1,107 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ repos:
files: ^(.*/)?(poetry\.lock|pyproject\.toml)$
- id: poetry-export
name: poetry-export
description: run poetry export to sync lock file with requirements.txt
description: run poetry export to sync lock file with requirements-dev.txt
entry: poetry export
language: python
pass_filenames: false
files: ^(.*/)?poetry\.lock$
args: ["--dev", "-f", "requirements.txt", "-o", "requirements-dev.txt"]
args: ["-f", "requirements.txt", "-o", "requirements.txt"]
29 changes: 13 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ from astropy.time import Time

import zodipy

# Initialize a zodiacal light model at a wavelength/frequency or at a bandpass
# Initialize a zodiacal light model at a wavelength/frequency or over a bandpass
model = zodipy.Model(25*u.micron, name="DIRBE")

# ZodiPy uses astropy's `SkyCoord` for coordinate inputs
# Use Astropy's `SkyCoord` to specify coordinate
lon = [10, 10.1, 10.2] * u.deg
lat = [90, 89, 88] * u.deg
skycoord = SkyCoord(
Expand All @@ -44,7 +44,8 @@ skycoord = SkyCoord(
obstime=Time("2022-01-01 12:00:00"),
frame="galactic",
)
# The zodiacal light model is evaluated

# Compute the zodiacal light as seen from Earth
emission = model.evaluate(skycoord, obspos="earth")

print(emission)
Expand All @@ -58,7 +59,10 @@ See [CITATION](https://github.com/Cosmoglobe/zodipy/blob/main/CITATION.bib)


## Install
ZodiPy is installed using `pip install zodipy`.
ZodiPy is installed with pip
```bash
pip install zodipy
```

## Dependencies
ZodiPy supports all Python versions >= 3.9, and has the following dependencies:
Expand All @@ -84,25 +88,18 @@ Contributing developers will need to download the following additional dependenc
- mkdocs-material
- mkdocstrings
- mkdocstrings-python
- markdown (<3.4.0)
- markdown

which are required to test and build ZodiPy.

### Poetry
Developers can install ZodiPy through [Poetry](https://python-poetry.org/) (Poetry >= 1.8.0) by first cloning or forking the repository, and then running
```
poetry install
```
in a virtual environment from the repository root. This will read the `pyproject.toml` file in the repository and install all dependencies.
ZodiPy uses [Poetry](https://python-poetry.org/) for package managing. To build and commit to the repository with the existing pre-commit setup, developers need to have Poetry (>= 1.8.0) installed. See the Poetry [documentation](https://python-poetry.org/docs/) for installation guide.

### pip
Developers not using Poetry can install ZodiPy in a virtual environment with all dependencies by first cloning or forking the repository and then running
After poetry has been installed, developers should create a new virtual environment and run the following in the root of the ZodiPy repositry
```
pip install -r requirements-dev.txt
poetry install
```
from the repositry root. This will read and download all the dependencies from the `requirements-dev.txt` file in the repository.

Note that developers using Python 3.12 will need to upgrade their pip versions with `python3 -m pip install --upgrade pip` before being able to install ZodiPy. This is due to known incompatibilities between older pip versions and Python 3.12
This will read and download all dependencies from `pyproject.toml`, and `poetry.lock`.

### Tests, linting and formatting, and building documentation
The following tools should be run from the root of the repository with no errors. (These are ran automatically as part of the CI workflows on GitHub, but should be tested locally first)
Expand Down
8 changes: 4 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
ZodiPy is an [Astropy-affiliated](https://www.astropy.org/affiliated/) package for simulating zodiacal light in intensity for arbitrary Solar system observers.
![ZodiPy Logo](img/zodipy_map.png)


## A simple example
```python
import astropy.units as u
Expand All @@ -26,10 +25,10 @@ from astropy.time import Time

import zodipy

# Initialize a zodiacal light model at a wavelength/frequency or at a bandpass
# Initialize a zodiacal light model at a wavelength/frequency or over a bandpass
model = zodipy.Model(25*u.micron, name="DIRBE")

# ZodiPy uses astropy's `SkyCoord` for coordinate inputs
# Use Astropy's `SkyCoord` to specify coordinate
lon = [10, 10.1, 10.2] * u.deg
lat = [90, 89, 88] * u.deg
skycoord = SkyCoord(
Expand All @@ -38,7 +37,8 @@ skycoord = SkyCoord(
obstime=Time("2022-01-01 12:00:00"),
frame="galactic",
)
# The zodiacal light model is evaluated

# Compute the zodiacal light as seen from Earth
emission = model.evaluate(skycoord, obspos="earth")

print(emission)
Expand Down
2 changes: 1 addition & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ In the following, we simulate a scan across the Ecliptic plane
{!examples/ecliptic_scan.py!}
```

![Ecliptic scan profile](img/timestream.png)
![Ecliptic scan profile](img/ecliptic_scan.png)


### HEALPIx maps
Expand Down
9 changes: 3 additions & 6 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ theme:
- content.code.copy
- content.code.select
- navigation.tabs
- navigation.instant
- navigation.top
markdown_extensions:
- markdown_include.include:
base_path: docs
Expand Down Expand Up @@ -67,9 +69,4 @@ plugins:
docstring_section_style: spacy
signature_crossrefs: true
show_symbol_type_heading: true
show_symbol_type_toc: true
# - mkdocstrings:
# default_handler: python
# handlers:
# options:
# merge_init_into_class: true
show_symbol_type_toc: true
16 changes: 8 additions & 8 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "zodipy"
version = "0.9.2"
version = "1.0.0"
description = "A Python package for zodiacal light simulations"
authors = ["Metin San <[email protected]>"]
readme = "README.md"
Expand Down Expand Up @@ -102,6 +102,7 @@ lint.select = [
"PLW",
"TRY",
"RUF",
"NPY201"
]
line-length = 100
lint.ignore = [
Expand Down
Loading

0 comments on commit 622501b

Please sign in to comment.