Changeset 1858


Ignore:
Timestamp:
08/05/10 11:46:40 (14 years ago)
Author:
Malte Marquarding
Message:

Adde more API documentation

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/source/api.rst

    r1852 r1858  
    22API documentation
    33=================
    4 
    5 Module :mod:`asap.logging`
    6 ==========================
    7 
    8 .. automodule:: asap.logging
    9    :members:
    10    :undoc-members:
    11 
    124
    135Module :mod:`asap.scantable`
     
    1810..   :undoc-members:
    1911..   :inherited-members:
     12
     13Module :mod:`asap.env`
     14======================
     15
     16.. automodule:: asap.env
     17   :members:
     18..   :undoc-members:
     19
     20Module :mod:`asap.parameters`
     21=============================
     22
     23.. automodule:: asap.parameters
     24   :members:
     25   :undoc-members:
     26
     27Module :mod:`asap.logging`
     28==========================
     29
     30.. automodule:: asap.logging
     31   :members:
     32..   :undoc-members:
     33
  • trunk/doc/source/conf.py

    r1852 r1858  
    209209autoclass_content = "both"
    210210
     211todo_include_todos = True
     212
    211213# -- Options for manual page output --------------------------------------------
    212214
  • trunk/doc/source/developer/index.rst

    r1852 r1858  
    77
    88   scantable
     9   todo
  • trunk/doc/source/developer/scantable.rst

    r1854 r1858  
    237237* **FORMATTEDNAME** - *String()*
    238238
     239.. todo:: add all sub-table descriptions
    239240
    240241========================
  • trunk/python/asapplotter.py

    r1824 r1858  
    1414    By default the plotter is set up to plot polarisations
    1515    'colour stacked' and scantables across panels.
    16     Note:
     16
     17    .. note::
     18
    1719        Currenly it only plots 'spectra' not Tsys or
    1820        other variables.
     21
    1922    """
    2023    def __init__(self, visible=None , **kwargs):
     
    113116        self._plotter.tidy()
    114117        self._plotter.show(hardrefresh=False)
    115         print_log()
    116118        return
    117119
     
    352354
    353355    def set_panelling(self, what=None):
     356        """Set the 'panelling' mode i.e. which type of spectra should be
     357        spread across different panels.
     358        """
     359
    354360        mode = what
    355361        if mode is None:
     
    382388
    383389    def set_stacking(self, what=None):
     390        """Set the 'stacking' mode i.e. which type of spectra should be
     391        overlayed.
     392        """
    384393        mode = what
    385394        if mode is None:
  • trunk/python/env.py

    r1848 r1858  
     1"""This module has various functions for environment specific setings.
     2"""
    13__all__ = ["is_casapy", "is_ipython", "setup_env", "get_revision"]
    24
     
    79
    810def is_casapy():
     11    """Are we running inside casapy?"""
    912    try:
    1013        from taskinit import casalog
     
    1417
    1518def is_ipython():
     19    """Are we running inside IPython?"""
    1620    return 'IPython' in sys.modules.keys()
    1721
    1822def setup_env():
     23    """Set-up environment variables for casa and initialise ~/.asap on first
     24    use.
     25    """
    1926    # Set up CASAPATH and first time use of asap i.e. ~/.asap/*
    2027    plf = None
     
    5966
    6067def get_revision():
     68    """Get the revision of the software. Only useful within casapy."""
    6169    if not is_casapy:
    6270        return ' unknown '
  • trunk/python/logging.py

    r1833 r1858  
    1 __all__ = ["asaplog", "print_log", "print_log_dec"]
     1"""This module presents a logging abstraction layer on top of casa.
     2"""
     3__all__ = ["asaplog", "print_log", "print_log_dec", "AsapLogger"]
    24
    35from asap.env import is_casapy
     
    1012
    1113
    12 class _asaplog(object):
    13     """Wrapper object to allow for both casapy and asap logging"""
     14class AsapLogger(object):
     15    """Wrapper object to allow for both casapy and asap logging.
     16
     17    Inside casapy this will connect to `taskinit.casalog`. Otherwise it will
     18    create its own casa log sink.
     19
     20    .. note:: Do instantiate a new one - use the :obj:`asaplog` instead.
     21   
     22    """
    1423    def __init__(self):
    1524        self._enabled = False
     
    2534        """Post the messages to the logger. This will clear the buffered
    2635        logs.
     36
     37        Parameters:
     38
     39            level:  The log level (severity). One of INFO, WARN, ERROR.
     40
    2741        """
    2842        if not self._enabled:
     
    4155
    4256    def push(self, msg, newline=True):
    43         """Push logs into the buffer. post needs to be called to send them."""
     57        """Push logs into the buffer. post needs to be called to send them.
     58
     59        Parameters:
     60
     61            msg:        the log message (string)
     62
     63            newline:    should we terminate with a newline (default yes)
     64
     65        """
    4466        from asap import rcParams
    4567        if self._enabled:
     
    5880        self._enabled = flag
    5981
    60 asaplog = _asaplog()
     82asaplog = AsapLogger()
     83"""Default asap logger"""
    6184
    6285def print_log_dec(f, level='INFO'):
     86    """Decorator which posts log at completion of the wrapped method.
     87    Example::
     88
     89        @print_log_dec
     90        def test(self):
     91            do_stuff()
     92            asaplog.push('testing...', False)
     93            do_more_stuff()
     94            asaplog.push('finished')
     95    """
    6396    @wraps_dec(f)
    6497    def wrap_it(*args, **kw):
     
    69102
    70103def print_log(level='INFO'):
    71     """Alias for asaplog.post."""
     104    """Alias for asaplog.post(level)"""
    72105    asaplog.post(level)
  • trunk/python/parameters.py

    r1834 r1858  
     1"""This module provides functions to set up resource parameters (rc).
     2These can be set in a file .asaprc or using functions.
     3"""
    14__all__ = ["rc", "list_rcparameters", "rcParams", "rcParamsDefault"]
    25
Note: See TracChangeset for help on using the changeset viewer.