Skip to content

Commit 034814b

Browse files
authored
DOC: Remove docstring examples (#429)
1 parent 101ad83 commit 034814b

File tree

7 files changed

+0
-135
lines changed

7 files changed

+0
-135
lines changed

CONTRIBUTING.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ All public classes, methods and functions require docstrings. You can build docu
150150
- Description
151151
- Parameters
152152
- Notes
153-
- Examples
154153
- References
155154

156155
For more information see the Astropy guide to `Writing Documentation <https://docs.astropy.org/en/stable/development/docguide.html>`_.

skypy/galaxies/luminosity.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,6 @@ def schechter_lf_magnitude(redshift, M_star, alpha, m_lim, cosmology, size=None,
4646
Absolute magnitude sampled from a Schechter luminosity function for
4747
each input galaxy redshift.
4848
49-
Examples
50-
--------
51-
52-
Sample a number of blue (alpha = -1.3, M_star = -20.5) galaxy magnitudes
53-
brighter than m = 22.0 around redshift 0.5.
54-
55-
>>> import numpy as np
56-
>>> from skypy.galaxies.luminosity import schechter_lf_magnitude
57-
>>> from astropy.cosmology import Planck15
58-
>>> z = np.random.uniform(4.9, 5.1, size=20)
59-
>>> M = schechter_lf_magnitude(z, -20.5, -1.3, 22.0, Planck15)
60-
6149
'''
6250

6351
# only alpha scalars supported at the moment

skypy/galaxies/morphology.py

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@ def angular_size(physical_size, redshift, cosmology):
4040
angular_size : astropy.Quantity
4141
Angular distances in units of [rad] for a given radius.
4242
43-
Examples
44-
--------
45-
>>> from astropy import units
46-
>>> from skypy.galaxies.morphology import angular_size
47-
>>> from astropy.cosmology import Planck15
48-
>>> r = angular_size(10*units.kpc, 1, Planck15)
49-
5043
References
5144
----------
5245
.. [1] D. W. Hogg, (1999), astro-ph/9905116.
@@ -89,14 +82,6 @@ def beta_ellipticity(e_ratio, e_sum, size=None):
8982
----------
9083
.. [1] Kacprzak T., Herbel J., Nicola A. et al., arXiv:1906.01018
9184
92-
Examples
93-
--------
94-
Sample 10000 random variates from the Kacprzak model with
95-
:math:`e_{\rm ratio} = 0.5` and :math:`e_{\rm sum} = 1.0`:
96-
97-
>>> from skypy.galaxies.morphology import beta_ellipticity
98-
>>> ellipticity = beta_ellipticity(0.5, 1.0, size=10000)
99-
10085
'''
10186

10287
# convert to beta distribution parameters
@@ -139,17 +124,6 @@ def late_type_lognormal_size(magnitude, alpha, beta, gamma, M0, sigma1, sigma2,
139124
shape is (ns,). If magnitude has shape (nm,) and size=None,
140125
shape is (nm,).
141126
142-
Examples
143-
--------
144-
>>> import numpy as np
145-
>>> from skypy.galaxies import morphology
146-
>>> magnitude = -16.0
147-
>>> alpha, beta, gamma, M0 = 0.21, 0.53, -1.31, -20.52
148-
>>> sigma1, sigma2 = 0.48, 0.25
149-
>>> s = morphology.late_type_lognormal_size(magnitude, alpha, beta, gamma,
150-
... M0, sigma1, sigma2)
151-
152-
153127
References
154128
----------
155129
.. [1] S. Shen, H.J. Mo, S.D.M. White, M.R. Blanton, G. Kauffmann, W. Voges,
@@ -200,17 +174,6 @@ def early_type_lognormal_size(magnitude, a, b, M0, sigma1, sigma2, size=None):
200174
shape is (ns,). If magnitude has shape (nm,) and size=None,
201175
shape is (nm,).
202176
203-
Examples
204-
--------
205-
>>> import numpy as np
206-
>>> from skypy.galaxies import morphology
207-
>>> magnitude = -20.0
208-
>>> a, b, M0 = 0.6, -4.63, -20.52
209-
>>> sigma1, sigma2 = 0.48, 0.25
210-
>>> s = morphology.early_type_lognormal_size(magnitude, a, b, M0, sigma1,
211-
... sigma2)
212-
213-
214177
References
215178
----------
216179
.. [1] S. Shen, H.J. Mo, S.D.M. White, M.R. Blanton, G. Kauffmann, W. Voges,
@@ -253,14 +216,6 @@ def linear_lognormal_size(magnitude, a_mu, b_mu, sigma, size=None):
253216
shape is (ns,). If magnitude has shape (nm,) and size=None,
254217
shape is (nm,).
255218
256-
Examples
257-
--------
258-
>>> import numpy as np
259-
>>> from skypy.galaxies import morphology
260-
>>> magnitude = -20.0
261-
>>> a_mu, b_mu, sigma =-0.24, -4.63, 0.4
262-
>>> s = morphology.linear_lognormal_size(magnitude, a_mu, b_mu, sigma)
263-
264219
References
265220
----------
266221
.. [1] J. Herbel, T. Kacprzak, A. Amara, A. Refregier, C.Bruderer and
@@ -300,15 +255,6 @@ def ryden04_ellipticity(mu_gamma, sigma_gamma, mu, sigma, size=None):
300255
----------
301256
.. [1] Ryden B. S., 2004, ApJ, 601, 214
302257
303-
Examples
304-
--------
305-
Sample 10000 random variates from the Ryden (2004) model with parameters
306-
:math:`\mu_\gamma = 0.222`, :math:`\sigma_\gamma = 0.056`,
307-
:math:`\mu = -1.85`, and :math:`\sigma = 0.89`.
308-
309-
>>> from skypy.galaxies.morphology import ryden04_ellipticity
310-
>>> ellipticity = ryden04_ellipticity(0.222, 0.056, -1.85, 0.89, size=10000)
311-
312258
'''
313259

314260
# get size if not given

skypy/galaxies/redshift.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,6 @@ def smail(z_median, alpha, beta, size=None):
5858
.. [1] Smail I., Ellis R. S., Fitchett M. J., 1994, MNRAS, 270, 245
5959
.. [2] Amara A., Refregier A., 2007, MNRAS, 381, 1018
6060
61-
Examples
62-
--------
63-
Sample 10 random variates from the Smail model with `alpha = 1.5` and
64-
`beta = 2` and median redshift `z_median = 1.2`.
65-
66-
>>> from skypy.galaxies.redshift import smail
67-
>>> redshift = smail(1.2, 1.5, 2.0, size=10)
68-
6961
'''
7062

7163
k = (alpha+1)/beta
@@ -117,23 +109,6 @@ def schechter_lf_redshift(redshift, M_star, phi_star, alpha, m_lim, sky_area,
117109
Redshifts of the galaxy sample described by the Schechter luminosity
118110
function.
119111
120-
Examples
121-
--------
122-
Compute the number density of galaxies with redshifts between 0 and 5
123-
for typical values of the "blue" galaxy luminosity function above an
124-
apparent magnitude cut of 22 for a survey of 1 square degree = 1/41253 of
125-
the sky.
126-
127-
>>> from skypy.galaxies.redshift import schechter_lf_redshift
128-
>>> from astropy import units
129-
>>> from astropy.cosmology import Planck15
130-
>>> z = [0., 5.]
131-
>>> M_star = -20.5
132-
>>> phi_star = 3.5e-3
133-
>>> alpha = -1.3
134-
>>> sky_area = 1*units.deg**2
135-
>>> z_gal = schechter_lf_redshift(z, M_star, phi_star, alpha, 22, sky_area, Planck15)
136-
137112
'''
138113

139114
# compute lower truncation of scaled Schechter random variable
@@ -260,18 +235,6 @@ def redshifts_from_comoving_density(redshift, density, sky_area, cosmology, nois
260235
Sampled redshifts such that the comoving number density of galaxies
261236
corresponds to the input distribution.
262237
263-
Examples
264-
--------
265-
Sample redshifts with a constant comoving number density 1e-3/Mpc3 up to
266-
redshift 1 for a survey of 1 square degree = 1/41253 of the sky.
267-
268-
>>> from skypy.galaxies.redshift import redshifts_from_comoving_density
269-
>>> from astropy import units
270-
>>> from astropy.cosmology import Planck15
271-
>>> z_range = np.arange(0, 1.01, 0.1)
272-
>>> sky_area = 1*units.deg**2
273-
>>> z_gal = redshifts_from_comoving_density(z_range, 1e-3, sky_area, Planck15)
274-
275238
'''
276239

277240
# redshift number density

skypy/galaxies/spectrum.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,6 @@ def dirichlet_coefficients(redshift, alpha0, alpha1, z1=1., weight=None):
7373
.. [2] Blanton M. R., Roweis S., 2007, The Astronomical Journal,
7474
Volume 133, Page 734
7575
76-
Examples
77-
--------
78-
>>> from skypy.galaxies.spectrum import dirichlet_coefficients
79-
>>> import numpy as np
80-
81-
Sample the coefficients according to [1]_ for n blue galaxies with
82-
redshifts between 0 and 1.
83-
84-
>>> n = 100000
85-
>>> alpha0 = np.array([2.079, 3.524, 1.917, 1.992, 2.536])
86-
>>> alpha1 = np.array([2.265, 3.862, 1.921, 1.685, 2.480])
87-
>>> redshift = np.linspace(0,2, n)
88-
>>> coefficients = dirichlet_coefficients(redshift, alpha0, alpha1)
89-
9076
"""
9177

9278
if np.ndim(alpha0) != 1 or np.ndim(alpha1) != 1:

skypy/utils/random.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,6 @@ def schechter(alpha, x_min, x_max, resolution=100, size=None, scale=1.):
4141
x_sample : array_like
4242
Samples drawn from the Schechter function.
4343
44-
Examples
45-
--------
46-
>>> import skypy.utils.random as random
47-
>>> alpha = -1.3
48-
>>> sample = random.schechter(alpha, x_min=1e-10, x_max=1e2,
49-
... resolution=100, size=1000)
50-
51-
5244
References
5345
----------
5446
.. [1] https://en.wikipedia.org/wiki/Luminosity_function_(astronomy)

skypy/utils/special.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,6 @@ def gammaincc(a, x):
7070
--------
7171
scipy.special.gammaincc : Computes the start of the recurrence.
7272
73-
Examples
74-
--------
75-
This implementation of `gammaincc` supports positive and negative values
76-
of `a`.
77-
78-
>>> from skypy.utils.special import gammaincc
79-
>>> gammaincc([-1.5, -0.5, 0.5, 1.5], 1.2)
80-
array([ 0.03084582, -0.03378949, 0.12133525, 0.49363462])
81-
8273
'''
8374
if np.broadcast(a, x).ndim == 0:
8475
return _gammaincc(a, x)

0 commit comments

Comments
 (0)