diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index a7b2f8dd..13c8bd44 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -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 @@ -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 diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 76e146cc..6498c184 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -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 @@ -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 diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 13f22dee..0f9cec17 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -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 }} @@ -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 diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..fe6a07a9 --- /dev/null +++ b/.readthedocs.yaml @@ -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 \ No newline at end of file diff --git a/README.md b/README.md index 12526234..7af68fb7 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,15 @@ -[![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 + + + + caustics logo + + + +[![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 @@ -10,14 +17,14 @@ 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 diff --git a/caustic/__init__.py b/caustics/__init__.py similarity index 90% rename from caustic/__init__.py rename to caustics/__init__.py index 5cb9174a..b83a1af1 100644 --- a/caustic/__init__.py +++ b/caustics/__init__.py @@ -1,4 +1,4 @@ -__version__ = '0.4.10' +__version__ = '0.5.0' __author__ = "Ciela" from .constants import * diff --git a/caustic/constants.py b/caustics/constants.py similarity index 100% rename from caustic/constants.py rename to caustics/constants.py diff --git a/caustic/cosmology.py b/caustics/cosmology.py similarity index 100% rename from caustic/cosmology.py rename to caustics/cosmology.py diff --git a/caustic/data/__init__.py b/caustics/data/__init__.py similarity index 100% rename from caustic/data/__init__.py rename to caustics/data/__init__.py diff --git a/caustic/data/hdf5dataset.py b/caustics/data/hdf5dataset.py similarity index 100% rename from caustic/data/hdf5dataset.py rename to caustics/data/hdf5dataset.py diff --git a/caustic/data/illustris_kappa.py b/caustics/data/illustris_kappa.py similarity index 100% rename from caustic/data/illustris_kappa.py rename to caustics/data/illustris_kappa.py diff --git a/caustic/data/probes.py b/caustics/data/probes.py similarity index 100% rename from caustic/data/probes.py rename to caustics/data/probes.py diff --git a/caustic/lenses/__init__.py b/caustics/lenses/__init__.py similarity index 100% rename from caustic/lenses/__init__.py rename to caustics/lenses/__init__.py diff --git a/caustic/lenses/base.py b/caustics/lenses/base.py similarity index 100% rename from caustic/lenses/base.py rename to caustics/lenses/base.py diff --git a/caustic/lenses/epl.py b/caustics/lenses/epl.py similarity index 100% rename from caustic/lenses/epl.py rename to caustics/lenses/epl.py diff --git a/caustic/lenses/external_shear.py b/caustics/lenses/external_shear.py similarity index 100% rename from caustic/lenses/external_shear.py rename to caustics/lenses/external_shear.py diff --git a/caustic/lenses/mass_sheet.py b/caustics/lenses/mass_sheet.py similarity index 100% rename from caustic/lenses/mass_sheet.py rename to caustics/lenses/mass_sheet.py diff --git a/caustic/lenses/multiplane.py b/caustics/lenses/multiplane.py similarity index 100% rename from caustic/lenses/multiplane.py rename to caustics/lenses/multiplane.py diff --git a/caustic/lenses/nfw.py b/caustics/lenses/nfw.py similarity index 100% rename from caustic/lenses/nfw.py rename to caustics/lenses/nfw.py diff --git a/caustic/lenses/pixelated_convergence.py b/caustics/lenses/pixelated_convergence.py similarity index 100% rename from caustic/lenses/pixelated_convergence.py rename to caustics/lenses/pixelated_convergence.py diff --git a/caustic/lenses/point.py b/caustics/lenses/point.py similarity index 100% rename from caustic/lenses/point.py rename to caustics/lenses/point.py diff --git a/caustic/lenses/pseudo_jaffe.py b/caustics/lenses/pseudo_jaffe.py similarity index 100% rename from caustic/lenses/pseudo_jaffe.py rename to caustics/lenses/pseudo_jaffe.py diff --git a/caustic/lenses/sie.py b/caustics/lenses/sie.py similarity index 100% rename from caustic/lenses/sie.py rename to caustics/lenses/sie.py diff --git a/caustic/lenses/singleplane.py b/caustics/lenses/singleplane.py similarity index 100% rename from caustic/lenses/singleplane.py rename to caustics/lenses/singleplane.py diff --git a/caustic/lenses/sis.py b/caustics/lenses/sis.py similarity index 100% rename from caustic/lenses/sis.py rename to caustics/lenses/sis.py diff --git a/caustic/lenses/tnfw.py b/caustics/lenses/tnfw.py similarity index 100% rename from caustic/lenses/tnfw.py rename to caustics/lenses/tnfw.py diff --git a/caustic/lenses/utils.py b/caustics/lenses/utils.py similarity index 100% rename from caustic/lenses/utils.py rename to caustics/lenses/utils.py diff --git a/caustic/light/__init__.py b/caustics/light/__init__.py similarity index 100% rename from caustic/light/__init__.py rename to caustics/light/__init__.py diff --git a/caustic/light/base.py b/caustics/light/base.py similarity index 100% rename from caustic/light/base.py rename to caustics/light/base.py diff --git a/caustic/light/pixelated.py b/caustics/light/pixelated.py similarity index 100% rename from caustic/light/pixelated.py rename to caustics/light/pixelated.py diff --git a/caustic/light/probes.py b/caustics/light/probes.py similarity index 100% rename from caustic/light/probes.py rename to caustics/light/probes.py diff --git a/caustic/light/sersic.py b/caustics/light/sersic.py similarity index 100% rename from caustic/light/sersic.py rename to caustics/light/sersic.py diff --git a/caustic/namespace_dict.py b/caustics/namespace_dict.py similarity index 100% rename from caustic/namespace_dict.py rename to caustics/namespace_dict.py diff --git a/caustic/packed.py b/caustics/packed.py similarity index 100% rename from caustic/packed.py rename to caustics/packed.py diff --git a/caustic/parameter.py b/caustics/parameter.py similarity index 97% rename from caustic/parameter.py rename to caustics/parameter.py index 4d3acbd0..c87d9be8 100644 --- a/caustic/parameter.py +++ b/caustics/parameter.py @@ -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. diff --git a/caustic/parametrized.py b/caustics/parametrized.py similarity index 100% rename from caustic/parametrized.py rename to caustics/parametrized.py diff --git a/caustic/sims/__init__.py b/caustics/sims/__init__.py similarity index 100% rename from caustic/sims/__init__.py rename to caustics/sims/__init__.py diff --git a/caustic/sims/lens_source.py b/caustics/sims/lens_source.py similarity index 91% rename from caustic/sims/lens_source.py rename to caustics/sims/lens_source.py index aa57af60..d17b6e42 100644 --- a/caustic/sims/lens_source.py +++ b/caustics/sims/lens_source.py @@ -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). diff --git a/caustic/sims/simulator.py b/caustics/sims/simulator.py similarity index 100% rename from caustic/sims/simulator.py rename to caustics/sims/simulator.py diff --git a/caustic/utils.py b/caustics/utils.py similarity index 100% rename from caustic/utils.py rename to caustics/utils.py diff --git a/docs/conf.py b/docs/conf.py index d3be07a7..4cf235a0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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 --------------------------------------------------- @@ -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 ------------------------------------------------ @@ -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'), ] @@ -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) ] @@ -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'), ] diff --git a/docs/contributing.rst b/docs/contributing.rst index b384222c..fbed92c6 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -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**. @@ -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 `_. 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 `_. 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 ------------------- @@ -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**. diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 1bd0d949..02d7db8d 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -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 `_ 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 `_ 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. diff --git a/docs/illustrative_examples.rst b/docs/illustrative_examples.rst index 665abf78..77ddc1e2 100644 --- a/docs/illustrative_examples.rst +++ b/docs/illustrative_examples.rst @@ -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. diff --git a/docs/index.rst b/docs/index.rst index a0702a5e..0b4ca666 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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 ============= diff --git a/docs/install.rst b/docs/install.rst index 077356f2..4d67dc7a 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -7,9 +7,9 @@ Regular Install 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. +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. Developer Install @@ -17,13 +17,13 @@ Developer Install First clone the repo with:: - git clone git@github.com:Ciela-Institute/caustic.git + git clone git@github.com:Ciela-Institute/caustics.git -this will create a directory `caustic` wherever you ran the command. Next go into the directory and install in developer mode:: +this will create a directory `caustics` wherever you ran the command. Next go into the directory and install in developer mode:: pip install -e ".[dev]" -this will install all relevant libraries and then install caustic in an editable format so any changes you make to the code will be included next time you import the package. To start making changes you should immediately create a new branch:: +this will install all relevant libraries and then install caustics in an editable format so any changes you make to the code will be included next time you import the package. To start making changes you should immediately create a new branch:: git checkout -b diff --git a/docs/license.rst b/docs/license.rst index 54abbeda..5428e129 100644 --- a/docs/license.rst +++ b/docs/license.rst @@ -4,7 +4,7 @@ License MIT License -Copyright (c) [2023] [caustic authors] +Copyright (c) [2023] [caustics authors] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/docs/modules.rst b/docs/modules.rst index a922b553..446b67c7 100644 --- a/docs/modules.rst +++ b/docs/modules.rst @@ -1,7 +1,7 @@ -caustic +caustics ======= .. toctree:: :maxdepth: 4 - caustic + caustics diff --git a/docs/pull_notebooks.py b/docs/pull_notebooks.py index 70d94919..cc928977 100644 --- a/docs/pull_notebooks.py +++ b/docs/pull_notebooks.py @@ -1,11 +1,11 @@ import requests tutorials = [ - "https://raw.github.com/Ciela-Institute/caustic-tutorials/main/tutorials/BasicIntroduction.ipynb", - "https://raw.github.com/Ciela-Institute/caustic-tutorials/main/tutorials/LensZoo.ipynb", - "https://raw.github.com/Ciela-Institute/caustic-tutorials/main/tutorials/VisualizeCaustics.ipynb", - "https://raw.github.com/Ciela-Institute/caustic-tutorials/main/tutorials/MultiplaneDemo.ipynb", - "https://raw.github.com/Ciela-Institute/caustic-tutorials/main/tutorials/InvertLensEquation.ipynb", + "https://raw.github.com/Ciela-Institute/caustics-tutorials/main/tutorials/BasicIntroduction.ipynb", + "https://raw.github.com/Ciela-Institute/caustics-tutorials/main/tutorials/LensZoo.ipynb", + "https://raw.github.com/Ciela-Institute/caustics-tutorials/main/tutorials/VisualizeCaustics.ipynb", + "https://raw.github.com/Ciela-Institute/caustics-tutorials/main/tutorials/MultiplaneDemo.ipynb", + "https://raw.github.com/Ciela-Institute/caustics-tutorials/main/tutorials/InvertLensEquation.ipynb", ] for url in tutorials: try: diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..a25ab063 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,4 @@ +wheel +sphinx +sphinx_rtd_theme +nbsphinx diff --git a/media/caustic_favicon.ico b/media/caustic_favicon.ico deleted file mode 100644 index 8973d1d3..00000000 Binary files a/media/caustic_favicon.ico and /dev/null differ diff --git a/media/caustics_favicon.ico b/media/caustics_favicon.ico new file mode 100644 index 00000000..4b949fe4 Binary files /dev/null and b/media/caustics_favicon.ico differ diff --git a/media/caustics_logo.png b/media/caustics_logo.png new file mode 100644 index 00000000..5c8b91f6 Binary files /dev/null and b/media/caustics_logo.png differ diff --git a/media/caustics_logo_white.png b/media/caustics_logo_white.png new file mode 100644 index 00000000..6e782b2e Binary files /dev/null and b/media/caustics_logo_white.png differ diff --git a/scripts/README.md b/scripts/README.md deleted file mode 100644 index e1a97819..00000000 --- a/scripts/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Scripts - -Examples of setting up simulators and analyses with `caustic`. diff --git a/setup.py b/setup.py index 8cf7ca2b..22606b40 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ import os from setuptools import setup, find_packages -import caustic.__init__ as caustic +import caustics.__init__ as caustics def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() @@ -11,13 +11,13 @@ def read_lines(fname): return ret setup( - name = "caustic", - version=caustic.__version__, + name = "caustics", + version=caustics.__version__, description="A gravitational lensing simulator for the future", long_description=read("README.md"), long_description_content_type='text/markdown', - url="https://github.com/Ciela-Institute/caustic", - author=caustic.__author__, + url="https://github.com/Ciela-Institute/caustics", + author=caustics.__author__, license="MIT license", packages=find_packages(), install_requires=read_lines("requirements.txt"), diff --git a/test/test_base.py b/test/test_base.py index 1b2a8b31..60068931 100644 --- a/test/test_base.py +++ b/test/test_base.py @@ -3,8 +3,8 @@ import torch import numpy as np -from caustic.cosmology import FlatLambdaCDM -from caustic.lenses import SIE +from caustics.cosmology import FlatLambdaCDM +from caustics.lenses import SIE def test(): diff --git a/test/test_batching.py b/test/test_batching.py index a0676359..7671b569 100644 --- a/test/test_batching.py +++ b/test/test_batching.py @@ -38,7 +38,7 @@ def test_vmapped_simulator_with_pixelated_modules(): print(x[2].shape) assert vmap(sim)(x).shape == torch.Size([2, n_pix, n_pix]) - # test tensor input: Does not work well with images since it would require unflattening the images in caustic + # test tensor input: Does not work well with images since it would require unflattening the images in caustics # x_tensor = torch.concat([_x.view(2, -1) for _x in x], dim=1) # print(x_tensor.shape) # assert vmap(sim)(x_tensor).shape == torch.Size([2, n_pix, n_pix]) diff --git a/test/test_cosmology.py b/test/test_cosmology.py index b2000aae..717af7bf 100644 --- a/test/test_cosmology.py +++ b/test/test_cosmology.py @@ -5,14 +5,14 @@ from astropy.cosmology import Cosmology as Cosmology_AP from astropy.cosmology import FlatLambdaCDM as AstropyFlatLambdaCDM -from caustic.cosmology import Cosmology -from caustic.cosmology import FlatLambdaCDM as CausticFlatLambdaCDM -from caustic.cosmology import Om0_default, h0_default +from caustics.cosmology import Cosmology +from caustics.cosmology import FlatLambdaCDM as CausticFlatLambdaCDM +from caustics.cosmology import Om0_default, h0_default def get_cosmologies() -> List[Tuple[Cosmology, Cosmology_AP]]: """ - Gets caustic cosmologies and corresponding astropy ones. + Gets caustics cosmologies and corresponding astropy ones. """ cosmologies = [] cosmologies.append( diff --git a/test/test_epl.py b/test/test_epl.py index f231e28d..947f86bc 100644 --- a/test/test_epl.py +++ b/test/test_epl.py @@ -5,8 +5,8 @@ from lenstronomy.LensModel.lens_model import LensModel from utils import Psi_test_helper, alpha_test_helper, kappa_test_helper -from caustic.cosmology import FlatLambdaCDM -from caustic.lenses import EPL +from caustics.cosmology import FlatLambdaCDM +from caustics.lenses import EPL def test_lenstronomy(): diff --git a/test/test_external_shear.py b/test/test_external_shear.py index 6a8f1fa2..e970294e 100644 --- a/test/test_external_shear.py +++ b/test/test_external_shear.py @@ -2,8 +2,8 @@ from lenstronomy.LensModel.lens_model import LensModel from utils import lens_test_helper -from caustic.cosmology import FlatLambdaCDM -from caustic.lenses import ExternalShear +from caustics.cosmology import FlatLambdaCDM +from caustics.lenses import ExternalShear def test(): diff --git a/test/test_interpolate_image.py b/test/test_interpolate_image.py index c4ee2519..06056e46 100644 --- a/test/test_interpolate_image.py +++ b/test/test_interpolate_image.py @@ -2,8 +2,8 @@ import torch from scipy.interpolate import RegularGridInterpolator -from caustic.utils import get_meshgrid, interp2d -from caustic.light import Pixelated +from caustics.utils import get_meshgrid, interp2d +from caustics.light import Pixelated def test_random_inbounds(): diff --git a/test/test_jacobian_lens_equation.py b/test/test_jacobian_lens_equation.py index 88066581..9b0bd94e 100644 --- a/test/test_jacobian_lens_equation.py +++ b/test/test_jacobian_lens_equation.py @@ -5,9 +5,9 @@ from lenstronomy.LensModel.lens_model import LensModel from utils import lens_test_helper -from caustic.cosmology import FlatLambdaCDM -from caustic.lenses import SIE, Multiplane -from caustic.utils import get_meshgrid +from caustics.cosmology import FlatLambdaCDM +from caustics.lenses import SIE, Multiplane +from caustics.utils import get_meshgrid def test_jacobian_autograd_vs_finitediff(): # Models diff --git a/test/test_kappa_grid.py b/test/test_kappa_grid.py index 88f9da76..be5b1d61 100644 --- a/test/test_kappa_grid.py +++ b/test/test_kappa_grid.py @@ -1,8 +1,8 @@ import torch -from caustic.cosmology import FlatLambdaCDM -from caustic.lenses import PixelatedConvergence, PseudoJaffe -from caustic.utils import get_meshgrid +from caustics.cosmology import FlatLambdaCDM +from caustics.lenses import PixelatedConvergence, PseudoJaffe +from caustics.utils import get_meshgrid def _setup(n_pix, mode, use_next_fast_len, padding = "zero"): diff --git a/test/test_masssheet.py b/test/test_masssheet.py index 2f0bb96d..539cbf9e 100644 --- a/test/test_masssheet.py +++ b/test/test_masssheet.py @@ -5,9 +5,9 @@ from lenstronomy.LensModel.lens_model import LensModel from utils import lens_test_helper -from caustic.cosmology import FlatLambdaCDM -from caustic.lenses import MassSheet -from caustic.utils import get_meshgrid +from caustics.cosmology import FlatLambdaCDM +from caustics.lenses import MassSheet +from caustics.utils import get_meshgrid def test(): diff --git a/test/test_multiplane.py b/test/test_multiplane.py index 130bf00b..f00d4a2a 100644 --- a/test/test_multiplane.py +++ b/test/test_multiplane.py @@ -8,9 +8,9 @@ from utils import lens_test_helper import numpy as np -from caustic.cosmology import FlatLambdaCDM -from caustic.lenses import SIE, Multiplane, PixelatedConvergence -from caustic.utils import get_meshgrid +from caustics.cosmology import FlatLambdaCDM +from caustics.lenses import SIE, Multiplane, PixelatedConvergence +from caustics.utils import get_meshgrid def test(): rtol = 0 diff --git a/test/test_namespace_dict.py b/test/test_namespace_dict.py index 7c33a62c..c5854e74 100644 --- a/test/test_namespace_dict.py +++ b/test/test_namespace_dict.py @@ -1,4 +1,4 @@ -from caustic.namespace_dict import NestedNamespaceDict +from caustics.namespace_dict import NestedNamespaceDict from pytest import raises diff --git a/test/test_nfw.py b/test/test_nfw.py index 3e926b18..9b2c0ea1 100644 --- a/test/test_nfw.py +++ b/test/test_nfw.py @@ -10,8 +10,8 @@ from lenstronomy.LensModel.lens_model import LensModel from utils import lens_test_helper, setup_grids -from caustic.cosmology import FlatLambdaCDM as CausticFlatLambdaCDM -from caustic.lenses import NFW +from caustics.cosmology import FlatLambdaCDM as CausticFlatLambdaCDM +from caustics.lenses import NFW h0_default = float(default_cosmology.get().h) Om0_default = float(default_cosmology.get().Om0) diff --git a/test/test_parameter.py b/test/test_parameter.py index b148472b..c879988b 100644 --- a/test/test_parameter.py +++ b/test/test_parameter.py @@ -1,8 +1,8 @@ import torch -from caustic.lenses import EPL, PixelatedConvergence -from caustic.sims import Simulator -from caustic.cosmology import FlatLambdaCDM -from caustic.light import Pixelated +from caustics.lenses import EPL, PixelatedConvergence +from caustics.sims import Simulator +from caustics.cosmology import FlatLambdaCDM +from caustics.light import Pixelated import pytest # For future PR currently this test fails diff --git a/test/test_parametrized.py b/test/test_parametrized.py index a84f4cce..fa2592a0 100644 --- a/test/test_parametrized.py +++ b/test/test_parametrized.py @@ -2,11 +2,11 @@ from torch import vmap import pytest import numpy as np -from caustic.sims import Simulator -from caustic.parameter import Parameter -from caustic.lenses import EPL -from caustic.light import Sersic -from caustic.cosmology import FlatLambdaCDM +from caustics.sims import Simulator +from caustics.parameter import Parameter +from caustics.lenses import EPL +from caustics.light import Sersic +from caustics.cosmology import FlatLambdaCDM from utils import setup_simulator diff --git a/test/test_pixel_grid.py b/test/test_pixel_grid.py index b0088560..78e9cf5c 100644 --- a/test/test_pixel_grid.py +++ b/test/test_pixel_grid.py @@ -1,7 +1,7 @@ import numpy as np from lenstronomy.Data.pixel_grid import PixelGrid -from caustic.utils import get_meshgrid +from caustics.utils import get_meshgrid def test_get_meshgrid(): diff --git a/test/test_point.py b/test/test_point.py index fd23506d..02317d72 100644 --- a/test/test_point.py +++ b/test/test_point.py @@ -2,8 +2,8 @@ from lenstronomy.LensModel.lens_model import LensModel from utils import lens_test_helper -from caustic.cosmology import FlatLambdaCDM -from caustic.lenses import Point +from caustics.cosmology import FlatLambdaCDM +from caustics.lenses import Point def test(): diff --git a/test/test_pseudo_jaffe.py b/test/test_pseudo_jaffe.py index 81483957..89c64f95 100644 --- a/test/test_pseudo_jaffe.py +++ b/test/test_pseudo_jaffe.py @@ -4,8 +4,8 @@ from lenstronomy.LensModel.lens_model import LensModel from utils import lens_test_helper -from caustic.cosmology import FlatLambdaCDM -from caustic.lenses import PseudoJaffe +from caustics.cosmology import FlatLambdaCDM +from caustics.lenses import PseudoJaffe def test(): diff --git a/test/test_sersic.py b/test/test_sersic.py index ba9da939..cecdfe67 100644 --- a/test/test_sersic.py +++ b/test/test_sersic.py @@ -6,8 +6,8 @@ from lenstronomy.Data.pixel_grid import PixelGrid from lenstronomy.LightModel.light_model import LightModel -from caustic.light import Sersic -from caustic.utils import get_meshgrid +from caustics.light import Sersic +from caustics.utils import get_meshgrid def test(): diff --git a/test/test_sie.py b/test/test_sie.py index 38051afb..c9827bb3 100644 --- a/test/test_sie.py +++ b/test/test_sie.py @@ -5,9 +5,9 @@ from lenstronomy.LensModel.lens_model import LensModel from utils import lens_test_helper -from caustic.cosmology import FlatLambdaCDM -from caustic.lenses import SIE -from caustic.utils import get_meshgrid +from caustics.cosmology import FlatLambdaCDM +from caustics.lenses import SIE +from caustics.utils import get_meshgrid def test(): diff --git a/test/test_simulator.py b/test/test_simulator.py index 8b73bc8c..562306ee 100644 --- a/test/test_simulator.py +++ b/test/test_simulator.py @@ -2,11 +2,11 @@ import torch -from caustic.sims import Lens_Source -from caustic.cosmology import FlatLambdaCDM -from caustic.lenses import SIE -from caustic.light import Sersic -from caustic.utils import get_meshgrid, gaussian +from caustics.sims import Lens_Source +from caustics.cosmology import FlatLambdaCDM +from caustics.lenses import SIE +from caustics.light import Sersic +from caustics.utils import get_meshgrid, gaussian def test_simulator_runs(): diff --git a/test/test_sis.py b/test/test_sis.py index dd3f47a6..1b4e460a 100644 --- a/test/test_sis.py +++ b/test/test_sis.py @@ -2,8 +2,8 @@ from lenstronomy.LensModel.lens_model import LensModel from utils import lens_test_helper -from caustic.cosmology import FlatLambdaCDM -from caustic.lenses import SIS +from caustics.cosmology import FlatLambdaCDM +from caustics.lenses import SIS def test(): diff --git a/test/test_tnfw.py b/test/test_tnfw.py index 83a1709c..c721aafa 100644 --- a/test/test_tnfw.py +++ b/test/test_tnfw.py @@ -10,8 +10,8 @@ from lenstronomy.LensModel.lens_model import LensModel from utils import lens_test_helper, setup_grids -from caustic.cosmology import FlatLambdaCDM as CausticFlatLambdaCDM -from caustic.lenses import TNFW +from caustics.cosmology import FlatLambdaCDM as CausticFlatLambdaCDM +from caustics.lenses import TNFW h0_default = float(default_cosmology.get().h) Om0_default = float(default_cosmology.get().Om0) diff --git a/test/utils.py b/test/utils.py index 4d1e89a2..72a9ef68 100644 --- a/test/utils.py +++ b/test/utils.py @@ -6,11 +6,11 @@ from lenstronomy.Data.pixel_grid import PixelGrid from lenstronomy.LensModel.lens_model import LensModel -from caustic.lenses import ThinLens, EPL, NFW, ThickLens, PixelatedConvergence -from caustic.light import Sersic, Pixelated -from caustic.utils import get_meshgrid -from caustic.sims import Simulator -from caustic.cosmology import FlatLambdaCDM +from caustics.lenses import ThinLens, EPL, NFW, ThickLens, PixelatedConvergence +from caustics.light import Sersic, Pixelated +from caustics.utils import get_meshgrid +from caustics.sims import Simulator +from caustics.cosmology import FlatLambdaCDM def setup_simulator(cosmo_static=False, use_nfw=True, simulator_static=False, batched_params=False): n_pix = 20