Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

ParseError in lambdify

未关闭
#209 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
julia
领域
backend

调研方向

从 lambdify.jl 的第 143-144 行开始,运行提供的 integrate 和 convert(Function, str) 示例。检查传递给 Julia 的 parse 调用的符号表达式,尤其要关注幂运算的呈现方式。当所报告的用例能够在没有 ParseError 的情况下转换为可调用函数时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

I received the following parse error while using lambidify:

ParseError("use \"^\" instead of \"**\"")
#parse#234(::Bool, ::Bool, ::Function, ::String, ::Int64) at parse.jl:222
(::Base.#kw##parse)(::Array{Any,1}, ::Base.#parse, ::String, ::Int64) at <missing>:0
#parse#235(::Bool, ::Function, ::String) at parse.jl:232
parse(::String) at parse.jl:232
#lambdify#218(::Type{T} where T, ::Dict{Any,Any}, ::Dict{Any,Any}, ::Function, ::SymPy.Sym, ::Array{SymPy.Sym,1}) at lambdify.jl:144
lambdify(::SymPy.Sym, ::Array{SymPy.Sym,1}) at lambdify.jl:143
lambdify(::SymPy.Sym) at lambdify.jl:143
convert(::Type{Function}, ::SymPy.Sym) at types.jl:92
include_string(::String, ::String) at loading.jl:522
include_string(::String, ::String, ::Int64) at eval.jl:30
include_string(::Module, ::String, ::String, ::Int64, ::Vararg{Int64,N} where N) at eval.jl:34
(::Atom.##100#105{String,Int64,String})() at eval.jl:75
withpath(::Atom.##100#105{String,Int64,String}, ::Void) at utils.jl:30
withpath(::Function, ::String) at eval.jl:38
didWriteToREPL(::Atom.##99#104{String,Int64,String}) at repl.jl:129
hideprompt(::Atom.##99#104{String,Int64,String}) at repl.jl:65
macro expansion at eval.jl:73 [inlined]
(::Atom.##98#103{Dict{String,Any}})() at task.jl:80

Interestingly, I didn't see any instances of "**" in the symbolic output. Unfortunately, I do not have a minimum working example that produces the error, but I do have my particular use case:

using SymPy
@syms d L U x t
str = integrate(cos(t*x)*x^(-1/d -1),x,U^-d,L^-d)
fun = convert(Function,str)
主要语言
Julia
星标
282
派生
59
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

JuliaPy/SymPy.jl 的其他 Issue

查看 JuliaPy/SymPy.jl 的全部 Issue

相似的 Issue

更多 Julia Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。