Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request Ciela-Institute#101 from Ciela-Institute/logo
Browse files Browse the repository at this point in the history
add caustics Logo
  • Loading branch information
ConnorStoneAstro authored Nov 21, 2023
2 parents 22ad60e + 0732333 commit d122818
Show file tree
Hide file tree
Showing 79 changed files with 196 additions and 134 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout caustic
- name: Checkout caustics
uses: actions/checkout@v3

- name: Set up Python 3.10
Expand All @@ -40,17 +40,17 @@ jobs:
pip install -r requirements.txt
shell: bash

- name: Install Caustic
- name: Install Caustics
run: |
cd $GITHUB_WORKSPACE
pip install -e .[dev]
pip show caustic
pip show caustics
shell: bash
- name: Test with pytest
run: |
cd $GITHUB_WORKSPACE
pwd
pytest --cov-report=xml --cov=caustic test/
pytest --cov-report=xml --cov=caustics test/
cat coverage.xml
shell: bash
- name: Upload coverage report to Codecov
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
sudo apt-get install -y pandoc
pip install sphinx sphinx_rtd_theme nbsphinx
- name: Install Caustic
- name: Install Caustics
run: |
cd $GITHUB_WORKSPACE
pip install -e .[dev]
pip show caustic
pip show caustics
shell: bash

- name: Clone external Jupyter Notebook repository
Expand All @@ -38,7 +38,7 @@ jobs:
- name: Sphinx build
run: |
sphinx-apidoc -f -o docs/ caustic/
sphinx-apidoc -f -o docs/ caustics/
sphinx-build docs _build
- name: Deploy
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- name: Checkout caustic
- name: Checkout caustics
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -49,11 +49,11 @@ jobs:
pip install -r requirements.txt
shell: bash

- name: Install Caustic
- name: Install Caustics
run: |
cd $GITHUB_WORKSPACE
pip install -e .[dev]
pip show caustic
pip show caustics
shell: bash

- name: Test with pytest
Expand Down
48 changes: 48 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"
# You can also specify other tool versions:
# nodejs: "19"
# rust: "1.64"
# golang: "1.19"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# Specify dependencies to be installed
# Define the system dependencies
build:
os: "ubuntu-20.04"
tools:
python: "3.9"
apt_packages:
- pandoc # Specify pandoc to be installed via apt-get

python:
install:
- requirements: requirements.txt # Path to your requirements.txt file
- requirements: docs/requirements.txt # Path to your requirements.txt file
- method: pip
path: . # Install the package itself

