fealpy icon indicating copy to clipboard operation
fealpy copied to clipboard

NameError: name 'threshold' is not defined

Open yoczhang opened this issue 5 years ago • 7 comments

运行 PoissonFEMRate.py 时提示如下错误

  File "/Documentsfealpy/functionspace/LagrangeFiniteElementSpace.py", line 86, in boundary_dof
    return self.dof.boundary_dof(threshold=threshold)
NameError: name 'threshold' is not defined

yoczhang avatar Jan 13 '20 09:01 yoczhang

程序还在增加一些更完善的边界条件处理功能,这个错误应该已经解决了。     ------------------ Original ------------------ From:  "YcZhang"<[email protected]>; Date:  Mon, Jan 13, 2020 05:05 PM To:  "weihuayi/fealpy"<[email protected]>; Cc:  "Subscribed"<[email protected]>; Subject:  [weihuayi/fealpy] NameError: name 'threshold' is not defined (#8)

 

运行 PoissonFEMRate.py 时提示如下错误 File "/Documentsfealpy/functionspace/LagrangeFiniteElementSpace.py", line 86, in boundary_dof return self.dof.boundary_dof(threshold=threshold) NameError: name 'threshold' is not defined
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

weihuayi avatar Jan 15 '20 00:01 weihuayi

你重新 更新一下 FEALPy

weihuayi avatar Jan 15 '20 01:01 weihuayi

好的. 魏老师这几天可不可也更新一下其他算例, 先有一个较稳定的版本, 后面更新时可以以不同的版本号给出.

另外, 我 python 升级到了 3.8, 给出了一堆 SyntaxWarning, 全部都是关于 is 的使用, 如 if spacetype is 'C':is 更准确的应该为 ==, 是否可以考虑换成 ==?

yoczhang avatar Jan 15 '20 03:01 yoczhang

你的建议很好!我尽快给出一下稳定的版本出来。你能否把 3.8 中遇到的警告信息贴到这里。我看到就修改一下

weihuayi avatar Jan 16 '20 07:01 weihuayi

3.8 版本的警告如下

# python3.8
>>> spacetype='C'
>>> spacetype is 'C'
<stdin>:1: SyntaxWarning: "is" with a literal. Did you mean "=="?
True
>>>

而在 3.7 版本中没有此类警告

# python3.7
>>> spacetype='C'
>>> spacetype is 'C'
True
>>> 

所以在 LagrangeFiniteElementSpace.py 的第 22 行开始会有一堆的警告, 不过这类警告只出现在了我首次运行程序的时候, 后面就没出现了.

yoczhang avatar Jan 16 '20 12:01 yoczhang

好的,以后的程序中我都会改掉的。目前,LagrangeFiniteElementSpace 中接口基本稳定下来了。你在用的过程中有什么意见和想法,欢迎随时和我交流。

weihuayi avatar Jan 17 '20 02:01 weihuayi

好的.

yoczhang avatar Jan 17 '20 11:01 yoczhang