Skip to content

Commit 1a99511

Browse files
authored
Merge pull request #9 from Cosmoglobe/dev
Add installation instructions for developers
2 parents 21dd61a + 52f7f44 commit 1a99511

7 files changed

+1902
-588
lines changed

.gitignore

+166-23
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,174 @@
1-
.DS_Store
2-
.vscode
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
35

4-
# Byte compilation
5-
__pycache__
6+
# C extensions
7+
*.so
68

79
# Distribution / packaging
8-
dist
9-
build
10-
.pytest_cache
11-
.mypy_cache
12-
.hypothesis
13-
.tox
14-
.eggs
15-
.cache
16-
htmlcov
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
1743
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
1847
coverage.xml
19-
UNKNOWN.egg-info
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
2072
docs/_build/
21-
site
22-
# Development files and directories
23-
context.py
24-
test.py
25-
fitting
26-
zodipy/_integration.py
2773

28-
# data
29-
dirbe
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102+
#poetry.lock
103+
104+
# pdm
105+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106+
#pdm.lock
107+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108+
# in version control.
109+
# https://pdm.fming.dev/#use-with-ide
110+
.pdm.toml
30111

31-
TODO.md
112+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113+
__pypackages__/
114+
115+
# Celery stuff
116+
celerybeat-schedule
117+
celerybeat.pid
118+
119+
# SageMath parsed files
120+
*.sage.py
121+
122+
# Environments
123+
.env
124+
.venv
125+
env/
126+
venv/
127+
ENV/
128+
env.bak/
129+
venv.bak/
130+
131+
# Spyder project settings
132+
.spyderproject
133+
.spyproject
134+
135+
# Rope project settings
136+
.ropeproject
137+
138+
# mkdocs documentation
139+
/site
140+
141+
# mypy
142+
.mypy_cache/
143+
.dmypy.json
144+
dmypy.json
145+
146+
# Pyre type checker
147+
.pyre/
148+
149+
# pytype static type analyzer
150+
.pytype/
151+
152+
# Cython debug symbols
153+
cython_debug/
154+
155+
# ruff
156+
.ruff_cache
157+
158+
# PyCharm
159+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
160+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
161+
# and can be added to the global gitignore or merged into this file. For a more nuclear
162+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
163+
#.idea/
164+
165+
# vscode
166+
settings.json
167+
168+
#mac
169+
.DS_Store
170+
.vscode
171+
172+
#files
173+
test.py
174+
context.py

.pre-commit-config.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@ repos:
1111
rev: v0.1.4
1212
hooks:
1313
- id: ruff
14-
- id: ruff-format
14+
- id: ruff-format
15+
16+
hooks:
17+
- id: poetry-export
18+
args: ["--dev", "-f", "requirements.txt", "-o", "requirements-dev.txt"]

CONTRIBUTING.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,8 @@ contributions.
2727
The goal is to maintain a diverse community that's pleasant for everyone.
2828
**Please be considerate and respectful of others**. Everyone must abide by our
2929
[Code of Conduct](https://github.com/Cosmoglobe/zodipy/blob/main/CODE_OF_CONDUCT.md)
30-
and we encourage all to read it carefully.
30+
and we encourage all to read it carefully.
31+
32+
## For developers
33+
34+
Contributers should read the "For developers" section in the project README, which describes the installation and testing steps required during development.

README.md

+57
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ See the [documentation](https://cosmoglobe.github.io/zodipy/) for more informati
2323
# Installation
2424
ZodiPy is installed using `pip install zodipy`.
2525

26+
# Dependencies
27+
ZodiPy supports all Python versions >= 3.8, and has the following dependencies:
28+
- [Astropy](https://www.astropy.org/) (>=5.0.1)
29+
- [NumPy](https://numpy.org/)
30+
- [healpy](https://healpy.readthedocs.io/en/latest/)
31+
- [jplephem](https://pypi.org/project/jplephem/)
32+
33+
2634
# A simple example
2735
```python
2836
import astropy.units as u
@@ -51,6 +59,55 @@ For an overview of the ZodiPy model approach and other information regarding zod
5159

5260
See [CITATION](https://github.com/Cosmoglobe/zodipy/blob/dev/CITATION.bib) if you have used ZodiPy in your work and want to cite the software.
5361

62+
63+
# For developers
64+
Contributing developers will need to download the following additional dependencies:
65+
- pytest
66+
- pytest-cov
67+
- hypothesis (<=6.47.5)
68+
- coverage
69+
- ruff
70+
- mypy
71+
- pre-commit
72+
- mkdocs
73+
- pymdown-extensions
74+
- markdown-include
75+
- mkdocs-material
76+
- mkdocstrings
77+
- mkdocstrings-python
78+
- markdown (<3.4.0)
79+
80+
which are required to test and build ZodiPy.
81+
82+
## Poetry
83+
Developers can install ZodiPy through [Poetry](https://python-poetry.org/) (Poetry >= 1.8.0) by first cloning or forking the repository, and then running
84+
```
85+
poetry install
86+
```
87+
in a virtual environment from the repository root. This will read the `pyproject.toml` file in the repository and install all dependencies.
88+
89+
## pip
90+
Developers not using Poetry can install ZodiPy in a virtual environment with all dependencies by first cloning or forking the repository and then running
91+
```
92+
pip install -r requirements-dev.txt
93+
```
94+
from the repositry root. This will read and download all the dependencies from the `requirements-dev.txt` file in the repository.
95+
96+
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
97+
98+
## Tests and formatting
99+
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)
100+
101+
- [pytest](https://docs.pytest.org/en/8.0.x/): Tests are run with pytest by simply running `pytest` in the command line in the root of the repository.
102+
- [ruff](https://github.com/astral-sh/ruff): Formating and linting is done with `ruff` by simply running `ruff zodipy/` in the command line in the root of the repository.
103+
- [mypy](https://mypy-lang.org/): Type checking is done with `mypy` by simply running `mypy zodipy/` in the root of the repository.
104+
105+
Remeber to add tests when implementing new features to maintain a high code coverage.
106+
107+
## Documentation
108+
We use [MkDocs](https://www.mkdocs.org/) to create our documentation. The documentation is automatically built and uploaded as part of the github CI. New features should be documented by adding content to the `docs/` folder where necessary.
109+
110+
54111
# Funding
55112
This work has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreements No 776282 (COMPET-4; BeyondPlanck), 772253 (ERC; bits2cosmology) and 819478 (ERC; Cosmoglobe).
56113

0 commit comments

Comments
 (0)