How to use the sciunit.utils.config_get function in sciunit

To help you get started, we’ve selected a few sciunit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github scidash / sciunit / sciunit / unit_test / config_tests.py View on Github external
def test_json_config(self):
        from sciunit.utils import config_get

        config_path = os.path.join(sciunit.__path__[0], "config.json")
        print(config_path)
        self.assertTrue(os.path.isfile(config_path))
        cmap_low = config_get("cmap_low")
        self.assertTrue(isinstance(cmap_low, int))
        dummy = config_get("dummy", 37)
        self.assertEqual(dummy, 37)
        try:
            config_get("dummy")
        except sciunit.Error as e:
            self.assertTrue("does not contain key" in str(e))
github scidash / sciunit / sciunit / unit_test / core_tests.py View on Github external
def test_json_config(self):
        from sciunit.utils import config_get
        config_path = os.path.join(sciunit.__path__[0],'config.json')
        print(config_path)
        self.assertTrue(os.path.isfile(config_path))
        cmap_low = config_get('cmap_low')
        self.assertTrue(isinstance(cmap_low,int))
        dummy = config_get('dummy',37)
        self.assertEqual(dummy,37)
        try:
            config_get('dummy')
        except sciunit.Error as e:
            self.assertTrue('does not contain key' in str(e))
github scidash / sciunit / sciunit / unit_test / core_tests.py View on Github external
def test_json_config(self):
        from sciunit.utils import config_get
        config_path = os.path.join(sciunit.__path__[0],'config.json')
        print(config_path)
        self.assertTrue(os.path.isfile(config_path))
        cmap_low = config_get('cmap_low')
        self.assertTrue(isinstance(cmap_low,int))
        dummy = config_get('dummy',37)
        self.assertEqual(dummy,37)
        try:
            config_get('dummy')
        except sciunit.Error as e:
            self.assertTrue('does not contain key' in str(e))
github scidash / sciunit / sciunit / unit_test / config_tests.py View on Github external
def test_json_config(self):
        from sciunit.utils import config_get

        config_path = os.path.join(sciunit.__path__[0], "config.json")
        print(config_path)
        self.assertTrue(os.path.isfile(config_path))
        cmap_low = config_get("cmap_low")
        self.assertTrue(isinstance(cmap_low, int))
        dummy = config_get("dummy", 37)
        self.assertEqual(dummy, 37)
        try:
            config_get("dummy")
        except sciunit.Error as e:
            self.assertTrue("does not contain key" in str(e))
github scidash / sciunit / sciunit / unit_test / core_tests.py View on Github external
def test_json_config(self):
        from sciunit.utils import config_get
        config_path = os.path.join(sciunit.__path__[0],'config.json')
        print(config_path)
        self.assertTrue(os.path.isfile(config_path))
        cmap_low = config_get('cmap_low')
        self.assertTrue(isinstance(cmap_low,int))
        dummy = config_get('dummy',37)
        self.assertEqual(dummy,37)
        try:
            config_get('dummy')
        except sciunit.Error as e:
            self.assertTrue('does not contain key' in str(e))
github scidash / sciunit / sciunit / unit_test / config_tests.py View on Github external
def test_json_config(self):
        from sciunit.utils import config_get

        config_path = os.path.join(sciunit.__path__[0], "config.json")
        print(config_path)
        self.assertTrue(os.path.isfile(config_path))
        cmap_low = config_get("cmap_low")
        self.assertTrue(isinstance(cmap_low, int))
        dummy = config_get("dummy", 37)
        self.assertEqual(dummy, 37)
        try:
            config_get("dummy")
        except sciunit.Error as e:
            self.assertTrue("does not contain key" in str(e))
github scidash / sciunit / sciunit / scores / base.py View on Github external
def value_color(cls, value):
        import matplotlib.cm as cm
        if value is None or np.isnan(value):
            rgb = (128, 128, 128)
        else:
            cmap_low = config_get('cmap_low', 38)
            cmap_high = config_get('cmap_high', 218)
            cmap_range = cmap_high - cmap_low
            cmap = cm.RdYlGn(int(cmap_range*value+cmap_low))[:3]
            rgb = tuple([x*256 for x in cmap])
        return rgb
github scidash / sciunit / sciunit / scores / base.py View on Github external
def value_color(cls, value):
        import matplotlib.cm as cm
        if value is None or np.isnan(value):
            rgb = (128, 128, 128)
        else:
            cmap_low = config_get('cmap_low', 38)
            cmap_high = config_get('cmap_high', 218)
            cmap_range = cmap_high - cmap_low
            cmap = cm.RdYlGn(int(cmap_range*value+cmap_low))[:3]
            rgb = tuple([x*256 for x in cmap])
        return rgb