当前位置: 首页>>代码示例>>Python>>正文


Python Debug.verbose方法代码示例

本文整理汇总了Python中PythonTools.Debug.verbose方法的典型用法代码示例。如果您正苦于以下问题:Python Debug.verbose方法的具体用法?Python Debug.verbose怎么用?Python Debug.verbose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PythonTools.Debug的用法示例。


在下文中一共展示了Debug.verbose方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: make_ft_axis

# 需要导入模块: from PythonTools import Debug [as 别名]
# 或者: from PythonTools.Debug import verbose [as 别名]
def make_ft_axis(length, dt, undersampling = 0, normalized_to_period = 0, zero_in_middle = False, flag_verbose = False):
    """
    fourier transform the time axis
    20101204/RB: started
    20130131/RB: now uses speed of light value from Crocodile.Resources.Constants

    INPUT:
    length: amount of samples
    dt: time between samples
    undersampling: 
    normalized_to_period: will normalize the spectrum to 1 for the specified period. If the number is 0, the spectrum will not be normalized.
    zero_in_middle: determines the frequency axes.

    OUTPUT:
    A frequency axis.     

    """
    DEBUG.verbose("make FT axis", flag_verbose)
    if normalized_to_period == 0:   
        resolution = 1 / ( CONST.wavenumberToInvFs * length * dt)
    else:
        resolution = normalized_to_period / (length * dt)

    array = numpy.arange((undersampling)*length/2, (undersampling+1)*length/2)*resolution

    if zero_in_middle == False:
        return numpy.concatenate((array,-numpy.flipud(array)))
    else:
        return numpy.concatenate((-numpy.flipud(array), array))
开发者ID:robbertbloem,项目名称:Crocodile,代码行数:31,代码来源:Mathematics.py

示例2: truncate_data

# 需要导入模块: from PythonTools import Debug [as 别名]
# 或者: from PythonTools.Debug import verbose [as 别名]
def truncate_data(data, x_axis, y_axis, x_min_i, x_max_i, y_min_i, y_max_i, flag_verbose = False):
    """
    Truncate data in a non-default way. 
    x_axis = [1,2,3,4,5]
    x_min_i = 0
    if x_max_i == 2: x_axis = [1,2]
    if x_max_i == 4: x_axis = [1,2,3,4]
    if x_max_i == -1: x_axis = [1,2,3,4,5]
    
    CHANGELOG:
    20130213: was in Plotting.contourplot function, moved to Functions module, now handles x_max_i == -1
    """
    
    DEBUG.verbose("Truncate data", flag_verbose)

    if x_max_i == -1:
        DEBUG.verbose("  x_max == -1", flag_verbose)
        data = data[:,x_min_i:]
        x_axis = x_axis[x_min_i:]
    else:
        DEBUG.verbose("  x_max != -1", flag_verbose)
        data = data[:,x_min_i:x_max_i]
        x_axis = x_axis[x_min_i:x_max_i]        

    if y_max_i == -1:
        DEBUG.verbose("  y_max == -1", flag_verbose)
        data = data[y_min_i:,:]
        y_axis = y_axis[y_min_i:]   
    else:
        DEBUG.verbose("  y_max != -1", flag_verbose)
        data = data[y_min_i:y_max_i,:]
        y_axis = y_axis[y_min_i:y_max_i]         
        
    return data, x_axis, y_axis
开发者ID:robbertbloem,项目名称:Crocodile,代码行数:36,代码来源:Functions.py

示例3: test_time_stamp_False

# 需要导入模块: from PythonTools import Debug [as 别名]
# 或者: from PythonTools.Debug import verbose [as 别名]
 def test_time_stamp_False(self):
     """
     This is correct
     """
     DEBUG.verbose("\nWarning is intentional", True)
     self.dc.time_stamp = False
     self.assertEqual(self.dc.time_stamp, "False")
开发者ID:robbertbloem,项目名称:Crocodile,代码行数:9,代码来源:DataClass_tests.py

示例4: execute

