Skip to content

Commit

Permalink
Update import to openalea.hydroshoot
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasarsouze committed Jan 31, 2024
1 parent 497bac3 commit ca2773a
Show file tree
Hide file tree
Showing 42 changed files with 65 additions and 65 deletions.
4 changes: 2 additions & 2 deletions doc/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Set the required files up

.. code-block:: python
from hydroshoot import model
from openalea.hydroshoot import model
model.run(g, working_directory, psi_soil=-0.5)
Expand Down Expand Up @@ -103,7 +103,7 @@ Let's build the mock-up using the digitalization data provided in "grapevine_pot
from openalea.mtg import traversal
from openalea.plantgl.all import Scene
from hydroshoot import architecture, display, model
from openalea.hydroshoot import architecture, display, model
# Path for plant digitalization data.
g = architecture.vine_mtg('grapevine_pot.csv')
Expand Down
6 changes: 3 additions & 3 deletions example/figs/paper_figs.py
Original file line number Diff line number Diff line change
Expand Up @@ -972,9 +972,9 @@ def estimate_energy_balance_contribution():
from datetime import datetime, timedelta
from matplotlib import dates, pyplot, patches, colors, colorbar, rcParams, ticker, gridspec

from hydroshoot.architecture import mtg_load
from hydroshoot.utilities import vapor_pressure_deficit as VPDa
from hydroshoot import display
from openalea.hydroshoot.architecture import mtg_load
from openalea.hydroshoot.utilities import vapor_pressure_deficit as VPDa
from openalea.hydroshoot import display

rcParams.update({'font.size': 11})
pyplot.style.use('seaborn-ticks')
Expand Down
2 changes: 1 addition & 1 deletion example/gdc_can1_grapevine/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from openalea.mtg import traversal
from openalea.plantgl.all import Scene

from hydroshoot import architecture, display, model
from openalea.hydroshoot import architecture, display, model

if __name__ == '__main__':
path_project = Path(__file__).parent
Expand Down
2 changes: 1 addition & 1 deletion example/gdc_can2_grapevine/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from openalea.mtg import traversal
from openalea.plantgl.all import Scene

from hydroshoot import architecture, display, model
from openalea.hydroshoot import architecture, display, model

if __name__ == '__main__':
path_project = Path(__file__).parent
Expand Down
2 changes: 1 addition & 1 deletion example/gdc_can3_grapevine/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from openalea.mtg import traversal
from openalea.plantgl.all import Scene

from hydroshoot import architecture, display, model
from openalea.hydroshoot import architecture, display, model

if __name__ == '__main__':
path_project = Path(__file__).parent
Expand Down
2 changes: 1 addition & 1 deletion example/misc/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from openalea.mtg import traversal
from openalea.plantgl.all import Scene

from hydroshoot import architecture, display, model
from openalea.hydroshoot import architecture, display, model

# =============================================================================
# Construct the plant mock-up
Expand Down
2 changes: 1 addition & 1 deletion example/modularity/ws/sim_1/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from openalea.mtg import traversal
from openalea.plantgl.all import Scene

from hydroshoot import architecture, display, model
from openalea.hydroshoot import architecture, display, model

if __name__ == '__main__':
path_project = Path(__file__).parent
Expand Down
2 changes: 1 addition & 1 deletion example/modularity/ws/sim_2/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from openalea.mtg import traversal
from openalea.plantgl.all import Scene

from hydroshoot import architecture, display, model
from openalea.hydroshoot import architecture, display, model

if __name__ == '__main__':
path_project = Path(__file__).parent
Expand Down
2 changes: 1 addition & 1 deletion example/modularity/ws/sim_3/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from openalea.mtg import traversal
from openalea.plantgl.all import Scene

from hydroshoot import architecture, display, model
from openalea.hydroshoot import architecture, display, model

if __name__ == '__main__':
path_project = Path(__file__).parent
Expand Down
2 changes: 1 addition & 1 deletion example/modularity/ws/sim_4/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from openalea.mtg import traversal
from openalea.plantgl.all import Scene

