In Julia I’ve extend the basic operations (+,-,*,/,…) to operate on GMT types. That allow for example to do:
julia> G = peaks()
A GMTgrid object with 1 layers of type Float32
Gridline node registration used
x_min: -3.0 x_max :3.0 x_inc :0.125 n_columns :49
y_min: -3.0 y_max :3.0 y_inc :0.125 n_rows :49
z_min: -6.541661739349365 z_max :8.083918571472168
Mem layout: BCB
julia> G * 100
A GMTgrid object with 1 layers of type Float32
Gridline node registration used
x_min: -3.0 x_max :3.0 x_inc :0.125 n_columns :49
y_min: -3.0 y_max :3.0 y_inc :0.125 n_rows :49
z_min: -654.1661739349365 z_max :808.3918571472168
Mem layout: BCB
But the same fails on the Python side because it is the Py multiplication that is being called instead of the Julia one.
In [1]: from juliacall import Main as jl
In [2]: jl.seval("using GMT")
In [3]: G = jl.peaks()
In [4]: G * 100
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[4], line 1
----> 1 G * 100
TypeError: unsupported operand type(s) for *: 'ArrayValue' and 'int'
Is it possible to tell py to let Julia do the mat? (tried a couple of things but they all failed).