Strawberry import MTG function

openalea.strawberry.import_mtgfile.add_axis_scale(g)[source]

add axis scale in mtg from csv

Parameters

g (MTG object) – an MTG

Returns

an MTG with axis scale added

Return type

MTG object

openalea.strawberry.import_mtgfile.add_properties(g, df, first_property)[source]

add properties to MTG from csv

Parameters
  • g (MTG object) – MTG

  • df (pandas.DataFrame) – data frame containing properties

  • first_property (string) – colname of the first property

Returns

an MTG with his properties

Return type

MTG object

openalea.strawberry.import_mtgfile.filter_none(d)[source]

filter fonction for nan value :param d: dict of dict of mtg properties :type d: dict of dict contains for a dict of MTG properties name as key and for each key a dict with vids in key and property values :return: a dict of dict of MTG properties without None values :rtype: dict of dict containing MTG properties

openalea.strawberry.import_mtgfile.import_mtg_from_csv(files, first_property, symbol_at_scale={'F': 3, 'HT': 3, 'P': 1, 'T': 2, 'b': 3, 'bt': 3, 'f': 3, 'ht': 3, 's': 3})[source]

import mtg from multiple csv file :param files: list of set of csv filenames :type files: list :param first_property: name of the first property :type: string :param symbole_at_scale: dict of label symbole and scale :type: dict :return: dict of list of mtg by file :rtype: dict

openalea.strawberry.import_mtgfile.import_mtgfile(filename)[source]

Import a MTG file from genotype name, in sharedata repo

Parameters

filename (string) – genotype = name of the file

Returns

a MTG loaded from the file

Return type

MTG

openalea.strawberry.import_mtgfile.name(f)[source]

return base name without extension

Parameters

f (string) – the file path

Returns

basename

Return type

string

openalea.strawberry.import_mtgfile.plant_number_by_varieties(g)[source]

Print plant number by varieties in a mtg

Parameters

g (MTG) – MTG

openalea.strawberry.import_mtgfile.read_file(file, sheet_name, convert=None)[source]

read csv file in share data repo :param file: filename of the csv :type file: string :param sheet_name name of sheet csv file :type sheet_name: string :param convert (optional): colname conversion if need to change colname :type convert: dict :return: a panda dataframe load from file :rtype: panda.DataFram

openalea.strawberry.import_mtgfile.strawberry_reader_csv(file, first_property='experimental_name', symbole_at_scale={'F': 3, 'HT': 3, 'P': 1, 'T': 2, 'b': 3, 'bt': 3, 'f': 3, 'ht': 3, 's': 3})[source]

Main function to import MTG from csv file

Parameters
  • file (string) – filename of csv

  • first_property (string) – colnames of the first property

  • symbole_at_scale (dict) – dict of label symbole and scale

Returns

list of individuals mtg

Return type

a list of mtg by csv

openalea.strawberry.import_mtgfile.topology(df, first_property)[source]

Extract topology from csv file and transform it in string. This function contain a string_conversion test to check if have not error in the conversion to string :param df: data containing topological information :type df: pandas.DataFrame :param first_property: colname of the first properties associate to topology information :type first_property: string :return: string contain topological information :rtype: string

openalea.strawberry.import_mtgfile.union(g)[source]

Union of all mtg in one :param g: MTGs :type g: list of dict of MTG :return: one MTG which are union of all mtg :rtype: MTG