from hydroshoot import architecture, display, model
from openalea.hydroshoot import architecture, display, model

if __name__ == '__main__':
path_project = Path(__file__).parent
Expand Down
2 changes: 1 addition & 1 deletion example/modularity/ww/sim_1/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from openalea.mtg import traversal
from openalea.plantgl.all import Scene

from hydroshoot import architecture, display, model
from openalea.hydroshoot import architecture, display, model

if __name__ == '__main__':
path_project = Path(__file__).parent
Expand Down
2 changes: 1 addition & 1 deletion example/modularity/ww/sim_2/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from openalea.mtg import traversal
from openalea.plantgl.all import Scene

from hydroshoot import architecture, display, model
from openalea.hydroshoot import architecture, display, model

if __name__ == '__main__':
path_project = Path(__file__).parent
Expand Down
2 changes: 1 addition & 1 deletion example/modularity/ww/sim_3/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from openalea.mtg import traversal
from openalea.plantgl.all import Scene

from hydroshoot import architecture, display, model
from openalea.hydroshoot import architecture, display, model

if __name__ == '__main__':
path_project = Path(__file__).parent
Expand Down
2 changes: 1 addition & 1 deletion example/modularity/ww/sim_4/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from openalea.mtg import traversal
from openalea.plantgl.all import Scene

from hydroshoot import architecture, display, model
from openalea.hydroshoot import architecture, display, model

if __name__ == '__main__':
path_project = Path(__file__).parent
Expand Down
2 changes: 1 addition & 1 deletion example/potted_grapevine/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from openalea.mtg import traversal, mtg
from openalea.plantgl.all import Scene

from hydroshoot import architecture, display, model
from openalea.hydroshoot import architecture, display, model


def build_mtg(path_file: Path, is_show_scene: bool = True) -> (mtg.MTG, Scene):
Expand Down
2 changes: 1 addition & 1 deletion example/potted_grapevine/sim_with_preprocessed_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from openalea.plantgl.all import Scene

from example.potted_grapevine.sim import build_mtg
from hydroshoot import io, model, initialisation
from openalea.hydroshoot import io, model, initialisation


