Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions conda/environment.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: hydroroot_dev
channels:
- openalea3/label/dev
- openalea3/label/rc
- openalea3
- conda-forge
dependencies:
Expand Down
46 changes: 23 additions & 23 deletions example/example_generated_archi.ipynb

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions example/parameters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ archi:
#file format: "LR_length_mm" ; "relative_distance_to_tip"
#laws used to generate lateral roots of the 1st order (1_order_law), and lateral roots of order above 1 (2_order_law)
length_file:
- data/length*order1*.csv
- data/length*order2*.csv
- data/length*order1_16*.csv
- data/length*order2_16*.csv

#length of the primary root
#float or list of float
#unit: m
primary_length: 0.16
primary_length: 0.13

#branching delay
#float or list of float
Expand All @@ -49,12 +49,12 @@ archi:

#vertices length
#unit: m
segment_length: 1.0e-3
segment_length: 1.0e-4

#part of roots without any lateral root, distance from tip
#float or list of float
#unit: m
nude_length: 0.2
nude_length: 0.02

#reference radius of the primary root
#float
Expand Down
14 changes: 7 additions & 7 deletions src/openalea/hydroroot/init_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ def __init__(self):
'read_architecture': False,
'input_dir': '',
'input_file': [],
'seed': None,
'seed': [None],
'length_file': ['data/length*order2*.csv', 'data/length*order2*.csv'],
'length_data': [],
'primary_length': 0.13,
'branching_delay': 2e-3,
'primary_length': [0.13],
'branching_delay': [2e-3],
'branching_variability': 0.25,
'order_max': 4,
'segment_length': 1.e-4,
'nude_length': 0.021,
'nude_length': [0.021],
'ref_radius': 7.0e-5,
'order_decrease_factor': 0.7}

Expand All @@ -97,8 +97,8 @@ def __init__(self):
'psi_base': 0.101325}

self.output = {
'radfold': 1.0,
'axfold': 1.0,
'radfold': [1.0],
'axfold': [1.0],
'intercepts': [0.01, 0.02, 0.03, 0.045, 0.06, 0.08],
'run_nb': 1}

Expand Down Expand Up @@ -154,7 +154,7 @@ def init_calculation(self):
# set the data used to calculate the length laws
# column names in the length law files
col_names = ('LR_length_mm', 'relative_distance_to_tip')

self.archi['length_data'] = []
for f in self.archi['length_file']:
d_path = glob.glob(f)[0]
pd = pandas.read_csv(d_path, sep = ';', header = 1, names = col_names)
Expand Down
29 changes: 16 additions & 13 deletions src/openalea/hydroroot/solver_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,18 +526,19 @@ def Jv_cnf_calculation(g, sigma, Js, Ps):
# archi_f = archi_f[0]
# df_archi = read_archi_data(archi_f) if parameter.archi['read_architecture'] else None
# index = archi_f.replace(glob.glob(parameter.archi['input_dir'])[0], "")

if parameter.archi['read_architecture']:
# architecture with filename in aqua team format
# archi_f = glob.glob(parameter.archi['input_dir'] + parameter.archi['input_file'][0])
# archi_f = archi_f[0]
fname = str(Path(parameter.archi['input_dir']) / parameter.archi['input_file'][0]) # deals with path in windows
archi_f = glob.glob(fname) # deals with wildcards ? deprecated ???
archi_f = archi_f[0]

if df_archi is None: df_archi = read_archi_data(archi_f)
index = archi_f.replace(glob.glob(parameter.archi['input_dir'])[0], "")
index = parameter.archi['input_file'][0]
if len(parameter.archi['input_file']) > 0:
index = parameter.archi['input_file'][0]

# length law data: override if necessary
if df_law is not None:
Expand Down Expand Up @@ -1254,16 +1255,18 @@ def fun3(x):


# architecture with filename in aqua team format
if df_archi is None:
# archi_f = glob.glob(parameter.archi['input_dir'] + parameter.archi['input_file'][0])
# archi_f = archi_f[0]
fname = str(Path(parameter.archi['input_dir']) / parameter.archi['input_file'][0]) # deals with path in windows
archi_f = glob.glob(fname) # deals with wildcards ? deprecated ???
archi_f = archi_f[0]

df_archi = read_archi_data(archi_f) if parameter.archi['read_architecture'] else None
index = archi_f.replace(glob.glob(parameter.archi['input_dir'])[0],"")

if len(parameter.archi['input_file']) > 0:
if df_archi is None:
# archi_f = glob.glob(parameter.archi['input_dir'] + parameter.archi['input_file'][0])
# archi_f = archi_f[0]
fname = str(Path(parameter.archi['input_dir']) / parameter.archi['input_file'][0]) # deals with path in windows
archi_f = glob.glob(fname) # deals with wildcards ? deprecated ???
archi_f = archi_f[0]

df_archi = read_archi_data(archi_f) if parameter.archi['read_architecture'] else None
index = archi_f.replace(glob.glob(parameter.archi['input_dir'])[0],"")
else:
index = ''
# length law data: override if necessary
if df_law is not None:
parameter.archi['length_data'] = df_law
Expand Down
Loading