Exemplo n.º 1
0
    def test_basics(self):
        config_reader.init('local.ini')
        self.assertEqual(config_reader.STRING, 'string')
        self.assertEqual(config_reader.ARRAY, ['one', 'two', 'three'])
        self.assertEqual(config_reader.OVERRIDEN, 'local')
        self.assertEqual(config_reader.string, 'global/local')

        config_reader.init('local2.ini')
        self.assertEqual(config_reader.STRING, 'string')
        self.assertEqual(config_reader.ARRAY, ['one', 'two', 'three'])
        self.assertEqual(config_reader.OVERRIDEN, 'global')
        self.assertEqual(config_reader.string, 'second')
Exemplo n.º 2
0
    def test_basics(self):
        config_reader.init("local.ini")
        self.assertEqual(config_reader.STRING, "string")
        self.assertEqual(config_reader.ARRAY, ["one", "two", "three"])
        self.assertEqual(config_reader.OVERRIDEN, "local")
        self.assertEqual(config_reader.string, "global/local")

        config_reader.init("local2.ini")
        self.assertEqual(config_reader.STRING, "string")
        self.assertEqual(config_reader.ARRAY, ["one", "two", "three"])
        self.assertEqual(config_reader.OVERRIDEN, "global")
        self.assertEqual(config_reader.string, "second")
Exemplo n.º 3
0
    def test_basics(self):
        config_reader.init(os.path.join(os.path.dirname(__file__),
                                        'local.ini'))
        self.assertEqual(config_reader.STRING, 'string')
        self.assertEqual(config_reader.ARRAY, ['one', 'two', 'three'])
        self.assertEqual(config_reader.OVERRIDEN, 'local')
        self.assertEqual(config_reader.string, 'global/local')

        config_reader.init(
            os.path.join(os.path.dirname(__file__), 'local2.ini'))
        self.assertEqual(config_reader.STRING, 'string')
        self.assertEqual(config_reader.ARRAY, ['one', 'two', 'three'])
        self.assertEqual(config_reader.OVERRIDEN, 'global')
        self.assertEqual(config_reader.string, 'second')
Exemplo n.º 4
0
    def test_basics(self):
        config_reader.init(os.path.join(os.path.dirname(__file__),
                                        'local.ini'))
        assert config_reader.STRING == 'string'
        assert config_reader.ARRAY == ['one', 'two', 'three']
        assert config_reader.OVERRIDEN == 'local'
        assert config_reader.string == 'global/local'

        config_reader.init(os.path.join(os.path.dirname(__file__),
                                        'local2.ini'))
        assert config_reader.STRING == 'string'
        assert config_reader.ARRAY == ['one', 'two', 'three']
        assert config_reader.OVERRIDEN == 'global'
        assert config_reader.string == 'second'
Exemplo n.º 5
0
    def test_basics(self):
        config_reader.init(os.path.join(os.path.dirname(__file__),
                                        'local.ini'))
        self.assertEqual(config_reader.STRING, 'string')
        self.assertEqual(config_reader.ARRAY, ['one', 'two', 'three'])
        self.assertEqual(config_reader.OVERRIDEN, 'local')
        self.assertEqual(config_reader.string, 'global/local')

        config_reader.init(os.path.join(os.path.dirname(__file__),
                                        'local2.ini'))
        self.assertEqual(config_reader.STRING, 'string')
        self.assertEqual(config_reader.ARRAY, ['one', 'two', 'three'])
        self.assertEqual(config_reader.OVERRIDEN, 'global')
        self.assertEqual(config_reader.string, 'second')
Exemplo n.º 6
0
'''
Created on Aug 17, 2011

@author: rca

This workflow works on the record, it should get the fulltext of the
marc record, transform it into vectors, and classify using SVM. Result
is stored inside the obj instance
'''

from workflow.patterns import IF_NOT, ENG_GET
from workflow.config import config_reader as cfg
from components.records import svm_classifier

cfg.init('DESY')

workflow = [
            IF_NOT(ENG_GET('#svm_fmap'), [
                       svm_classifier.init(cfg.svm_model, cfg.svm_train, cfg.svm_predict,
                                           train_dir=cfg.train_dir, test_dir=cfg.test_dir,
                                           output_dir=cfg.basedir),
                       svm_classifier.build_feature_map_from_dir
                   ]),
            svm_classifier.classify_record,
            ]
Exemplo n.º 7
0
Created on Aug 18, 2011

@author: rca

Example workflow which is not working (yet).

Normally, it is executed as: run_workflow.py workflows/DESY
'''


from workflow.patterns import IF_NOT, ENG_GET, WHILE
from workflow.config import config_reader as cfg
from components.records import svm_classifier
from workflows.collections import create_records
from workflows.records import svm_classification
cfg.init('DESY.ini')

workflow = [
            svm_classifier.init_params(),
            WHILE(get_input_sources, [
                    create_records.workflow,
                    WHILE(get_records, [

                          svm_classification.workflow,
                          bibclassify_classification.workflow,

                          decision_before_inspire.workflow,

                          IF(check_passed,
                             create_marcxml,
                             upload_marcxml,)