# python:
# install:
# - requirements: docs/requirements.txt
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
[![tests](https://github.com/Ciela-Institute/caustic/actions/workflows/python-app.yml/badge.svg?branch=main)](https://github.com/Ciela-Institute/caustic/actions)
[![Docs](https://github.com/Ciela-Institute/caustic/actions/workflows/documentation.yaml/badge.svg)](https://github.com/Ciela-Institute/caustic/actions/workflows/documentation.yaml)
[![PyPI version](https://badge.fury.io/py/caustic.svg)](https://pypi.org/project/caustic/)
[![coverage](https://img.shields.io/codecov/c/github/Ciela-Institute/caustic)](https://app.codecov.io/gh/Ciela-Institute/caustic)
# caustic
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/Ciela-Institute/caustics/blob/main/media/caustics_logo.png?raw=true">
<source media="(prefers-color-scheme: light)" srcset="https://github.com/Ciela-Institute/caustics/blob/main/media/caustics_logo_white.png?raw=true">
<img alt="caustics logo" src="media/caustics_logo.png" width="70%">
</picture>


[![tests](https://github.com/Ciela-Institute/caustics/actions/workflows/python-app.yml/badge.svg?branch=main)](https://github.com/Ciela-Institute/caustics/actions)
[![Docs](https://github.com/Ciela-Institute/caustics/actions/workflows/documentation.yaml/badge.svg)](https://github.com/Ciela-Institute/caustics/actions/workflows/documentation.yaml)
[![PyPI version](https://badge.fury.io/py/caustics.svg)](https://pypi.org/project/caustics/)
[![coverage](https://img.shields.io/codecov/c/github/Ciela-Institute/caustics)](https://app.codecov.io/gh/Ciela-Institute/caustics)
# caustics

The lensing pipeline of the future: GPU-accelerated, automatically-differentiable,
highly modular. Currently under heavy development: expect interface changes and
some imprecise/untested calculations.

## Installation

Simply install caustic from PyPI:
Simply install caustics from PyPI:
```bash
pip install caustic
pip install caustics
```

## Documentation

Please see our [documentation page](Ciela-Institute.github.io/caustic/) for more detailed information.
Please see our [documentation page](Ciela-Institute.github.io/caustics/) for more detailed information.

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion caustic/__init__.py → caustics/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.4.10'
__version__ = '0.5.0'
__author__ = "Ciela"

from .constants import *
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion caustic/parameter.py → caustics/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class Parameter:
"""
Represents a static or dynamic parameter used for strong gravitational lensing simulations in the caustic codebase.
Represents a static or dynamic parameter used for strong gravitational lensing simulations in the caustics codebase.
A static parameter has a fixed value, while a dynamic parameter must be passed in each time it's required.
Expand Down
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions caustic/sims/lens_source.py → caustics/sims/lens_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ class Lens_Source(Simulator):
Example usage::
import matplotlib.pyplot as plt
import caustic
import caustics
cosmo = caustic.FlatLambdaCDM()
lens = caustic.lenses.SIS(cosmology = cosmo, x0 = 0., y0 = 0., th_ein = 1.)
source = caustic.sources.Sersic(x0 = 0., y0 = 0., q = 0.5, phi = 0.4, n = 2., Re = 1., Ie = 1.)
sim = caustic.sims.Lens_Source(lens, source, pixelscale = 0.05, gridx = 100, gridy = 100, upsample_factor = 2, z_s = 1.)
cosmo = caustics.FlatLambdaCDM()
lens = caustics.lenses.SIS(cosmology = cosmo, x0 = 0., y0 = 0., th_ein = 1.)
source = caustics.sources.Sersic(x0 = 0., y0 = 0., q = 0.5, phi = 0.4, n = 2., Re = 1., Ie = 1.)
sim = caustics.sims.Lens_Source(lens, source, pixelscale = 0.05, gridx = 100, gridy = 100, upsample_factor = 2, z_s = 1.)
img = sim()
plt.imshow(img, origin = "lower")
plt.show()
Attributes:
lens: caustic lens mass model object
source: caustic light object which defines the background source
lens: caustics lens mass model object
source: caustics light object which defines the background source
pixelscale: pixelscale of the sampling grid.
pixels_x: number of pixels on the x-axis for the sampling grid
lens_light (optional): caustic light object which defines the lensing object's light
lens_light (optional): caustics light object which defines the lensing object's light
psf (optional): An image to convolve with the scene. Note that if ``upsample_factor > 1`` the psf must also be at the higher resolution.
pixels_y (optional): number of pixels on the y-axis for the sampling grid. If left as ``None`` then this will simply be equal to ``gridx``
upsample_factor (default 1): Amount of upsampling to model the image. For example ``upsample_factor = 2`` indicates that the image will be sampled at double the resolution then summed back to the original resolution (given by pixelscale and gridx/y).
Expand Down
File renamed without changes.
File renamed without changes.
18 changes: 9 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@

# -- Project information -----------------------------------------------------

project = 'caustic'
project = 'caustics'
copyright = '2023, Ciela Institute'
author = 'Ciela Institute'

# The short X.Y version
version = '0.4'
version = '0.5'
# The full version, including alpha/beta/rc tags
release = 'v0.4.10'
release = 'v0.5.0'


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -106,13 +106,13 @@
# 'searchbox.html']``.
#
# html_sidebars = {}
html_favicon = "../media/caustic_favicon.ico"
html_favicon = "../media/caustics_favicon.ico"


# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'causticdoc'
htmlhelp_basename = 'causticsdoc'


# -- Options for LaTeX output ------------------------------------------------
Expand All @@ -139,7 +139,7 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'caustic.tex', 'caustic Documentation',
(master_doc, 'caustics.tex', 'caustics Documentation',
'Ciela Institute', 'manual'),
]

Expand All @@ -149,7 +149,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'caustic', 'caustic Documentation',
(master_doc, 'caustics', 'caustics Documentation',
[author], 1)
]

Expand All @@ -160,8 +160,8 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'caustic', 'caustic Documentation',
author, 'caustic', 'One line description of project.',
(master_doc, 'caustics', 'caustics Documentation',
author, 'caustics', 'One line description of project.',
'Miscellaneous'),
]

Expand Down
14 changes: 7 additions & 7 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Contributing
.. contents:: Table of Contents
:local:

Thanks for helping make caustic better! Here you will learn the full process needed to contribute to caustic. Following these steps will make the process as painless as possible for everyone.
Thanks for helping make caustics better! Here you will learn the full process needed to contribute to caustics. Following these steps will make the process as painless as possible for everyone.

Create An Issue
---------------

Before actually writing any code, its best to create an issue on the GitHub. Describe the issue in detail and let us know the desired solution. Here it will be possible to address concerns (maybe its aready solved and just not yet documented) and plan out the best solution. We may also assign someone to work on it if that seems better. Note that submitting an issue is a contribution to caustic, we appreciate your ideas! Still, if after discussion it seems that the problem does need some work and you're the person to do it, then we can move on to the next steps.
Before actually writing any code, its best to create an issue on the GitHub. Describe the issue in detail and let us know the desired solution. Here it will be possible to address concerns (maybe its aready solved and just not yet documented) and plan out the best solution. We may also assign someone to work on it if that seems better. Note that submitting an issue is a contribution to caustics, we appreciate your ideas! Still, if after discussion it seems that the problem does need some work and you're the person to do it, then we can move on to the next steps.

1. Navigate to the **Issues** tab of the GitHub repository.
2. Click on **New Issue**.
Expand All @@ -20,14 +20,14 @@ Before actually writing any code, its best to create an issue on the GitHub. Des
Install
-------

Please fork the caustic repo, then follow the developer install instructions at the :doc:`install` page. This will ensure you have a version of caustic that you can tinker with and see the results.
Please fork the caustics repo, then follow the developer install instructions at the :doc:`install` page. This will ensure you have a version of caustics that you can tinker with and see the results.

The reason you should fork the repo is so that you have full control while making your edits. You will still be able to make a Pull Request later when it is time to merge your code with the main caustic branch. Note that you should keep your fork up to date with the caustic repo to make the merge as smooth as possible.
The reason you should fork the repo is so that you have full control while making your edits. You will still be able to make a Pull Request later when it is time to merge your code with the main caustics branch. Note that you should keep your fork up to date with the caustics repo to make the merge as smooth as possible.

Notebooks
---------

You will likely want to see how your changes affect various features of caustic. A good way to quickly see this is to run the tutorial notebooks which can be found `here <https://github.com/Ciela-Institute/caustic-tutorials>`_. Any change that breaks one of these must be addressed, either by changing the nature of your updates to the code, or by forking and updating the caustic-tutorials repo as well (this is usually pretty easy).
You will likely want to see how your changes affect various features of caustics. A good way to quickly see this is to run the tutorial notebooks which can be found `here <https://github.com/Ciela-Institute/caustics-tutorials>`_. Any change that breaks one of these must be addressed, either by changing the nature of your updates to the code, or by forking and updating the caustics-tutorials repo as well (this is usually pretty easy).

Resolving the Issue
-------------------
Expand All @@ -43,12 +43,12 @@ As you modify the code, make sure to regularly commit changes and push them to y
Unit Tests
----------

When you think you've solved an issue, please make unit tests related to any code you have added. Any new code added to caustic must have unit tests which match the level of completion of the rest of the code. Generally you should test all cases for the newly added code. Also ensure the previous unit tests run correctly.
When you think you've solved an issue, please make unit tests related to any code you have added. Any new code added to caustics must have unit tests which match the level of completion of the rest of the code. Generally you should test all cases for the newly added code. Also ensure the previous unit tests run correctly.

Submitting a Pull Request
-------------------------

Once you think your updates are ready to merge with the rest of caustic you can submit a PR! This should provide a description of what you have changed and if it isn't straightforward, why you made those changes.
Once you think your updates are ready to merge with the rest of caustics you can submit a PR! This should provide a description of what you have changed and if it isn't straightforward, why you made those changes.

1. Navigate to the **Pull Requests** tab of the original repository.
2. Click on **New Pull Request**.
Expand Down
4 changes: 2 additions & 2 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Please follow the instructions on the :doc:`install` page. For most users, the b
Tutorials
---------

We have created a repository of tutorial Jupyter notebooks that can help initiate you on the main features of caustic. Please checkout the `tutorials here <https://github.com/Ciela-Institute/caustic-tutorials>`_ to see what caustic can do!
We have created a repository of tutorial Jupyter notebooks that can help initiate you on the main features of caustics. Please checkout the `tutorials here <https://github.com/Ciela-Institute/caustics-tutorials>`_ to see what caustics can do!


Read The Docs
-------------

Docs for all the main functions in caustic are avaialble at :doc:`caustic` at varying degrees of completeness. Further development of the docs is always ongoing.
Docs for all the main functions in caustics are avaialble at :doc:`caustics` at varying degrees of completeness. Further development of the docs is always ongoing.
2 changes: 1 addition & 1 deletion docs/illustrative_examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Examples
========

Here we present a few examples of analysis done with caustic. There will hopefully be one that is close to your use case and so can act as a good starting point.
Here we present a few examples of analysis done with caustics. There will hopefully be one that is close to your use case and so can act as a good starting point.
16 changes: 11 additions & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
.. caustic documentation master file, created by
.. caustics documentation master file, created by
sphinx-quickstart on Thu Jun 1 09:33:32 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to Caustic's documentation!
.. image:: https://github.com/Ciela-Institute/caustics/blob/main/media/AP_logo.png?raw=true
:width: 100 %
:target: https://github.com/Ciela-Institute/caustics

|br|

Welcome to Caustics' documentation!
===================================

The lensing pipeline of the future: GPU-accelerated, automatically-differentiable, highly modular and extensible.

.. note::

Caustic is in its early development phase. This means the API will change with time. These changes are a good thing, but they can be annoying. Watch the version numbers, when we get to 1.0.0 that will be the first stable release!
Caustics is in its early development phase. This means the API will change with time. These changes are a good thing, but they can be annoying. Watch the version numbers, when we get to 1.0.0 that will be the first stable release!

Intallation
===========

The easiest way to install is to make a new virtual environment then run::

pip install caustic
pip install caustics

this will install all the required libraries and then install caustic and you are ready to go! You can check out the tutorials afterwards to see some of caustic's capabilities. If you want to help out with building the caustic code base check out the developer installation instructions instead.
this will install all the required libraries and then install caustics and you are ready to go! You can check out the tutorials afterwards to see some of caustics's capabilities. If you want to help out with building the caustics code base check out the developer installation instructions instead.

Read The Docs
=============
Expand Down
Loading

0 comments on commit d122818

Please sign in to comment.