Skip to content
Snippets Groups Projects
Commit ecb0cc04 authored by Stefano Borini's avatar Stefano Borini
Browse files

Merge branch 'master' into remove-application-and-model-from-bundles

parents fe36794d 20df2596
No related branches found
No related tags found
1 merge request!55Remove application and model from bundles. Added plugin reference.
......@@ -51,38 +51,38 @@ clean:
rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
$(SPHINXBUILD) -W -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
$(SPHINXBUILD) -W -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
$(SPHINXBUILD) -W -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
$(SPHINXBUILD) -W -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
$(SPHINXBUILD) -W -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
$(SPHINXBUILD) -W -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
$(SPHINXBUILD) -W -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
......@@ -91,7 +91,7 @@ qthelp:
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/SimPhoNy.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
$(SPHINXBUILD) -W -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
......@@ -100,80 +100,80 @@ devhelp:
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
$(SPHINXBUILD) -W -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
$(SPHINXBUILD) -W -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
$(SPHINXBUILD) -W -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
$(SPHINXBUILD) -W -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
$(SPHINXBUILD) -W -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
$(SPHINXBUILD) -W -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
$(SPHINXBUILD) -W -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
$(SPHINXBUILD) -W -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
$(SPHINXBUILD) -W -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
$(SPHINXBUILD) -W -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
$(SPHINXBUILD) -W -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
$(SPHINXBUILD) -W -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
$(SPHINXBUILD) -W -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
$(SPHINXBUILD) -W -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
......
......@@ -35,10 +35,10 @@ force\_bdss\.tests\.test\_core\_evaluation\_driver module
:undoc-members:
:show-inheritance:
force\_bdss\.tests\.test\_id\_generators module
-----------------------------------------------
force\_bdss\.tests\.test\_ids module
------------------------------------
.. automodule:: force_bdss.tests.test_id_generators
.. automodule:: force_bdss.tests.test_ids
:members:
:undoc-members:
:show-inheritance:
......
from .base_extension_plugin import BaseExtensionPlugin # noqa
from .ids import bundle_id # noqa
from .ids import bundle_id, plugin_id # noqa
from .data_sources.base_data_source_model import BaseDataSourceModel # noqa
from .data_sources.data_source_result import DataSourceResult # noqa
......
......@@ -3,17 +3,21 @@ from __future__ import print_function
import sys
from traits.api import on_trait_change
from .ids import plugin_id
from .base_core_driver import BaseCoreDriver
from .io.workflow_reader import (
InvalidVersionException,
InvalidFileException
)
CORE_EVALUATION_DRIVER_ID = plugin_id("core", "CoreEvaluationDriver")
class CoreEvaluationDriver(BaseCoreDriver):
"""Main plugin that handles the execution of the MCO
or the evaluation.
"""
id = CORE_EVALUATION_DRIVER_ID
@on_trait_change("application:started")
def application_started(self):
......
......@@ -4,17 +4,21 @@ import sys
from traits.api import on_trait_change
from .ids import plugin_id
from .base_core_driver import BaseCoreDriver
from .io.workflow_reader import (
InvalidVersionException,
InvalidFileException
)
CORE_MCO_DRIVER_ID = plugin_id("core", "CoreMCODriver")
class CoreMCODriver(BaseCoreDriver):
"""Main plugin that handles the execution of the MCO
or the evaluation.
"""
id = CORE_MCO_DRIVER_ID
@on_trait_change("application:started")
def application_started(self):
......
from force_bdss.api import BaseExtensionPlugin
from force_bdss.api import BaseExtensionPlugin, plugin_id
from .csv_extractor.csv_extractor_bundle import CSVExtractorBundle
from .kpi_adder.kpi_adder_bundle import KPIAdderBundle
from .dummy_dakota.dakota_bundle import DummyDakotaBundle
......@@ -9,6 +9,8 @@ from .dummy_kpi_calculator.dummy_kpi_calculator_bundle import (
class DummyPlugin(BaseExtensionPlugin):
id = plugin_id("enthought", "DummyPlugin")
def _data_source_bundles_default(self):
return [DummyDataSourceBundle(self),
CSVExtractorBundle(self)]
......
......@@ -33,9 +33,18 @@ def bundle_id(producer, identifier):
def mco_parameter_id(producer, identifier):
"""Creates an ID for an MCO parameter, so that it can be identified
uniquely."""
return _string_id("mco_parameter", producer, identifier)
def plugin_id(producer, identifier):
"""Creates an ID for the plugins. These must be defined, otherwise
the envisage system will complain (but not break)
"""
return _string_id("plugin", producer, identifier)
def _string_id(entity_namespace, producer, identifier):
"""Creates an id for a generic entity.
......
import unittest
from force_bdss.ids import bundle_id
from force_bdss.ids import bundle_id, plugin_id
class TestIdGenerators(unittest.TestCase):
......@@ -13,3 +13,12 @@ class TestIdGenerators(unittest.TestCase):
bundle_id(bad_entry, "bar")
with self.assertRaises(ValueError):
bundle_id("foo", bad_entry)
def test_plugin_id(self):
self.assertEqual(plugin_id("foo", "bar"), "force.bdss.plugin.foo.bar")
for bad_entry in ["", None, " ", "foo bar"]:
with self.assertRaises(ValueError):
plugin_id(bad_entry, "bar")
with self.assertRaises(ValueError):
plugin_id("foo", bad_entry)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment