Identifiers with subscripts and superscripts
还没有人认领这个 Issue。
评估
调研方向
首先重现 issue 中所示的 PyJulia 调用,并将 Python 关键字规范化与 traceback 中 Julia 侧的名称进行比较。跟踪 PyCall 调用周围的参数处理;当存在传递原始标识符的文档化方式,或存在针对下标和上标的、经过约定且测试过的转换时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
As mentioned in the documention, Python3 normalizes some unicode identifiers, in particular those including subscripts and superscripts.
Now, I have a julia function that needs input arguments written with sub/superscripts. How can I pass the correct identifer to the function ?
Otherwise, in the same way function!() is converted to function_b(), coud we think of converting Rₛ to Rs ?
>>> from julia import PlantBiophysics as PB
>>> leaf = PB.LeafModels(
energy = PB.Monteith(),
photosynthesis = PB.Fvcb(),
stomatal_conductance = PB.Medlyn(0.03, 12.0),
Rₛ = 13.747, skyFraction = 1.0, PPFD = 1500.0, d = 0.03
)
┌ Warning: use values(kwargs) and keys(kwargs) instead of kwargs.data and kwargs.itr
│ caller = #MutableNamedTuple#1 at MutableNamedTuples.jl:9 [inlined]
└ @ Core ~/.julia/packages/MutableNamedTuples/6Sa4J/src/MutableNamedTuples.jl:9
┌ Warning: use values(kwargs) and keys(kwargs) instead of kwargs.data and kwargs.itr
│ caller = #MutableNamedTuple#1 at MutableNamedTuples.jl:9 [inlined]
└ @ Core ~/.julia/packages/MutableNamedTuples/6Sa4J/src/MutableNamedTuples.jl:9
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
/var/folders/v1/6y176c8d2jz06qr8rd3jq_480000gn/T/ipykernel_82531/2481116038.py in <module>
----> 1 leaf = PB.LeafModels(
2 energy = PB.Monteith(),
3 photosynthesis = PB.Fvcb(),
4 stomatal_conductance = PB.Medlyn(0.03, 12.0),
5 Rₛ = 13.747, skyFraction = 1.0, PPFD = 1500.0, d = 0.03
RuntimeError: <PyCall.jlwrap (in a Julia function called from Python)
JULIA: Key Rs not found as a variable of any provided models
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:33
[2] init_variables_manual(::Missing, ::Vararg{Any}; vars::Base.Pairs{Symbol, Float64, NTuple{4, Symbol}, NamedTuple{(:Rs, :skyFraction, :PPFD, :d), NTuple{4, Float64}}})
@ PlantBiophysics ~/.julia/packages/PlantBiophysics/BC7Kh/src/models_helpers.jl:320
[3] PlantBiophysics.LeafModels(; interception::Missing, energy::PlantBiophysics.Monteith{Float64, Int64}, photosynthesis::PlantBiophysics.Fvcb{Float64}, stomatal_conductance::PlantBiophysics.Medlyn{Float64}, status::Base.Pairs{Symbol, Float64, NTuple{4, Symbol}, NamedTuple{(:Rs, :skyFraction, :PPFD, :d), NTuple{4, Float64}}})
@ PlantBiophysics ~/.julia/packages/PlantBiophysics/BC7Kh/src/structs/concrete_component_structs.jl:110
[4] invokelatest(::Any; kwargs::Base.Pairs{Symbol, Any, NTuple{7, Symbol}, NamedTuple{(:energy, :photosynthesis, :stomatal_conductance, :Rs, :skyFraction, :PPFD, :d), Tuple{PlantBiophysics.Monteith{Float64, Int64}, PlantBiophysics.Fvcb{Float64}, PlantBiophysics.Medlyn{Float64}, Float64, Float64, Float64, Float64}}})
@ Base ./essentials.jl:718
[5] _pyjlwrap_call(f::Type, args_::Ptr{PyCall.PyObject_struct}, kw_::Ptr{PyCall.PyObject_struct})
@ PyCall ~/.julia/packages/PyCall/L0fLP/src/callback.jl:32
[6] pyjlwrap_call(self_::Ptr{PyCall.PyObject_struct}, args_::Ptr{PyCall.PyObject_struct}, kw_::Ptr{PyCall.PyObject_struct})
@ PyCall ~/.julia/packages/PyCall/L0fLP/src/callback.jl:44>
- 主要语言
- Python
- 星标
- 893
- 派生
- 101
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
JuliaPy/pyjulia 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 25/100
-
难度 4/5 3-5 天 新手友好度 25/100
-
难度 4/5 3-5 天 新手友好度 20/100
-
难度 3/5 1-2 天 新手友好度 48/100
-
难度 5/5 一周以上 新手友好度 25/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
gramaziokohler/compas_timber#870 ·
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
autowarefoundation/autoware_carla_scenario#500 ·
维护者通常 1 天内回复
-
good first issue priority: low size: XS testing
难度 1/5 1-3 小时 新手友好度 86/100
cubrid-lab/cubrid-mcp-server#385 ·
维护者通常 1 天内回复
-
good first issue priority: low size: S testing
难度 2/5 1-3 小时 新手友好度 85/100
cubrid-lab/cubrid-cookbook-python#447 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100