ChiantiPy package

Submodules

ChiantiPy.conftest module

ChiantiPy.static_version module

the current version of the ChiantiPy package

ChiantiPy.version module

ChiantiPy.version.get_git_devstr(sha=False, show_warning=True, path=None)[source] [edit on github]

Determines the number of revisions in this repository.

Parameters:

sha : bool

If True, the full SHA1 hash will be returned. Otherwise, the total count of commits in the repository will be used as a “revision number”.

show_warning : bool

If True, issue a warning if git returns an error code, otherwise errors pass silently.

path : str or None

If a string, specifies the directory to look in to find the git repository. If None, the current working directory is used, and must be the root of the git repository. If given a filename it uses the directory containing that file.

Returns:

devversion : str

Either a string with the revision number (if sha is False), the SHA1 hash of the current commit (if sha is True), or an empty string if git version info could not be identified.

ChiantiPy.version.update_git_devstr(version, path=None)[source] [edit on github]

Updates the git revision string if and only if the path is being imported directly from a git working copy. This ensures that the revision number in the version string is accurate.

ChiantiPy.version_gh module

ChiantiPy.version_gh.get_git_devstr(sha=False, show_warning=True, path=None)[source] [edit on github]

Determines the number of revisions in this repository.

Parameters:

sha : bool

If True, the full SHA1 hash will be returned. Otherwise, the total count of commits in the repository will be used as a “revision number”.

show_warning : bool

If True, issue a warning if git returns an error code, otherwise errors pass silently.

path : str or None

If a string, specifies the directory to look in to find the git repository. If None, the current working directory is used, and must be the root of the git repository. If given a filename it uses the directory containing that file.

Returns:

devversion : str

Either a string with the revision number (if sha is False), the SHA1 hash of the current commit (if sha is True), or an empty string if git version info could not be identified.

ChiantiPy.version_gh.update_git_devstr(version, path=None)[source] [edit on github]

Updates the git revision string if and only if the path is being imported directly from a git working copy. This ensures that the revision number in the version string is accurate.

Module contents

ChiantiPy - CHIANTI Python package Calculates various aspects of emission lines and continua from the CHIANTI atomic database for astrophysical spectroscopy.

ChiantiPy.test(**kwargs)[source] [edit on github]

Run the tests for the package.

Parameters:

package : str, optional

The name of a specific package to test, e.g. ‘io.fits’ or ‘utils’. If nothing is specified all default Astropy tests are run.

args : str, optional

Additional arguments to be passed to pytest.main in the args keyword argument.

docs_path : str, optional

The path to the documentation .rst files.

open_files : bool, optional

Fail when any tests leave files open. Off by default, because this adds extra run time to the test suite. Requires the psutil package.

parallel : int, optional

When provided, run the tests in parallel on the specified number of CPUs. If parallel is negative, it will use the all the cores on the machine. Requires the pytest-xdist plugin.

pastebin : (‘failed’, ‘all’, None), optional

Convenience option for turning on py.test pastebin output. Set to ‘failed’ to upload info for failed tests, or ‘all’ to upload info for all tests.

pdb : bool, optional

Turn on PDB post-mortem analysis for failing tests. Same as specifying --pdb in args.

pep8 : bool, optional

Turn on PEP8 checking via the pytest-pep8 plugin and disable normal tests. Same as specifying --pep8 -k pep8 in args.

plugins : list, optional

Plugins to be passed to pytest.main in the plugins keyword argument.

remote_data : {‘none’, ‘astropy’, ‘any’}, optional

Controls whether to run tests marked with @remote_data. This can be set to run no tests with remote data (none), only ones that use data from http://data.astropy.org (astropy), or all tests that use remote data (any). The default is none.

repeat : int, optional

If set, specifies how many times each test should be run. This is useful for diagnosing sporadic failures.

skip_docs : bool, optional

When True, skips running the doctests in the .rst files.

test_path : str, optional

Specify location to test by path. May be a single file or directory. Must be specified absolutely or relative to the calling directory.

verbose : bool, optional

Convenience option to turn on verbose output from py.test. Passing True is the same as specifying -v in args.

See also

pytest.main
This method builds arguments for and then calls this function.