tecosaur / About.jl

Mirror of https://code.tecosaur.net/tec/About.jl
Mozilla Public License 2.0
130 stars 7 forks source link

about() errors with the GMT types #21

Closed joa-quim closed 2 weeks ago

joa-quim commented 2 months ago

For example the GMTgrid

using GMT

G = peaks();

about(G)
49×49 GMTgrid{Float32, 2} (mutable) (<: AbstractMatrix{Float32} <: Any), occupies 232B directly (referencing 11kB in total)
ERROR: Type Array does not have a definite size.
Stacktrace:
  [1] sizeof(x::Type)
    @ Base .\essentials.jl:631
  [2] (::About.var"#11#12"{DataType})(i::Int64)
    @ About C:\Users\j\.julia\packages\About\52iMk\src\types.jl:22
...
tecosaur commented 2 weeks ago

Seems fine as of the dev version :slightly_smiling_face: (I credit f232aaacdd9d97c31bd796c02a31a011ecedc26d)

julia> about(G)
49×49 GMTgrid{Float32, 2} (mutable) (<: AbstractMatrix{Float32} <: Any), occupies 232B directly (referencing 11kB in total)
        proj4::String                                 8B @ 0x00007f2c16070d18                                            ""
          wkt::String                                 8B @ 0x00007f2c16070d18                                            ""
         epsg::Int64                                  8B 000000000000000000000000000000 … 000000000000000000000000000000 0
         geog::Int64                                  8B 000000000000000000000000000000 … 000000000000000000000000000000 0
        range::Union{Vector{Any}, Vector{Float64}}    8B @ 0x00007f2af99701b0                                            [-3.0, 3.0, -3. … 4166, 8.08392]
          inc::Union{Vector{Any}, Vector{Float64}}    8B @ 0x00007f2b2449c5f0                                            [0.125, 0.125]
 registration::Int64                                  8B 000000000000000000000000000000 … 000000000000000000000000000000 0
       nodata::Union{Float32, Float64}               16B Ptr?                                                            NaN
        title::String                                 8B @ 0x00007f2c16070d18                                            ""
       remark::String                                 8B @ 0x00007f2c16070d18                                            ""
      command::String                                 8B @ 0x00007f2c16070d18                                            ""
          cpt::String                                 8B @ 0x00007f2c16070d18                                            ""
        names::Vector{String}                         8B @ 0x00007f2c0f17c970                                            String[]
            x::Vector{Float64}                        8B @ 0x00007f2af9380020                                            [-3.0, -2.875,  … 5, 2.875, 3.0]
            y::Vector{Float64}                        8B @ 0x00007f2af93801e0                                            [-3.0, -2.875,  … 5, 2.875, 3.0]
            v::Union{Vector{String}, Vector{<:Real}…  8B @ 0x00007f2c1269c970                                            Float64[]
            z::Matrix{Float32}                        8B @ 0x0000000024bb1840                                            Float32[6.74662 … -5 4.10297f-5]
       x_unit::String                                 8B @ 0x00007f2c145d6178                                            "x"
       y_unit::String                                 8B @ 0x00007f2c14b616c8                                            "y"
       v_unit::String                                 8B @ 0x00007f2c16070d18                                            ""
       z_unit::String                                 8B @ 0x00007f2a8379a768                                            "z"
       layout::String                                 8B @ 0x00007f2a838c0bf8                                            "BCB"
        scale::Union{Float32, Float64}               16B Ptr?                                                            1.0
       offset::Union{Float32, Float64}               16B Ptr?                                                            0.0
          pad::Int64                                  8B 000000000000000000000000000000 … 000000000000000000000000000000 0
      hasnans::Int64                                  8B 000000000000000000000000000000 … 000000000000000000000000000010 2

 ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  *  *  8B  8B  *  *  8B  *   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   *   8B  8B 

 * = Pointer (8B)
joa-quim commented 1 week ago

I'm afraid it's working yet

julia> about(G)
49×49 GMTgrid{Float32, 2} (mutable) (<: AbstractMatrix{Float32} <: Any), occupies 232B directly (referencing 11kB in total)
ERROR: Type Array does not have a definite size.
Stacktrace:
  [1] sizeof(x::Type)
    @ Base .\essentials.jl:631
  [2] (::About.var"#11#12"{DataType})(i::Int64)
    @ About C:\Users\j\.julia\packages\About\WUpvh\src\types.jl:26