Conversation
adamavip
commented
Feb 16, 2026
- I added a new implementation to build the millet root system as an MTG to architecture module
- I renamed module turtle to turtle_millet and added visitor2 function to visualize the different root types (crown root are the thicker)
- Add a notebook to simulate architectures for the lines 57 and 109
…sitor2 to turtle module to visualize MTGs
…sitor2 to turtle module to visualize MTGs
…ttps://github.com/adamavip/hydroroot into millet_new Merge remote branch origin/millet_new into millet_new
baugetfa
left a comment
There was a problem hiding this comment.
- The notebook gives errors see my comments
- I would change names with only '2' at the end because it is not very descriptive. But it is my point of view.
- use
conductancefromhydrootnothydroroot.milletsee comments in the ipynb and below.
There was a problem hiding this comment.
- at the cell Load diameter data for the different root types got the error
TypeError: readCSVFile() got an unexpected keyword argument 'delimiter'
Indeed in readCSVFile their is no delimiter. Just add it like that may be:
def readCSVFile(filename,delimiter=';'):
"""Read and extract data from a csv file, supposed that the data is stored in 2 columns.
:param filename: string
:returns: - data (array) - record array of (x, y) values, column headers recorded in dtype
"""
data = np.genfromtxt(filename,delimiter=delimiter,names=True)
return data-
I do not understand the figure with age. According to the heatmap the tips would be the oldest but it is not the case the tips are the youngest part of the root. So I think I misunderstand something: either it is the time of appearance so it is not the age or the heatmap is inversed.
from openalea.hydroroot.millet import conductance as conductance_millet; reload(conductance)got
NameError: name 'conductance' is not defined
Remove ; reload(conductance)
- Compute K for the lines missing
sinview()
s = mtg_scene(g109, prop_cmap='K')
view()- compute radial conducances
usehydroroot.conductance.fit_property_from_splineinstead ofhydroroot.millet.conductanceit is buggy.
from openalea.hydroroot import conductance
g57 = conductance.fit_property_from_spline(g57, radial_law57, 'position', 'k0')
g57 = conductance.compute_k(g57, k0='k0')
g109 = conductance.fit_property_from_spline(g109, radial_law109, 'position', 'k0')
g109 = conductance.compute_k(g109, k0='k0')There was a problem hiding this comment.
-
TypeError: readCSVFile() got an unexpected keyword argument 'delimiter'
I will usepandas.read_csvdirectly then destructure x and y -
Age calculation:
I think the problem comes from the fact that we fixing the passed to leaf vertices: if g.is_leaf(v):
age[v] = sr_age
@pradal can we for every axis, the maximum subtracted from the age of each vertex, so that tips become the youngest -
from openalea.hydroroot.millet import conductance as conductance_millet; reload(conductance)
This is a lapsus should bereload(conductance_millet_ -
Lapus when using view, should be
view(s)
| from openalea.mtg.mtg import fat_mtg | ||
|
|
||
|
|
||
| def millet_mtg2( |
There was a problem hiding this comment.
added 2 as a new implementation comparing the old one but can use another name
There was a problem hiding this comment.
Proposal:
millet_mtg2 -> generate_millet or millet
|
|
||
| #spline = UnivariateSpline(x, y, s=s) | ||
| keys = g.property(prop_in).keys() | ||
| x_values = np.array(g.property(prop_in).values()) |
There was a problem hiding this comment.
This is buggy. It gives a dict should be x_values = np.array(list(g.property(prop_in).values())) but use instead hydroroot.conductance.fit_property_from_spline and delete this duplicate
There was a problem hiding this comment.
No. values() returns an iterable.
But I agree that we have to reuse conductance from hydroroot.
| law = f | ||
| return law | ||
|
|
||
| def diameter_law2(data_xy, function=None, plot= True): |
There was a problem hiding this comment.
change name. '2' is not descriptive
There was a problem hiding this comment.
'2' is used just to design a second implementation but agreed not very descriptive
There was a problem hiding this comment.
Make the opposite if you think you need two functions.
Otherelse, just keep one...
| # ************** Here we define evolution diameter laws of different root types************************ | ||
|
|
||
|
|
||
| def compute_diameter_from_laws(g, |
There was a problem hiding this comment.
cannot we have either diameter or radius not both as MTG properties. This is the same information and it avoid to have a function like compute_radius_from_diameter ?
There was a problem hiding this comment.
the problem is we estimated the diameter from the evolution laws, then consequently calculated the radius afterwards
There was a problem hiding this comment.
Yes but diameter and radius is linked. So just compute radius directly (just /2).
There was a problem hiding this comment.
we should have a notebook in src I think
|
|
||
| def compute_k(g, k0 = 300.): | ||
| """Compute the radial conductance k (:math:`10^{-9}\ m.s^{-1}.MPa^{-1}`) of each vertex of the MTG. | ||
| r"""Compute the radial conductance k (:math:`10^{-9}\ m.s^{-1}.MPa^{-1}`) of each vertex of the MTG. |
There was a problem hiding this comment.
Their is an error here that I corrected it is in fact m^4.s^{-1}.MPa^{-1}
The 'r' is not neccessary their is not bug in the doc.
There was a problem hiding this comment.
I add the rstring due to a warning for escape charater...