# 需要导入模块: from PythonTools import Debug [as 别名]
# 或者: from PythonTools.Debug import verbose [as 别名]
def execute(args):

    if args.skip1 == False:
        suite = unittest.TestLoader().loadTestsFromTestCase(Test_setting_file_stuff)
        unittest.TextTestRunner(verbosity=1).run(suite) 
    else:
        DEBUG.verbose("Skipping: " + suite_list[0], True)
开发者ID:robbertbloem,项目名称:Crocodile,代码行数:9,代码来源:DataClassCol_Tests.py

示例5: execute

# 需要导入模块: from PythonTools import Debug [as 别名]
# 或者: from PythonTools.Debug import verbose [as 别名]
def execute(args):

    if args.skip1 == False:
        suite = unittest.TestLoader().loadTestsFromTestCase(Test_find_axes)
        unittest.TextTestRunner(verbosity=1).run(suite)  
    else:
        DEBUG.verbose("Skipping: " + suite_list[0], True)


    if args.skip2 == False:
        suite = unittest.TestLoader().loadTestsFromTestCase(Test_make_contours_2d)
        unittest.TextTestRunner(verbosity=1).run(suite)    
    else:
        DEBUG.verbose("Skipping: " + suite_list[1], True)   

    if args.skip3 == False:
        suite = unittest.TestLoader().loadTestsFromTestCase(Test_find_axes_indices)
        unittest.TextTestRunner(verbosity=1).run(suite)    
    else:
        DEBUG.verbose("Skipping: " + suite_list[2], True)        

    if args.skip4 == False:
        suite = unittest.TestLoader().loadTestsFromTestCase(Test_truncate_data)
        unittest.TextTestRunner(verbosity=1).run(suite)    
    else:
        DEBUG.verbose("Skipping: " + suite_list[3], True)  

    if args.skip5 == False:
        suite = unittest.TestLoader().loadTestsFromTestCase(Test_find_subplots)
        unittest.TextTestRunner(verbosity=1).run(suite)    
    else:
        DEBUG.verbose("Skipping: " + suite_list[4], True)  
开发者ID:robbertbloem,项目名称:Crocodile,代码行数:34,代码来源:Functions_test.py

示例6: test_time_stamp_5_int

# 需要导入模块: from PythonTools import Debug [as 别名]
# 或者: from PythonTools.Debug import verbose [as 别名]
 def test_time_stamp_5_int(self):
     """
     This is correct
     """
     DEBUG.verbose("\nWarning is intentional", True)
     self.dc.time_stamp = 12345
     self.assertEqual(self.dc.time_stamp, "12345")
开发者ID:robbertbloem,项目名称:Crocodile,代码行数:9,代码来源:DataClass_tests.py

示例7: test_phase_rad_nan

# 需要导入模块: from PythonTools import Debug [as 别名]
# 或者: from PythonTools.Debug import verbose [as 别名]
 def test_phase_rad_nan(self):
     """
     None sets phase_degrees to init value
     """
     DEBUG.verbose("\nWarning is intentional", True)
     self.dc.phase_rad = None
     self.assertEqual(self.dc.phase_degrees, None)
     self.assertEqual(self.dc.phase_rad, None)
开发者ID:robbertbloem,项目名称:Crocodile,代码行数:10,代码来源:DataClass_tests.py

示例8: test_phase_rad_true

# 需要导入模块: from PythonTools import Debug [as 别名]
# 或者: from PythonTools.Debug import verbose [as 别名]
 def test_phase_rad_true(self):
     """
     True should be interpreted as 1
     """
     DEBUG.verbose("\nWarning is intentional", True)
     self.dc.phase_rad = True
     self.assertAlmostEqual(self.dc.phase_degrees, 1 * 180 / numpy.pi)
     self.assertEqual(self.dc.phase_rad, 1)
开发者ID:robbertbloem,项目名称:Crocodile,代码行数:10,代码来源:DataClass_tests.py

示例9: test_phase_rad_false

# 需要导入模块: from PythonTools import Debug [as 别名]
# 或者: from PythonTools.Debug import verbose [as 别名]
 def test_phase_rad_false(self):
     """
     False should be interpreted as 0
     """
     DEBUG.verbose("\nWarning is intentional", True)
     self.dc.phase_rad = False
     self.assertEqual(self.dc.phase_degrees, 0)
     self.assertEqual(self.dc.phase_rad, 0)
