Skip to content

Commit

Permalink
updated docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfried (Mac) committed Dec 19, 2023
1 parent 434ad3e commit b38fbbc
Show file tree
Hide file tree
Showing 4 changed files with 165 additions and 104 deletions.
24 changes: 12 additions & 12 deletions misc/cigaleModules.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,8 +793,8 @@ class SSPmodule(ABC):
**Keyword arguments**
:param imf: initial mass function. Options are given in :class:`~SED.misc.enum.IMF`.
:type imf: :python:`list[SED.misc.enum.IMF]`
:param imf: initial mass function. Options are given in :class:`~pixSED.misc.enum.IMF`.
:type imf: :python:`list[pixSED.misc.enum.IMF]`
:param separation_age: age in :math:`\rm Myr` of the separation between the young and the old star populations. Set to 0 to not differentiate ages (only an old population).
:type separation_age: :python:`list[int]`
'''
Expand Down Expand Up @@ -840,8 +840,8 @@ class BC03module(SSPmodule):
**Keyword arguments**
:param imf: initial mass function. Options are :attr:`~SED.misc.enum.IMF.CHABRIER` or :attr:`~SED.misc.enum.IMF.SALPETER`.
:type imf: :python:`list[SED.misc.enum.IMF]`
:param imf: initial mass function. Options are :attr:`~pixSED.misc.enum.IMF.CHABRIER` or :attr:`~pixSED.misc.enum.IMF.SALPETER`.
:type imf: :python:`list[pixSED.misc.enum.IMF]`
:param separation_age: age in :math:`\rm Myr` of the separation between the young and the old star populations. Set to 0 to not differentiate ages (only an old population).
:type separation_age: :python:`list[int]`
:param list metallicity: possible values are 0.0001, 0.0004, 0.004, 0.008, 0.02, 0.05
Expand Down Expand Up @@ -909,12 +909,12 @@ class M2005module(SSPmodule):
.. warning:
This module cannot be combined with :class:`~SED.misc.cigaleModules.NEBULARmodule`.
This module cannot be combined with :class:`~pixSED.misc.cigaleModules.NEBULARmodule`.
**Keyword arguments**
:param imf: initial mass function. Options are :attr:`~SED.misc.enum.IMF.SALPETER` or :attr:`~SED.misc.enum.IMF.KROUPA`.
:type imf: :python:`list[SED.misc.enum.IMF]`
:param imf: initial mass function. Options are :attr:`~pixSED.misc.enum.IMF.SALPETER` or :attr:`~pixSED.misc.enum.IMF.KROUPA`.
:type imf: :python:`list[pixSED.misc.enum.IMF]`
:param separation_age: age in in :math:`\rm Myr` of the separation between the young and old stellar populations. Set to 0 not to differentiate ages (only an old population).
:type separation_age: :python:`list[int]`
:param metallicity: possible values are 0.001, 0.01, 0.02, 0.04
Expand Down Expand Up @@ -985,7 +985,7 @@ class NEBULARmodule:
.. warning:
This module cannot be combined with :class:`~SED.misc.cigaleModules.M2005module`.
This module cannot be combined with :class:`~pixSED.misc.cigaleModules.M2005module`.
**Keyword arguments**
Expand Down Expand Up @@ -1290,7 +1290,7 @@ def spec(self, *args, **kwargs) -> str:

return text

class DUSTATT_CALZLEITmodule(ATTENUATIONmodule):
class DUSTATT_CALZLETTImodule(ATTENUATIONmodule):
r'''
.. codeauthor:: Wilfried Mercier - IRAP/LAM <[email protected]>
Expand Down Expand Up @@ -1772,7 +1772,7 @@ class CASEYmodule(DUSTmodule):
r'''
.. codeauthor:: Wilfried Mercier - IRAP/LAM <[email protected]>
Class implementing Casey 2012 dust emission module.
Class implementing Casey et al. (2012) dust emission module.
**Keyword arguments**
Expand Down Expand Up @@ -1838,7 +1838,7 @@ class DALEmodule(DUSTmodule):
r'''
.. codeauthor:: Wilfried Mercier - IRAP/LAM <[email protected]>
Class implementing Dale et al. 2014 dust emission module.
Class implementing Dale et al. (2014) dust emission module.
.. important::
Expand Down Expand Up @@ -1920,7 +1920,7 @@ class DL07module(DUSTmodule):
r'''
.. codeauthor:: Wilfried Mercier - IRAP/LAM <[email protected]>
Class implementing Draine & Li 2007 dust emission module.
Class implementing Draine & Li (2007) dust emission module.
**Keyword arguments**
Expand Down
4 changes: 2 additions & 2 deletions misc/enum.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
r"""
.. codeauthor:: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
.. codeauthor:: Wilfried Mercier - IRAP <wilfried.mercier@lam.fr>
Enumerations used in other parts of the code.
"""
Expand Down Expand Up @@ -713,7 +713,7 @@ class LePhareOutputParam(Enum):

def __str__(self, *args, **kwargs) -> str:
r'''
.. codeauthor:: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
.. codeauthor:: Wilfried Mercier - IRAP/LAM <wilfried.mercier@lam.fr>
Formatted string for this enum.
'''
Expand Down
28 changes: 18 additions & 10 deletions misc/misc.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
r"""
.. codeauthor:: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
.. codeauthor:: Wilfried Mercier - IRAP/LAM <wilfried.mercier@lam.fr>
Miscellaneous, quite general objects used by the SED fitting classes.
"""
Expand All @@ -17,7 +17,7 @@

class ShapeError(Exception):
r'''
.. codeauthor:: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
.. codeauthor:: Wilfried Mercier - IRAP/LAM <wilfried.mercier@lam.fr>
Error which is caught when two arrays do not share the same shape.
Expand Down Expand Up @@ -45,7 +45,7 @@ def __init__(self, arr1: ndarray, arr2: ndarray, msg: str = '', **kwargs) -> Non

