Exemplo n.º 1
0
 def test_existing_workflows(self):
     """Test listing all preinstalled workflows"""
     from aiida.orm import Workflow
     work = pl.existing_plugins(Workflow, 'aiida.workflows')
     self.assertIsInstance(work, list)
     from aiida.orm import WorkflowFactory
     for i in work:
         self.assertTrue(issubclass(WorkflowFactory(i), Workflow))
Exemplo n.º 2
0
 def test_existing_data(self):
     """Test listing all preinstalled data formats"""
     from aiida.orm.data import Data
     data = pl.existing_plugins(Data, 'aiida.orm.data')
     self.assertIsInstance(data, list)
     from aiida.orm import DataFactory
     for i in data:
         self.assertTrue(issubclass(DataFactory(i), Data))
Exemplo n.º 3
0
 def test_existing_parsers(self):
     """Test listing all preinstalled parsers"""
     from aiida.parsers import Parser
     pars = pl.existing_plugins(Parser, 'aiida.parsers.plugins')
     self.assertIsInstance(pars, list)
     from aiida.parsers import ParserFactory
     for i in pars:
         self.assertTrue(issubclass(ParserFactory(i), Parser))
Exemplo n.º 4
0
 def test_existing_calculations(self):
     """Test listing all preinstalled calculations """
     from aiida.orm.calculation.job import JobCalculation
     calcs = pl.existing_plugins(JobCalculation,
                                 'aiida.orm.calculation.job',
                                 suffix='Calculation')
     self.assertIsInstance(calcs, list)
     from aiida.orm import CalculationFactory
     for i in calcs:
         self.assertTrue(issubclass(CalculationFactory(i), JobCalculation))
Exemplo n.º 5
0
def all_plugins(category):
    """
    find old and new plugins

    If both are available for a given name, the old style plugin takes precedence.
    """
    from aiida.common.old_pluginloader import existing_plugins
    from aiida.orm.calculation.job import JobCalculation
    from aiida.parsers import Parser
    supercls = _supercls_for_category(category)
    internal = _category_mapping.get(category)
    suffix = _category_suffix_map.get(category)
    plugins = existing_plugins(supercls, internal, suffix=suffix)
    plugins += [i for i in plugin_list(category) if i not in plugins]
    return [unicode(_) for _ in set(plugins)]
Exemplo n.º 6
0
 def test_existing_tcod_plugins(self):
     """Test listing all preinstalled tcod exporter plugins"""
     from aiida.tools.dbexporters.tcod_plugins import BaseTcodtranslator
     tcpl = pl.existing_plugins(BaseTcodtranslator,
                                'aiida.tools.dbexporters.tcod_plugins')
     self.assertIsInstance(tcpl, list)
Exemplo n.º 7
0
 def test_existing_transports(self):
     """Test listing all preinstalled transports"""
     from aiida.transport import Transport
     tran = pl.existing_plugins(Transport, 'aiida.transport.plugins')
     self.assertIsInstance(tran, list)
Exemplo n.º 8
0
 def test_existing_schedulers(self):
     """Test listing all preinstalled schedulers"""
     from aiida.scheduler import Scheduler
     sche = pl.existing_plugins(Scheduler, 'aiida.scheduler.plugins')
     self.assertIsInstance(sche, list)