开发者ID:robbertbloem,项目名称:Crocodile,代码行数:10,代码来源:DataClass_tests.py

示例10: test_phase_degrees_none

# 需要导入模块: from PythonTools import Debug [as 别名]
# 或者: from PythonTools.Debug import verbose [as 别名]
 def test_phase_degrees_none(self):
     """
     None should will reset phase_degrees to init value
     """
     DEBUG.verbose("\nWarning is intentional", True)
     self.dc.phase_degrees = None
     self.assertEqual(self.dc.phase_degrees, None)
     self.assertEqual(self.dc.phase_rad, None)
开发者ID:robbertbloem,项目名称:Crocodile,代码行数:10,代码来源:DataClass_tests.py

示例11: test_import_data_incorrect_path

# 需要导入模块: from PythonTools import Debug [as 别名]
# 或者: from PythonTools.Debug import verbose [as 别名]
 def test_import_data_incorrect_path(self):
     """
     Path is incorrect, no data imported. Returns False
     """
     self.mess.path = "Test_resources/FolderDoesNotExist/"
     DEBUG.verbose("\nError that directory can't found is intentional", True)
     res = self.mess.import_data(flag_verbose = self.flag_verbose)
     self.assertFalse(res)
开发者ID:robbertbloem,项目名称:Crocodile,代码行数:10,代码来源:Pe_tw_tests.py

示例12: test_import_data_no_data

# 需要导入模块: from PythonTools import Debug [as 别名]
# 或者: from PythonTools.Debug import verbose [as 别名]
 def test_import_data_no_data(self):
     """
     folder exists, LV_file_format.1 exists and is correct, but contains no other data
     """
     self.mess.path = "Test_resources/petw_test_folder_2/"
     DEBUG.verbose("\nError about importing is intentional", True)
     res = self.mess.import_data(flag_verbose = self.flag_verbose)
     self.assertFalse(res)
开发者ID:robbertbloem,项目名称:Crocodile,代码行数:10,代码来源:Pe_tw_tests.py

示例13: test_import_data_wrong_file_format

# 需要导入模块: from PythonTools import Debug [as 别名]
# 或者: from PythonTools.Debug import verbose [as 别名]
 def test_import_data_wrong_file_format(self):
     """
     LV_file_format.666 should not be recognized.
     """
     self.mess.path = "Test_resources/petw_test_folder_1/"
     DEBUG.verbose("\nError about unknown file format is intentional", True)
     res = self.mess.import_data(flag_verbose = self.flag_verbose)
     self.assertFalse(res)
开发者ID:robbertbloem,项目名称:Crocodile,代码行数:10,代码来源:Pe_tw_tests.py

示例14: test_2p_1m

# 需要导入模块: from PythonTools import Debug [as 别名]
# 或者: from PythonTools.Debug import verbose [as 别名]
 def test_2p_1m(self):
     """
     mess[0].s = 1 + [1].s: 2 - [2].s: 3
     (1 + 2) / 2 - 3 = -1.5
     """
     DEBUG.verbose("\nWarning about zeropad intentional", True)
     mer = PEME.pe_merge("Test", class_plus = [self.mess[0], self.mess[1]], class_min = [self.mess[2]], flag_verbose = self.flag_verbose)
     self.assertTrue(numpy.all(mer.s == -1.5))
开发者ID:robbertbloem,项目名称:Crocodile,代码行数:10,代码来源:Pe_merge_tests.py

示例15: test_rs_1

# 需要导入模块: from PythonTools import Debug [as 别名]
# 或者: from PythonTools.Debug import verbose [as 别名]
 def test_rs_1(self):
     """
     This should work correct
     r and s exist
     """
     DEBUG.verbose("\nTwo intentional zeropad warnings", True)
     mer = PEME.pe_merge("Test", class_plus = [self.mess[0]], class_min = [self.mess[1]], flag_verbose = self.flag_verbose)
     self.assertTrue(numpy.all(mer.s))
开发者ID:robbertbloem,项目名称:Crocodile,代码行数:10,代码来源:Pe_merge_tests.py


注:本文中的PythonTools.Debug.verbose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。