Skip to content

Adel mtg labels have type bytes #46

@rbarillot

Description

@rbarillot

Hi,

using adel 2.0.2, I'm having a strange behaviour while loading an old pickled MTG (located [in] (https://github.com/openalea-incubator/fspm-wheat/tree/master/example/Vegetative_stages/inputs)).

Here is the piece of code I'm using to load the MTG

from alinea.adel.adel_dynamic import AdelDyn
from alinea.adel.echap_leaf import echap_leaves

adel_wheat = AdelDyn(seed=1, scene_unit='m', leaves=echap_leaves(xy_model='Soissons_byleafclass'))
g = adel_wheat.load(directory=INPUTS_DIRPATH)

While the labels of the mtg vertices used to be strings, they are now converted into bytes:

for vid in g.components_at_scale(1,2):
    print(g.get_vertex_property(vid)['label'], type(g.get_vertex_property(vid)['label']))
    
MS <class 'str'>
b'T1' <class 'numpy.bytes_'>
b'T1.0' <class 'numpy.bytes_'>
b'T2' <class 'numpy.bytes_'>
b'T2.0' <class 'numpy.bytes_'>
b'T3' <class 'numpy.bytes_'>
b'T4' <class 'numpy.bytes_'>

TY

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions