Skip to content

Commit

Permalink
Merge pull request openalea-incubator#32 from pradal/conda
Browse files Browse the repository at this point in the history
Conda packaging and CI
  • Loading branch information
pradal authored May 12, 2022
2 parents 31523c0 + 825458a commit 2886d2e
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 20 deletions.
2 changes: 1 addition & 1 deletion conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ test:
- test/data/**
commands:
- cd test
- pytest -v --ignore=test_povray.py
- pytest -v --ignore=test_povray.py --ignore=test_dataflow.py --ignore=test_plantgen.py

about:
home: {{ data.get('url') }}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#from openalea.deploy.metainfo import read_metainfo
pj = os.path.join

version = '2.0.0-dev'
version = '1.9.0'
name = 'alinea.adel'

description= '3D plant simulation of graminae crops'
Expand Down
2 changes: 1 addition & 1 deletion src/alinea/adel/Adel.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Ce fichier : Core Code modèle ADEL(cinetique, ssi...) sous R
# Ce fichier : Core Code modele ADEL(cinetique, ssi...) sous R
#
# Doc input et exemples sont dans docAdel.R
#
Expand Down
6 changes: 3 additions & 3 deletions src/alinea/adel/ArvalisToAdel.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Codage adel simexp
#
#
#A. Utilitaires de generation de tables de parametres ADEL a partir des données arvalis
#A. Utilitaires de generation de tables de parametres ADEL a partir des donnees arvalis
#
#A.1 Generateurs pour le tableau axeTable
#
Expand Down Expand Up @@ -71,7 +71,7 @@ buildgenAxe <- function(axedata, phyl = 110, delreg = 2, dureg = 3,deldisp = 2,p
}
#
#
# A.2 construction d'un generateur de parametre phytomer (dimension + azimuth + shape leaf) a partir de dimensions calées
# A.2 construction d'un generateur de parametre phytomer (dimension + azimuth + shape leaf) a partir de dimensions cal�es
#
buildgenDim <- function(dimF, Rfun,indexes = 1:6) {
dim <- dimF[,c("L","l","Lg","d","Le","d","Phi0","StemRate","StemRate"),]
Expand Down Expand Up @@ -144,7 +144,7 @@ buildgenPhen <- function(phyl=110,nfveg=4.5,nfflo=2.7,nfend=0,dphylflo=5.2,dtten
#
Rfuntest = list(azim=function(a,n,ntop) {0 * runif(1)})
#
# A.4 : generateur de parametres adel a partir des données arvalis
# A.4 : generateur de parametres adel a partir des donn�es arvalis
#
setAdelArv <- function(calage,nplants=1,sdlevee=0,RFun) {
phyl <- calage$phen$PHYL
Expand Down
6 changes: 5 additions & 1 deletion test/test_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@

def leaves_db():
import alinea.adel.fitting as fitting
fn = '../src/alinea/adel/data/simpleleavesdb.json'
from alinea.adel import data
from os.path import join

pth = data.__path__[0]
fn = join(pth,'simpleleavesdb.json')
with open(fn) as f:
leaves = json_np.load(f)
leaves,discard = fitting.fit_leaves(leaves, 9)
Expand Down
24 changes: 12 additions & 12 deletions test/test_leaf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from scipy.interpolate import splev, splprep
import alinea.adel.fitting as fitting
from alinea.adel.data_samples import leaves_db
from openalea.plantgl.all import Viewer
#from openalea.plantgl.all import Viewer
import openalea.plantgl.all as pgl
# nosetetsts fails importing pylab for some mysteriuous reason (backend ?)
with_pylab = True
Expand Down Expand Up @@ -36,14 +36,14 @@ def test1(leaf=leaf, scene = None):
global translation
if scene is None:
scene = pgl.Scene()
Viewer.display(scene)
#Viewer.display(scene)

x, y, s, r= leaf
spline_leaf, leaf_surface = fitting.fit_leaf(x, y, s, r)
mesh = fitting.discretize(spline_leaf,30, 7, 1)

scene += pgl.Translated(translation, mesh)
Viewer.update()
#Viewer.update()

#test1(leaf)
def test2(leaves=leaves):
Expand All @@ -53,7 +53,7 @@ def test2(leaves=leaves):
global translation, yt, zt
translation = pgl.Vector3(0,0,0)
scene= pgl.Scene()
Viewer.display(scene)
#Viewer.display(scene)
for k in leaves:
print("Rank number: ", k)
index = 0
Expand Down Expand Up @@ -87,7 +87,7 @@ def test3(leaf=leaf, scene = None):
scene += pgl.Translated(translation, mesh)
translation.z += zt

Viewer.display(scene)
#Viewer.display(scene)

# def test4(leaves=leaves,rank=rank):
# # try with rank=7
Expand Down Expand Up @@ -129,20 +129,20 @@ def test7(leaf=leaf, scene = None):

if scene is None:
scene = pgl.Scene()
Viewer.display(scene)
#Viewer.display(scene)

x, y, s, r= leaf
spline_leaf, leaf_surface = fitting.fit_leaf(x, y, s, r)
pts, ind = fitting.mesh(spline_leaf,30, 7, 7, 1)
fitting.write_smf('leaf_full.smf', pts, ind)
Viewer.display(fitting.plantgl_shape(pts, ind))
#fitting.write_smf('leaf_full.smf', pts, ind)
#Viewer.display(fitting.plantgl_shape(pts, ind))


def test8(leaf=leaf, scene = None):
global translation, zt
if scene is None:
scene = pgl.Scene()
Viewer.display(scene)
#Viewer.display(scene)

x, y, s, r= leaf
leaf_new, leaf_surface = fitting.fit2(x, y, s, r)
Expand All @@ -159,19 +159,19 @@ def test8(leaf=leaf, scene = None):
scene += pgl.Translated(translation, fitting.plantgl_shape(pts, ind))
#scene += pgl.Translated(translation+(0,yt/3.,0), mesh_final)

Viewer.update()
#Viewer.update()

def test81(leaf=leaf, scene = None):
global translation, yt, zt
if scene is None:
scene = pgl.Scene()
Viewer.display(scene)
#Viewer.display(scene)

mesh = fitting.leaf_shape2(leaf,10, 7, 7, 1)

scene += pgl.Translated(translation+(0,yt/3.,0), mesh)

Viewer.update()
#Viewer.update()

# def test9(leaves=leaves):
# """
Expand Down
6 changes: 5 additions & 1 deletion test/test_mtg.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

def leaves_db():
import alinea.adel.fitting as fitting
fn = '../src/alinea/adel/data/simpleleavesdb.json'
from alinea.adel import data
from os.path import join

pth = data.__path__[0]
fn = join(pth,'simpleleavesdb.json')
with open(fn) as f:
leaves = json_np.load(f)
leaves,discard = fitting.fit_leaves(leaves, 9)
Expand Down

0 comments on commit 2886d2e

Please sign in to comment.