本文整理汇总了Python中apgl.util.PathDefaults.PathDefaults.getSourceDir方法的典型用法代码示例。如果您正苦于以下问题:Python PathDefaults.getSourceDir方法的具体用法?Python PathDefaults.getSourceDir怎么用?Python PathDefaults.getSourceDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类apgl.util.PathDefaults.PathDefaults
的用法示例。
在下文中一共展示了PathDefaults.getSourceDir方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getLsos
# 需要导入模块: from apgl.util.PathDefaults import PathDefaults [as 别名]
# 或者: from apgl.util.PathDefaults.PathDefaults import getSourceDir [as 别名]
def getLsos(self):
"""
Return a function to display R memory usage
"""
fileName = PathDefaults.getSourceDir() + "/apgl/metabolomics/R/Util.R"
robjects.r["source"](fileName)
return robjects.r['lsos']
示例2: test
# 需要导入模块: from apgl.util.PathDefaults import PathDefaults [as 别名]
# 或者: from apgl.util.PathDefaults.PathDefaults import getSourceDir [as 别名]
def test():
"""
A function which uses the unittest library to find all tests within apgl (those files
matching "*Test.py"), and run those tests. In python 2.7 and above the unittest framework
is used otherwise one needs unittest2 for python 2.3-2.6.
"""
try:
import traceback
import sys
import os
import logging
from apgl.util.PathDefaults import PathDefaults
logging.disable(logging.WARNING)
#logging.disable(logging.INFO)
sourceDir = PathDefaults.getSourceDir()
print("Running tests from " + sourceDir)
version = getPythonVersion()
if version >= 2.7:
import unittest
else:
import unittest2 as unittest
overallTestSuite = unittest.TestSuite()
overallTestSuite.addTest(unittest.defaultTestLoader.discover(os.path.join(sourceDir, "data"), pattern='*Test.py', top_level_dir=sourceDir))
overallTestSuite.addTest(unittest.defaultTestLoader.discover(os.path.join(sourceDir, "features"), pattern='*Test.py', top_level_dir=sourceDir))
overallTestSuite.addTest(unittest.defaultTestLoader.discover(os.path.join(sourceDir, "generator"), pattern='*Test.py', top_level_dir=sourceDir))
overallTestSuite.addTest(unittest.defaultTestLoader.discover(os.path.join(sourceDir, "graph"), pattern='*Test.py', top_level_dir=sourceDir))
overallTestSuite.addTest(unittest.defaultTestLoader.discover(os.path.join(sourceDir, "kernel"), pattern='*Test.py', top_level_dir=sourceDir))
overallTestSuite.addTest(unittest.defaultTestLoader.discover(os.path.join(sourceDir, "predictors"), pattern='*Test.py', top_level_dir=sourceDir))
overallTestSuite.addTest(unittest.defaultTestLoader.discover(os.path.join(sourceDir, "util"), pattern='*Test.py', top_level_dir=sourceDir))
unittest.TextTestRunner(verbosity=1).run(overallTestSuite)
except ImportError as error:
traceback.print_exc(file=sys.stdout)
示例3: testGetProjectDir
# 需要导入模块: from apgl.util.PathDefaults import PathDefaults [as 别名]
# 或者: from apgl.util.PathDefaults.PathDefaults import getSourceDir [as 别名]
def testGetProjectDir(self):
print((PathDefaults.getSourceDir()))
示例4: __loadLeafRanks
# 需要导入模块: from apgl.util.PathDefaults import PathDefaults [as 别名]
# 或者: from apgl.util.PathDefaults.PathDefaults import getSourceDir [as 别名]
def __loadLeafRanks(self):
utilFileName = PathDefaults.getSourceDir() + "/apgl/metabolomics/R/Util.R"
leafRanksFileName = PathDefaults.getSourceDir() + "/apgl/metabolomics/R/MSLeafRanks.R"
robjects.r["source"](utilFileName)
robjects.r["source"](leafRanksFileName)
示例5: testGetProjectDir
# 需要导入模块: from apgl.util.PathDefaults import PathDefaults [as 别名]
# 或者: from apgl.util.PathDefaults.PathDefaults import getSourceDir [as 别名]
def testGetProjectDir(self):
logging.debug((PathDefaults.getSourceDir()))