Skip to content

Commit

Permalink
Merge pull request #51 from swagnercarena/read_the_docs
Browse files Browse the repository at this point in the history
Read the docs fix
  • Loading branch information
swagnercarena committed Nov 1, 2023
2 parents 2faee7c + c78defc commit 6f6e9ec
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 19 deletions.
13 changes: 10 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
version: 2

build:
image: latest
os: ubuntu-22.04
tools:
python: "3.11"

sphinx:
configuration: docs/conf.py

python:
version: 3.8
install:
- requirements: requirements.txt
- requirements: requirements.txt
- requirements: docs/requirements.txt
19 changes: 19 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
import sys, os
sys.path.append(os.path.abspath("."))
sys.path.append(os.path.abspath("../"))
import paltas


Expand Down
11 changes: 11 additions & 0 deletions docs/paltas.generate.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. paltas:
.. currentmodule:: paltas

:mod:`generate` -- Dataset Generation Module
============================================

.. automodule:: paltas.generate
:members:
:undoc-members:
:show-inheritance:
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sphinx_rtd_theme
4 changes: 2 additions & 2 deletions paltas/Configs/config_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __init__(self,config_path,):
self.base_seed = getattr(
self.config_module,
'seed',
(np.random.randint(np.iinfo(np.uint32).max,)))
(np.random.randint(np.iinfo(np.uint32).max, dtype=np.int64)))
# Make sure base_seed is a sequence, not a number
if isinstance(self.base_seed, (int, float)):
self.base_seed = (self.base_seed,)
Expand Down Expand Up @@ -586,7 +586,7 @@ def _draw_image_drizzle(self):
self.kwargs_numerics = kwargs_numerics_copy
self.numpix = numpix_copy
raise

self.sample['detector_parameters']['pixel_scale'] = detector_pixel_scale
self.numpix = numpix_copy

Expand Down
22 changes: 10 additions & 12 deletions paltas/MainDeflector/simple_deflectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def draw_main_deflector(self):
class PEMDShearFourMultipole(PEMDShear):
"""Class for rendering a main deflector the includes a PEMD profile,
external shear, and order 2, 3, and 4 multipole.
Args:
main_deflector_parameters (dict): A dictionary containing the type of
main deflector and the value for each of its parameters.
Expand All @@ -156,7 +157,9 @@ class PEMDShearFourMultipole(PEMDShear):
Notes:
Uses the lenstronomy EPL class, which is equivalent to PEMD but is pure
python.
Required Parameters
- gamma - power law slope
- theta_E - Einstein radius of the profile in units of arcseconds
- e1 - x-direction ellipticity eccentricity
Expand All @@ -170,22 +173,16 @@ class PEMDShearFourMultipole(PEMDShear):
- z_lens - main deflector redshift
- mult2_a - multipole strength for order 2 multpole
- mult2_phi - multipole order 2 orientation in radians
- mult2_center_x - x-coordinate multipole order 2 center in units of
arcseconds
- mult2_center_y - y-coordinate multipole order 2 center in units of
arcseconds
- mult2_center_x - x-coordinate multipole order 2 center in units of arcseconds
- mult2_center_y - y-coordinate multipole order 2 center in units of arcseconds
- mult3_a - multipole strength for order 2 multpole
- mult3_phi - multipole order 2 orientation in radians
- mult3_center_x - x-coordinate multipole order 2 center in units of
arcseconds
- mult3_center_y - y-coordinate multipole order 2 center in units of
arcseconds
- mult3_center_x - x-coordinate multipole order 2 center in units of arcseconds
- mult3_center_y - y-coordinate multipole order 2 center in units of arcseconds
- mult4_a - multipole strength for order 2 multpole
- mult4_phi - multipole order 2 orientation in radians
- mult4_center_x - x-coordinate multipole order 2 center in units of
arcseconds
- mult4_center_y - y-coordinate multipole order 2 center in units of
arcseconds
- mult4_center_x - x-coordinate multipole order 2 center in units of arcseconds
- mult4_center_y - y-coordinate multipole order 2 center in units of arcseconds
"""
# Define the parameters we expect to find for the DG_19 model
required_parameters = PEMDShear.required_parameters + ('mult2_a',
Expand All @@ -201,6 +198,7 @@ def __init__(self,main_deflector_parameters,cosmology_parameters):
def draw_main_deflector(self):
"""Draws the lenstronomy profile names and kwargs for the components
of the main deflector.
Returns:
(tuple): A tuple of three lists: the first is the profile type for
each component of the main deflector, the second is the
Expand Down
2 changes: 1 addition & 1 deletion paltas/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__author__ = 'Sebastian Wagner-Carena'
__email__ = 'sebaswagner@outlook.com'
__version__ = '0.1.1'
__version__ = '0.2.0'

# Analysis is not imported by default because it required tensorflow.
try:
Expand Down

0 comments on commit 6f6e9ec

Please sign in to comment.