Пример #1
0
# -*- coding: utf-8 -*-
"""Generate the attributes.rst and attributes_dev.rst files from the
ccData docstring that describes attributes."""

from __future__ import print_function

from docs_common import check_cclib

import cclib
check_cclib(cclib)


def generate_attributes():
    """Generate a string containing a reStructuredText table
    representation of the ccData docstring, which contains a list of
    all supported attributes with
    1. the name of each attribute,
    2. the text definition of each attribute,
    3. the attribute's container data type, shape (if relevant), and
    4. the physical units for each attribute.
    """
    lines = []

    # Need to parse the ccData docstring, since only that currently
    # contains all the information needed for this table.
    data_doc = cclib.parser.data.ccData.__doc__
    attributes = [
        line for line in data_doc.split('\n') if line[:8].strip() == ''
    ]
    attributes = [line for line in attributes if "--" in line]
Пример #2
0
# -*- coding: utf-8 -*-

"""Generate the attributes.rst and attributes_dev.rst files from the
ccData docstring that describes attributes."""

from __future__ import print_function

from docs_common import check_cclib

import cclib
check_cclib(cclib)


def generate_attributes():
    """Generate a string containing a reStructuredText table
    representation of the ccData docstring, which contains a list of
    all supported attributes with
    1. the name of each attribute,
    2. the text definition of each attribute,
    3. the attribute's container data type, shape (if relevant), and
    4. the physical units for each attribute.
    """
    lines = []

    # Need to parse the ccData docstring, since only that currently
    # contains all the information needed for this table.
    data_doc = cclib.parser.data.ccData.__doc__
    attributes = [line for line in data_doc.split('\n') if line[:8].strip() == '']
    attributes = [line for line in attributes if "--" in line]

    # These are the widths of the columns in the table