Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mfouesneau committed Oct 15, 2024
1 parent 319366b commit 251c7c8
Show file tree
Hide file tree
Showing 14 changed files with 321 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: deploy

on:
# Trigger the workflow on push to main branch
push:
branches:
- main

# This job installs dependencies, build the book, and pushes it to `gh-pages`
jobs:
build-and-deploy-book:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.9]
steps:
- uses: actions/checkout@v2

# Install dependencies
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: apt install system packages
run: |
sudo apt install -y graphviz ffmpeg
- name: Install dependencies
run: |
pip install pip --upgrade
pip install uv
uv pip install -r requirements.txt --system
# Build the book
- name: Build the book
run: |
jupyter-book build doc
# Deploy the book's HTML to gh-pages branch
- name: GitHub Pages action
uses: peaceiris/actions-gh-pages@v3.6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: doc/_build/html
133 changes: 133 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
.DS_Store

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# builds
**/_build/**
15 changes: 15 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
We adopt a code of conduct that ensures a productive, respectful environment for all open source contributors and participants. We are committed to providing a strong and enforced code of conduct and expect everyone in our community to follow these guidelines when interacting with others in all forums. Our goal is to keep ours a positive, inclusive, thriving, and growing community. The community of participants in open source Astronomy projects such as this present work includes members from around the globe with diverse skills, personalities, and experiences. It is through these differences that our community experiences success and continued growth.

We expect all contributors to adhere to the following principles:

We treat each other with respect and do not tolerate any form of discrimination based on ethnicity, gender, disability, religion or belief, age or sexual orientation or identity. We believe that science is a diverse endeavor: diversity provides new impulses, new ideas, new perspectives, and innovation.

We conduct our research and support the research of others with integrity and according to the highest scientific standards. We are committed to scientific integrity and abiding by the guidelines of good scientific practice. We value scientific quality over quantity.

We discuss problems and implement solutions openly and respectfully; we communicate the principles and processes that underlie our actions and decisions.

We recognize the achievements of others, give credit where it is due, and offer constructive feedback when necessary. Science and innovation depend on an open and constructive discourse in which new ideas can be freely exchanged and old wisdom challenged.

We support each other in achieving our goals by nurturing trust and cooperation and respecting individual capabilities and needs. We know that research is often highly competitive, and people can feel under pressure to produce results. Because of these circumstances, we are committed to being mindful of personal boundaries and contributing to a nurturing work environment based on trust and mutual respect.

Any violations of this Code of Conduct should be reported to any of the core authors of this project.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please open a new issue or new pull request for bugs, feedback, or new features you would like to see. If there is an issue you would like to work on, please leave a comment, and we will be happy to assist. New contributions and contributors are very welcome!
38 changes: 38 additions & 0 deletions doc/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#######################################################################################
# A default configuration that will be loaded for all jupyter books
# See the documentation for help and more options:
# https://jupyterbook.org/customize/config.html

#######################################################################################
# Book settings
title: jax-astro-guide # The title of the book. Will be placed in the left navbar.
author: Jaxstronomy # The author of the book
copyright: "2024" # Copyright year to be placed in the footer
logo: assets/logo.png # A path to the book logo

# Force re-execution of notebooks on each build.
# See https://jupyterbook.org/content/execute.html
execute:
execute_notebooks: auto
timeout: -1

# Define the name of the latex output file for PDF builds
latex:
latex_documents:
targetname: book.tex

# Add a bibtex file so that we can create citations
bibtex_bibfiles:
- references.bib

# Information about where the book exists on the web
repository:
url: https://github.com/JAXtronomy/jax-astro-guide # Online location of your book
path_to_book: docs # Optional path to your book, relative to the repository root
branch: main # Which branch of the repository should be used when creating links (optional)

# Add GitHub buttons to your book
# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository
html:
use_issues_button: true
use_repository_button: true
19 changes: 19 additions & 0 deletions doc/_toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Table of contents
# Learn more at https://jupyterbook.org/customize/toc.html

format: jb-book
root: intro

parts:
- caption: Introduction
chapters:
- file: chapters/preface
- file: chapters/requirements

- caption: jax
chapters:
- file: chapters/jax/introduction

- caption: numpyro
chapters:
- file: chapters/numpyro/introduction
Binary file added doc/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions doc/chapters/jax/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Jax
1 change: 1 addition & 0 deletions doc/chapters/numpyro/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Numpyro
1 change: 1 addition & 0 deletions doc/chapters/preface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Preface
9 changes: 9 additions & 0 deletions doc/chapters/requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Prerequisites

This repo uses the Python 3 programming language, along with a standard set of numerical and data visualization tools in astronomy, scientific experiments, and open-source projects. According to regular surveys, Python is the primary programming language of about 80% of astronomers today. By learning the Python language, you will join a community of millions of software developers and data scientists.

## Getting Started.

A Python program can be executed by any computer, regardless of manufacturer or operating system, provided that support for the language is installed. If you wish to install the version of Python and the libraries that will match this book, we recommend the Python 3 language interpreter. You can also use web-based environments such as [Google Colab](https://colab.research.google.com/), [Deepnote](https://deepnote.com), etc.

This text includes a complete introduction to all of these computational tools. You will learn to write programs, generate figures and files from data, and work with public real-world data sets.
38 changes: 38 additions & 0 deletions doc/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# A primer on Data Science in Astronomy

This repository is a tentative book on the basics of varied tools using Astronomy language.

This book uses Python as the default programming language.

:::{note}
Python occupies a large fraction of software development in astronomy today.
But other languages are as valid for data science.
:::

:::{warning}
This page is not updated from the template
:::

Check out the content pages bundled with this sample book to see more.


# Acknowledgements

Jupyter Book is supported by an [open community of contributors](https://github.com/executablebooks/jupyter-book/graphs/contributors), many of whom come from [the Executable Books Community](https://executablebooks.org) and [the Jupyter community](https://jupyter.org/community).

::::{grid} 2 2 2 2

:::{grid-item}
:columns: 4

```{image} https://sloan.org/storage/app/media/uploaded-files/Logo-1B-SMALL-Gold-Blue.png
:class: m-auto
:width: 200px
```

:::

:::{grid-item}
:columns: 7
Many thanks to the Sloan Foundation, which [provides support for the Executable Books Project](https://sloan.org/grant-detail/9231).
:::
Empty file added doc/references.bib
Empty file.
21 changes: 21 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Cython
astropy
dask
distributed
flax
ghp-import
graphviz
jax
jaxlib
jupyter-book
jupytext
matplotlib
numpy
pandas
plotly
pytest
scikit-learn
snakemake
tensorflow
torch
numpyro

0 comments on commit 251c7c8

Please sign in to comment.