过时的python-tool?明显的错误?

时间:2015-03-21 23:48:36

标签: python

我试着使用以下工具:https://code.google.com/p/pymsi2lmp/source/browse/#svn%2Ftrunk%2Fsrc%2Fcompass-fit

其中一个模块引发了错误......来源:

#!/usr/bin/python
sys.path.append(sys.path[0] +'/../pymsi2lmp')
import pymsi2lmp
from modify_frc import term_parameter_count as count

# Calls pymsi2lmp and returns the which parameters are missing and
# the total number of unknown coefficients.
def call_msi2lmp(model, frc):
    missing = pymsi2lmp.msi2lmp(model, frc)
    #print "missing:"
    #print missing
    unknown = {}
    for m in missing:
        if not m[0] in unknown: unknown[m[0]] = []
        unknown[m[0]].append(m[1])

    ct = sum([sum([count(m,a) for a in unknown[m]]) for m in unknown])
    return unknown,ct

我收到以下错误:

TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

我对python不是很熟悉,底层的sum-command对于我来说太复杂了,隐含的循环等等。

你在这里看到一个明显的错误,还是这个更复杂,取决于其他模块?

任何提示?

事先提前

0 个答案:

没有答案