Skip to content

Commit

Permalink
Update openalea dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jvail committed Sep 3, 2023
1 parent 141b849 commit 39ecbeb
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]
python-version: ["3.10"]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ A refactored implementation and maintenance release of MAppleT. Original sources
A local conda/miniconda installation is required.
First clone/download the repository. The `mamba` install is optional but recommended.

**Note**: Due to an unresolved [issue](https://github.com/fredboudon/lpy/issues/41) with Python>3.9 and L-Py dependencies (numpy, boost) only Python 3.9 is supported.

#### Install mamba

```sh
Expand Down
22 changes: 11 additions & 11 deletions binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ channels:
- fredboudon
- conda-forge
dependencies:
- python=3.9
- python=3.10
- jupyterlab=4.0
- jupyterlab_widgets=3.0
- ipywidgets=8.0
- toml=0.10
- matplotlib=3.7
- scipy=1.10
- boost=1.74
- boost-cpp=1.74
- toml
- matplotlib
- scipy
- boost
- boost-cpp
- cppyy=2.4
- openalea.lpy
- openalea.plantgl=3.14
- openalea.mtg=2.0
- xlrd=2.0
- pip=23.0
- numpy=1.20
- openalea.plantgl=3.20.1
- openalea.mtg
- xlrd
- pip
- numpy
- flake8
- mypy
- black
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ authors = [
]
description = "Apple Tree simulation using Markov Chains based on MAppleT"
readme = "README.md"
requires-python = "~=3.9.0"
requires-python = "~=3.10.0"

[tool.setuptools]
packages = ["vmapplet"]
14 changes: 9 additions & 5 deletions vmapplet/optimisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@

from .frame import Frame

rotate = cppyy.gbl.optimization.rotate
second_moment_of_area_annular_section = (
cppyy.gbl.optimization.second_moment_of_area_annular_section
)
second_moment_of_area_circle = cppyy.gbl.optimization.second_moment_of_area_circle
get_new_radius = cppyy.gbl.optimization.get_new_radius
# _reaction_wood_target = cppyy.gbl.optimization.reaction_wood_target


def rotate(v3x: float, v3y: float, v3z: float, angle: float, vx: float, vy: float, vz: float):
# pgl can not handle the vector: wrap in list
return list(cppyy.gbl.optimization.rotate(v3x, v3y, v3z, angle, vx, vy, vz))

import openalea.plantgl.all as pgl


Expand All @@ -25,7 +29,7 @@ def reorient_frame(initial_hlu, rotation_velocity, rv_norm, length):
# vl is replaced by rv_norm

if fabs(rv_norm * length) >= 0.01:
h = pgl.Vector3(
h = pgl.Vector3(list(
rotate(
rotation_velocity.x,
rotation_velocity.y,
Expand All @@ -35,8 +39,8 @@ def reorient_frame(initial_hlu, rotation_velocity, rv_norm, length):
h.y,
h.z,
)
)
l = pgl.Vector3(
))
l = pgl.Vector3(list(
rotate(
rotation_velocity.x,
rotation_velocity.y,
Expand All @@ -46,7 +50,7 @@ def reorient_frame(initial_hlu, rotation_velocity, rv_norm, length):
l.y,
l.z,
)
)
))
h.normalize()
l.normalize()
return Frame(h, l, pgl.cross(h, l))
Expand Down

0 comments on commit 39ecbeb

Please sign in to comment.