to support installations that don't need parallelisation, only a warning is issued if pypvm is missing and the public classes are exported as Pseudo-classes. Pseudo classes are empty and raise an ImportError when you try to initialize them. See also L{Biskit.tools.tryImport}. """ ## import user ## ensure that ~/.pythonrc.py is executed ## ## error-tolerant export of public classes ## from Biskit import EHandler import Biskit.tools as T pvm_installed = True pvm_installed = T.tryImport('TrackingJobMaster', 'TrackingJobMaster', namespace=globals()) pvm_installed = T.tryImport('dispatcher', 'JobSlave', namespace=globals()) and pvm_installed ##if not pvm_installed: ## EHandler.warning('Could not import PVM (Parallel Virtual Machine) modules.'+ ## ' Please check that PVM and pypvm are installed!\n'+ ## '\tParallelisation is not available.') ## ## clean up ## del EHandler, T
The compilation of PVM/pypvm can be tricky on some architectures. In order to support installations that don't need parallelisation, only a warning is issued if pypvm is missing and the public classes are exported as Pseudo-classes. Pseudo classes are empty and raise an ImportError when you try to initialize them. See also L{Biskit.tools.tryImport}. """ ## import user ## ensure that ~/.pythonrc.py is executed ## ## error-tolerant export of public classes ## from Biskit import EHandler import Biskit.tools as T pvm_installed = True pvm_installed = T.tryImport( 'TrackingJobMaster', 'TrackingJobMaster', namespace=globals()) pvm_installed = T.tryImport( 'dispatcher', 'JobSlave', namespace=globals() ) and pvm_installed if not pvm_installed: EHandler.warning('Could not import PVM (Parallel Virtual Machine) modules.'+ ' Please check that PVM and pypvm are installed!\n'+ '\tParallelisation is not available.') ## ## clean up ## del EHandler, T
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You find a copy of the GNU General Public License in the file ## license.txt along with this program; if not, write to the Free ## Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. """ Plot a 2D matrix (up to 100 x 100) """ import Biskit.oldnumeric as N0 from Biskit import ColorSpectrum, EHandler import Biskit.tools as T T.tryImport('biggles', 'FramedPlot', namespace=globals()) try: import biggles except: biggles = False class Legend(FramedPlot): """ Class to create a legend to use with a Matrix plot. """ def __init__(self, values): """ @param values: color mapping for each color used @type values: [(float, int)] """