Giter Club home page Giter Club logo

mtg's Introduction

CI status

image

Documentation Status

openalea.mtg

Multiscale Tree Graph datastructure and interfaces

Description

MTG (Multi-scale Tree Graph) is a common data structure to represent plant architecture at various scales.

MTG package aims to define :

  • A share data structure for plant architecture representation.
  • Read and write MTG files.
  • Export to various graph format.
  • Several algorithms for MTG.

Installation

Install this package using conda :

conda install -c openalea3 -c conda-forge openalea.mtg

mtg's People

Contributors

christian34 avatar cokelaer avatar dbarbeau avatar ethan13310 avatar fredboudon avatar jpeyhardi avatar julien-diener avatar pfernique avatar pomme-abricot avatar pradal avatar revesansparole avatar thomasarsouze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mtg's Issues

l.plot(tree) or plot(tree)?

I the userguide n chapter 9.1 it is said to use the following command however it gives a weird error in the PlantGL 3D Viewer:

l.plot(tree)

Are you sure that it should be simply the following?

plot(tree)

When I do that the plot is almost correct (except that the angles are assumed to be always 45 degrees)

Add a dump and load method

Add a method to dump and load the MTG into/from a file.
The method needs to check if all the properties can be pickled.

mtg2lpy

The function mtg2lpy() is an extremely useful function

Unfortunately there is not much documentation yet

I am trying to use it but I don't understand which argument I should use.

I see there are 2 arguments:
the first should be the actual .mtg (I called it g and I generated with g = read_mtg_file('test.mtg'))
the second argument is supposed to be a 'lsystem' but I really don't understand what should it be since I have no lsystem yet (that's what I am trying generate with mtg2lpy!)

Thank you very much!

Reading Valid MTG fails

reading a valid MTG fails under Python 3 because io.py uses bad_right as a boolean. It needs to check something like len(list(bad_right) > 0 instead . See line 1041 and 1042

Insert scale refactoring

Hello,
apparently in the later versions of python StopIteration exception raises a runtime error. Here there is more on that:
https://peps.python.org/pep-0479/

Therefore we have to change the insert_scale method code, in particular line 1099

sup_components = dict((v, next(g.component_roots_iter(v))) for v in sup_vertices)

raises a runtime error and stops execution. I replaced it with

sup_components = dict()
for v in sup_vertices:
iteratorr = g.component_roots_iter(v)
while True:
try:
sup_components[v] = next(iteratorr)
except StopIteration:
break

And now it seems to work fine.
Can you verify that this is correct ?

remove_vertex does not update properties

After removing a vertex with remove_vertex, properties are not updated.
further using _remove_vertex properties does the job.
Probably due to wrong call in tree.py (remove vertex does not return vid), line 535,536:

vid = super(PropertyTree, self).remove_vertex(vid, reparent_child=reparent_child) self._remove_vertex_properties(vid)

guessing that :

super(PropertyTree, self).remove_vertex(vid, reparent_child=reparent_child) self._remove_vertex_properties(vid)

should be okay

Missing parents for incomplete MTG

Some MTG may have missing vertices at the lower scale.

ENTITY-CODE						
/P									
/A1											2016
^/S1
	+B1										2017
		+C1									2018

C1 has no parents

g.roots(scale=2) return [2, 4, 5]

Add tests to conda

Add test to conda.
Then at each modifications, all the tests will be run

Add install instructions?

Based on plantgl I guessed that the install instruction was

conda install openalea.mtg -c fredboudon -c conda-forge

but could that be added to the README?

Verbose mode to silent/activate warning messages

When building an MTG from file, there are a set of warning that are displayed.
It would be good to add a silent or verbose mode to allow the user to manage the log information

  • Add a verbose mode to the MTG constructor
  • Remove debug information with dynamic MTG

[Installation error] Installation error via conda for windows

I tried to install openalea.mtg via conda on Windows.
conda install -c openalea3 openalea.mtg

A package conflict message appears see :
image

Not having previously installed python I installed python and tried again
conda install -c conda-forge python
conda install -c openalea3 openalea.mtg

I had a conflict on my python 3.10.4 version
so I downgraded to 3.10.0
conda install -c conda-forge python=3.10.0
conda install -c openalea3 openalea.mtg
it still didn't work
image

same for python=3.9.12
conda install -c conda-forge python=3.9
conda install -c openalea3 openalea.mtg
image

Raise an error when column name does not match to features

The MTG reader fail strongly when some column names are not defined in the header (FEATURE).
The reader seems to shift the columns by non considering the unknow property names.

Please raise an error when this is the case.
Then the header can be fixed easily.

io.write_mtg bug

While using the above function on an mtg which is the output of hydroshoot, some values appear displaced. Notably it seems that the presence of an array within the properties, i.e.
'TopPositionPoints': array([[ 5.39, -7.29, 48.87],
[ 5.48, -7.57, 47.6 ],
[ 4.61, -7.44, 46.97],
[ 4.06, -6.92, 45.6 ],
[ 3.63, -6.07, 46.86]])

confuses the function and causes a displacement of a number of values. It happens in all nodes which represent leaves, where a similar array is present in the properties.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.