Ejemplo n.º 1
0
 def _sis_hash(self):
     h = {
         "returnn_config": self.config,
         "python_epilog_hash": self.python_epilog_hash,
         "python_prolog_hash": self.python_prolog_hash,
         "returnn_networks": self.staged_network_dict,
     }
     return sis_hash_helper(h)
Ejemplo n.º 2
0
import unittest
import os
import sys
import hashlib

from sisyphus.job_path import Path
from sisyphus.tools import execute_in_dir
from sisyphus.hash import sis_hash_helper

# Use old hash function to avoid updating precomputed hashes
import sisyphus.global_settings as gs
gs.SIS_HASH = lambda x: hashlib.md5(sis_hash_helper(x)).hexdigest()

TEST_DIR = 'test'
sys.path.append(TEST_DIR)

# TODO replace fixed job hashes and compare if things changed


class JobTest(unittest.TestCase):
    def test_connect_path(self):
        from recipe.task.test import Test

        job = Test(text="input_text.gz")

        self.assertEqual(job.text, "input_text.gz")
        self.assertEqual(
            str(job.out),
            os.path.abspath(
                "work/task/test/Test.f744898e46ca9452ff1889edc988d045/output/out_text.gz"
            ))
Ejemplo n.º 3
0
 def _sis_hash(self):
     return sis_hash_helper(self.a)