JuliaPy / JuliaPy/pyjulia

Identifiers with subscripts and superscripts

Open
#484 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
893
Forks
101
PR merge metrics
No merged PRs in 30d

Description

As [mentioned in the documention](https://pyjulia.readthedocs.io/en/latest/limitations.html), Python3 normalizes some unicode identifiers, in particular those [including subscripts and superscripts](https://stackoverflow.com/questions/48404881/unicode-subscripts-and-superscripts-in-identifiers-why-does-python-consider-xu).

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
----> 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:
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.