Note
This documentation is for a development version of IPython. There may be significant differences from the latest stable release (1.2.1).
Utilities for getting information about IPython and the system it’s running in.
Get short form of commit hash given directory pkg_path
We get the commit hash from (in order of preference):
If these fail, we return a not-found placeholder tuple
Parameters: | pkg_path : str
|
---|---|
Returns: | hash_from : str
hash_str : str
|
Return dict describing the context of this package
Parameters: | pkg_path : str
|
---|---|
Returns: | context : dict
|
Return useful information about IPython and the system, as a dict.
Return useful information about IPython and the system, as a string.
Examples
In [2]: print sys_info()
{'commit_hash': '144fdae', # random
'commit_source': 'repository',
'ipython_path': '/home/fperez/usr/lib/python2.6/site-packages/IPython',
'ipython_version': '0.11.dev',
'os_name': 'posix',
'platform': 'Linux-2.6.35-22-generic-i686-with-Ubuntu-10.10-maverick',
'sys_executable': '/usr/bin/python',
'sys_platform': 'linux2',
'sys_version': '2.6.6 (r266:84292, Sep 15 2010, 15:52:39) \n[GCC 4.4.5]'}
Return the effective number of CPUs in the system as an integer.
This cross-platform function makes an attempt at finding the total number of available CPUs in the system, as returned by various underlying system and python calls.
If it can’t find a sensible answer, it returns 1 (though an error may make it return a large positive number that’s actually incorrect).