def check_type(dtype):
r'''
.. codeauthor:: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
.. codeauthor:: Wilfried Mercier - IRAP/LAM <wilfried.mercier@lam.fr>
A decorator which check data type of the first mandatory parameter of the function.
Expand Down Expand Up @@ -74,7 +74,7 @@ def wrap(*args, **kwargs):

def check_type_in_list(dtype):
r'''
.. codeauthor:: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
.. codeauthor:: Wilfried Mercier - IRAP/LAM <wilfried.mercier@lam.fr>
A decorator which check data type of the first mandatory parameter of the function.
Expand Down Expand Up @@ -108,18 +108,22 @@ def wrap(*args, **kwargs):

class NamedColumn:
r'''
.. codeauthor:: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
.. codeauthor:: Wilfried Mercier - IRAP/LAM <wilfried.mercier@lam.fr>
A general named column to assicate to an Enum object.
**Arguments**
:param name: name of the column when included in a Table
:type name: :python:`str`
:param unit: unit of the column
:type unit: :python:`str`
:param end: (**Optional**) end string to append to the associate enum name
**Keyword arguments**
:param end: end string to append to the associate enum name
:type end: :python:`str`
:param log: (**Optional**) whether this column holds log values. This will trigger a conversion to the power of 10 if True.
:param log: whether this column holds log values. This will trigger a conversion to the power of 10 if :python:`True`.
:type log: :python:`bool`
:raises TypeError: if **name**, **unit** and **end** are not of type :python:`str`
Expand All @@ -139,12 +143,16 @@ def __init__(self, name: str, unit: str, end: str = '', log=False) -> None:

class PhysicalLogQuantity:
r'''
.. codeauthor:: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
.. codeauthor:: Wilfried Mercier - IRAP/LAM <wilfried.mercier@lam.fr>
Implement an Astropy Quantity which can have log of physical values.
**Arguments**
:param value: value to pass to the constructor
**Keyword arguments**
:param unit: data unit
:type unit: :python:`str`
'''
Expand All @@ -170,7 +178,7 @@ def __init__(self, value: Any, *args, unit: str = '', **kwargs) -> None:

def __str__(self, *args, **kwargs) -> str:
r'''
.. codeauthor:: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
.. codeauthor:: Wilfried Mercier - IRAP/LAM <wilfried.mercier@lam.fr>
Slightly modified string representation.
'''
Expand All @@ -179,7 +187,7 @@ def __str__(self, *args, **kwargs) -> str:

def toPhysical(self, *args, **kwargs) -> Quantity:
r'''
.. codeauthor:: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
.. codeauthor:: Wilfried Mercier - IRAP/LAM <wilfried.mercier@lam.fr>
Go to physical unit by raising to the power of 10 and converting to the right unit.
'''
Expand Down
Loading

0 comments on commit b38fbbc

Please sign in to comment.