Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
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
24 changes: 13 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from os.path import abspath, normpath
from os.path import join as pj

from setuptools import setup, find_packages
from setuptools import setup, find_namespace_packages


short_descr = "HydroShoot is an FSPM model to simulate gas-exchange on vine"
Expand All @@ -17,14 +17,15 @@


# find version number in src/hydroshoot/version.py
version = {}
with open("src/hydroshoot/version.py") as fp:
exec(fp.read(), version)
_version = {}
with open("src/openalea/hydroshoot/version.py") as fp:
exec(fp.read(), _version)

version = _version["__version__"]

data_files = []

nb = len(normpath(abspath("src/hydroshoot_data"))) + 1
nb = len(normpath(abspath("src/openalea/hydroshoot_data"))) + 1


def data_rel_pth(pth):
Expand All @@ -34,25 +35,26 @@ def data_rel_pth(pth):
return abs_pth[nb:]


for root, dnames, fnames in walk("src/hydroshoot_data"):
for root, dnames, fnames in walk("src/openalea/hydroshoot_data"):
for name in fnames:
data_files.append(data_rel_pth(pj(root, name)))


setup_kwds = dict(
name='hydroshoot',
version=version["__version__"],
version=version,
description=short_descr,
long_description=readme + '\n\n' + history,
author="Rami Albasha, Christian Fournier, Christophe Pradal, Eric Lebon, ",
author_email="rami albasha at inra dot fr, @fournier-ch, @pradal, eric dot lebon at inra dot fr, ",
url='https://github.com/openalea/hydroshoot',
license='cecill-c',
license='CeCILL-C',
zip_safe=False,

packages=find_packages('src'),
packages=find_namespace_packages(where='src', include=['openalea', 'openalea.*']),
package_dir={'': 'src'},

namespace_packages=['openalea'],

include_package_data=True,
package_data={'hydroshoot_data': data_files},
install_requires=[
Expand All @@ -61,7 +63,7 @@ def data_rel_pth(pth):
"pytest",
],
entry_points={},
keywords='',
keywords=['FSPM', 'openalea', 'plant', 'MTG', 'Hydraulic Structure', 'gas-exchange', 'energy balance'],
test_suite='nose.collector',
)
# #}
Expand Down
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
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
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
File renamed without changes.
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
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/hydroshoot/io.py → 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
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/hydroshoot/model.py → 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
File renamed without changes.
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
File renamed without changes.
Loading