def preprocess_inputs(grapevine_mtg: MTG, path_project_dir: Path, psi_soil: float, gdd_since_budbreak: float,
Expand Down
2 changes: 1 addition & 1 deletion example/virtual_canopies/gdc/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from openalea.mtg import traversal
from openalea.plantgl.all import Scene

from hydroshoot import architecture, display, model
from openalea.hydroshoot import architecture, display, model

if __name__ == '__main__':
path_project = Path(__file__).parent
Expand Down
2 changes: 1 addition & 1 deletion example/virtual_canopies/lyre/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from openalea.mtg import traversal
from openalea.plantgl.all import Scene

from hydroshoot import architecture, display, model
from openalea.hydroshoot import architecture, display, model

if __name__ == '__main__':
path_project = Path(__file__).parent
Expand Down
2 changes: 1 addition & 1 deletion example/virtual_canopies/vsp/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from openalea.mtg import traversal
from openalea.plantgl.all import Scene

from hydroshoot import architecture, display, model
from openalea.hydroshoot import architecture, display, model

if __name__ == '__main__':
path_project = Path(__file__).parent
Expand Down
2 changes: 1 addition & 1 deletion example/vsp_ws_grapevine/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from openalea.mtg import traversal
from openalea.plantgl.all import Scene

from hydroshoot import architecture, display, model
from openalea.hydroshoot import architecture, display, model

if __name__ == '__main__':
path_project = Path(__file__).parent
Expand Down
2 changes: 1 addition & 1 deletion example/vsp_ww_grapevine/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from openalea.mtg import traversal
from openalea.plantgl.all import Scene

from hydroshoot import architecture, display, model
from openalea.hydroshoot import architecture, display, model

if __name__ == '__main__':
path_project = Path(__file__).parent
Expand Down
2 changes: 1 addition & 1 deletion src/openalea/hydroshoot/architecture.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from scipy.linalg import norm, svd
from scipy.spatial import distance

from hydroshoot.extern.roman import toRoman
from openalea.hydroshoot.extern.roman import toRoman


# ==============================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/openalea/hydroshoot/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

plt.style.use('ggplot')

from hydroshoot.soil import SOIL_PROPS
from openalea.hydroshoot.soil import SOIL_PROPS

DEFAULT_LABELS = {
'Eabs': r'$\mathregular{E_{abs}\/[\mu mol\/m^{-2}\/s^{-1}]}$',
Expand Down
6 changes: 3 additions & 3 deletions src/openalea/hydroshoot/energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
from sympy import Symbol
from sympy.solvers import nsolve

import hydroshoot.constants as cst
from hydroshoot import utilities as utils
from hydroshoot.architecture import get_leaves
import openalea.hydroshoot.constants as cst
from openalea.hydroshoot import utilities as utils
from openalea.hydroshoot.architecture import get_leaves


def pgl_scene(g, flip=False):
Expand Down
4 changes: 2 additions & 2 deletions src/openalea/hydroshoot/exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from copy import deepcopy
from math import exp, acos, sqrt, cos, log

from hydroshoot import utilities as utils
from hydroshoot.constants import oxygen_partial_pressure as o, ideal_gaz_cst as r
from openalea.hydroshoot import utilities as utils
from openalea.hydroshoot.constants import oxygen_partial_pressure as o, ideal_gaz_cst as r


# ==============================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/openalea/hydroshoot/hydraulic.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import openalea.mtg.traversal as traversal
from openalea.plantgl.all import surface as surf

import hydroshoot.constants as cst
import openalea.hydroshoot.constants as cst


def conductivity_max(diameter, a=2.8, b=0.1, min_kmax=0.):
Expand Down
16 changes: 8 additions & 8 deletions src/openalea/hydroshoot/initialisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
from pandas import DataFrame
from pandas import date_range

from hydroshoot import soil
from hydroshoot.architecture import get_mtg_base, add_soil_surface_mesh, get_leaves
from hydroshoot.energy import (set_form_factors_simplified, set_local_wind_speed, set_local_air_temperature,
from openalea.hydroshoot import soil
from openalea.hydroshoot.architecture import get_mtg_base, add_soil_surface_mesh, get_leaves
from openalea.hydroshoot.energy import (set_form_factors_simplified, set_local_wind_speed, set_local_air_temperature,
set_local_vpd, set_leaf_temperature_to_air_temperature)
from hydroshoot.exchange import leaf_Na
from hydroshoot.io import HydroShootInputs, HydroShootHourlyInputs
from hydroshoot.irradiance import irradiance_distribution, hsCaribu, set_optical_properties
from hydroshoot.params import Params
from hydroshoot.preprocess import calc_gdd_since_budbreak
from openalea.hydroshoot.exchange import leaf_Na
from openalea.hydroshoot.io import HydroShootInputs, HydroShootHourlyInputs
from openalea.hydroshoot.irradiance import irradiance_distribution, hsCaribu, set_optical_properties
from openalea.hydroshoot.params import Params
from openalea.hydroshoot.preprocess import calc_gdd_since_budbreak


def calc_nitrogen_distribution(g: MTG, gdd_since_budbreak: float, weather: DataFrame, params: Params) -> float:
Expand Down
10 changes: 5 additions & 5 deletions src/openalea/hydroshoot/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
from openalea.plantgl.all import Scene
from pandas import DataFrame, read_csv, DatetimeIndex

from hydroshoot.architecture import get_leaves
from hydroshoot.display import visu
from hydroshoot.energy import force_soil_temperature
from hydroshoot.params import Params
from hydroshoot.soil import update_soil_water_potential
from openalea.hydroshoot.architecture import get_leaves
from openalea.hydroshoot.display import visu
from openalea.hydroshoot.energy import force_soil_temperature
from openalea.hydroshoot.params import Params
from openalea.hydroshoot.soil import update_soil_water_potential


class HydroShootInputs(object):
Expand Down
2 changes: 1 addition & 1 deletion src/openalea/hydroshoot/irradiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from pvlib.solarposition import ephemeris
from pytz import timezone

from hydroshoot.architecture import vector_rotation
from openalea.hydroshoot.architecture import vector_rotation


def local2solar(local_time, latitude, longitude, time_zone, temperature=25.):
Expand Down
6 changes: 3 additions & 3 deletions src/openalea/hydroshoot/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
from openalea.plantgl.all import Scene, surface
from pandas import DataFrame

from hydroshoot import (architecture, solver, io, soil, constants)
from hydroshoot.energy import calc_effective_sky_temperature
from hydroshoot.initialisation import init_model, init_hourly, set_collar_water_potential_function
from openalea.hydroshoot import (architecture, solver, io, soil, constants)
from openalea.hydroshoot.energy import calc_effective_sky_temperature
from openalea.hydroshoot.initialisation import init_model, init_hourly, set_collar_water_potential_function


def run(g: MTG, wd: Path, path_weather: Path, params: dict = None, scene: Scene = None,
Expand Down
2 changes: 1 addition & 1 deletion src/openalea/hydroshoot/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from pandas import date_range, DataFrame

from hydroshoot.utilities import calc_effective_daily_temperature
from openalea.hydroshoot.utilities import calc_effective_daily_temperature


def calc_gdd_since_budbreak(weather: DataFrame, date_budbreak: datetime, date_beg_sim: datetime,
Expand Down
2 changes: 1 addition & 1 deletion src/openalea/hydroshoot/soil.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from math import pi, log

from hydroshoot import constants as cst
from openalea.hydroshoot import constants as cst

SOIL_PROPS = dict(
Sand=(0.045, 0.430, 0.145, 2.68, 712.8),
Expand Down
6 changes: 3 additions & 3 deletions src/openalea/hydroshoot/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import openalea.mtg.traversal as traversal

from hydroshoot import hydraulic, exchange, energy
from hydroshoot.architecture import get_leaves
from hydroshoot.soil import update_soil_water_potential
from openalea.hydroshoot import hydraulic, exchange, energy
from openalea.hydroshoot.architecture import get_leaves
from openalea.hydroshoot.soil import update_soil_water_potential


def solve_interactions(g, meteo, psi_soil, t_soil, t_sky_eff, params, calc_collar_water_potential):
Expand Down
2 changes: 1 addition & 1 deletion test/non_regression_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pandas import read_csv, DatetimeIndex

from openalea.mtg import traversal
from hydroshoot import architecture
from openalea.hydroshoot import architecture

sources_dir = join(dirname(__file__), 'data')

Expand Down
2 changes: 1 addition & 1 deletion test/test_architecture.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from os.path import dirname, join

from hydroshoot import architecture
from openalea.hydroshoot import architecture

Source_Dir = join(dirname(__file__), 'data')

Expand Down
6 changes: 3 additions & 3 deletions test/test_energy.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import openalea.plantgl.all as pgl
from numpy.testing import assert_almost_equal

import hydroshoot.energy as energy
from hydroshoot.architecture import get_leaves
from hydroshoot.energy import set_form_factors_simplified, calc_leaf_temperature, force_soil_temperature
import openalea.hydroshoot.energy as energy
from openalea.hydroshoot.architecture import get_leaves
from openalea.hydroshoot.energy import set_form_factors_simplified, calc_leaf_temperature, force_soil_temperature
from test.non_regression_data import potted_syrah, meteo


Expand Down
2 changes: 1 addition & 1 deletion test/test_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from numpy import arange, linspace, testing
from pandas import Series

from hydroshoot import exchange, utilities, constants
from openalea.hydroshoot import exchange, utilities, constants


def setup_default_photosynthesis_params():
Expand Down
2 changes: 1 addition & 1 deletion test/test_hydraulic.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from numpy import arange
from openalea.mtg import traversal

from hydroshoot import hydraulic, architecture
from openalea.hydroshoot import hydraulic, architecture
from test.non_regression_data import potted_syrah


Expand Down
Loading

0 comments on commit ca2773a

Please sign in to comment.