Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix documentation #17

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
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
10 changes: 8 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
platform:
#- x86
- x64

environment:
matrix:
- CONDA_RECIPE: conda
CONDA_VERSION: 2
CONDA_VERSION: 3
CONDA_PY: 37
- CONDA_RECIPE: conda
CONDA_VERSION: 3
CONDA_PY: 38
CONDA_NPY: 116

install:
- git clone https://github.com/OpenAlea/appveyor-ci.git
- cd appveyor-ci
- call install.bat
- conda config --prepend channels conda-forge
- conda config --prepend channels fredboudon

before_build:
- call before_build.bat
Expand Down
6 changes: 3 additions & 3 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set version = "2.0.1" %}
{% set version = "2.0.2" %}

package:
name: openalea.mtg
Expand All @@ -9,7 +9,7 @@ source:

build:
preserve_egg_dir: True
number: 1
number: 0
script: python setup.py install

requirements:
Expand All @@ -19,7 +19,7 @@ requirements:
run:
- python
- openalea.deploy
- openalea.core
# - openalea.core
- numpy
- matplotlib
- pandas
Expand Down
6 changes: 3 additions & 3 deletions doc/user/quick_start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ information about the MTG and DRF syntax. Note that the following code should be
:linenos:

from openalea.mtg.aml import MTG
from openalea.mtg.dresser import dressing_data_from_file
from openalea.mtg.plantframe import PlantFrame, compute_axes, build_scene
from openalea.mtg.plantframe.dresser import dressing_data_from_file
from openalea.mtg.plantframe.plantframe import PlantFrame, compute_axes, build_scene
g = MTG('agraf.mtg')
dressing_data = dressing_data_from_file('agraf.drf')
topdia = lambda x: g.property('TopDia').get(x)
pf = PlantFrame(g, TopDiameter=topdia, DressingData = dressing_data)
axes = compute_axes(g, 3, pf.points, pf.origin)
diameters = pf.algo_diameter()
scene = build_scene(pf.g, pf.origin, axes, pf.points, diameters, 10000)
from vplants.plantgl.all import Viewer
from openalea.plantgl.all import Viewer
Viewer.display(scene)

.. figure:: fig3_5_bis.png
Expand Down
2 changes: 1 addition & 1 deletion doc/user/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ They will return an iterator on the traversed vertices.
.. code-block:: python
:linenos:

from openalea.container.traversal.tree import *
from openalea.mtg.traversal import *

print list(g.components(root))

Expand Down
24 changes: 0 additions & 24 deletions setup.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
# #}
# change setup_kwds below before the next pkglts tag

setup_kwds['share_dirs'] = {'share': 'share'}
# setup_kwds['share_dirs'] = {'share': 'share'}

setup_kwds['entry_points']["wralea"] = ["mtg = openalea.mtg_wralea"]
setup_kwds['setup_requires'] = ['openalea.deploy']
Expand Down
4 changes: 2 additions & 2 deletions src/openalea/mtg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
__version__ = version.__version__

# #}
from mtg import *
from .mtg import *

try:
from plantframe import turtle, frame, plantframe, dresser
from .plantframe import turtle, frame, plantframe, dresser

DressingData = dresser.DressingData
PlantFrame = plantframe.PlantFrame
Expand Down
14 changes: 7 additions & 7 deletions src/openalea/mtg/algo.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

__docformat__ = "restructuredtext"

import traversal
from . import traversal

try:
from tree import InvalidVertex
from .tree import InvalidVertex
except ImportError:
from openalea.container.tree import InvalidVertex

Expand Down Expand Up @@ -146,7 +146,7 @@ def father(g, vid, scale=-1, **kwds):
vid = g.complex_at_scale(vid)
p = g.parent(vid)
else:
vid = g.component_roots_at_scale_iter(vid, scale=scale).next()
vid = next(g.component_roots_at_scale_iter(vid, scale=scale))
p = g.parent(vid)

if et != '*':
Expand Down Expand Up @@ -248,7 +248,7 @@ def sons(g, vid, **kwds):
if scale < current_scale:
vid = g.complex_at_scale(vid, scale = scale)
elif scale > current_scale:
vid = g.component_roots_at_scale_iter(vid, scale=scale).next()
vid = next(g.component_roots_at_scale_iter(vid, scale=scale))
children = g.children_iter(vid)

if et != '*':
Expand Down Expand Up @@ -399,7 +399,7 @@ def vertex_at_scale(g, vtx_id, scale):
if scale < current_scale:
vtx_id = g.complex_at_scale(vtx_id, scale=scale)
elif scale > current_scale:
vtx_id = g.component_roots_at_scale_iter(vtx_id, scale=scale).next()
vtx_id = next(g.component_roots_at_scale_iter(vtx_id, scale=scale))
return vtx_id

def trunk(g, vtx_id, scale=-1, **kwds):
Expand Down Expand Up @@ -441,9 +441,9 @@ def union(g1, g2, vid1=None, vid2=None, edge_type='<'):
subtree = traversal.iter_mtg2(g2, v2)
if v1 is g1.root and v2 is g2.root:
treeid_id[v2] = v1
subtree.next()
next(subtree)
else:
v2 = subtree.next()
v2 = next(subtree)
v = g.add_child(v1)
treeid_id[v2] = v
g._add_vertex_properties(v,g2.get_vertex_property(v2))
Expand Down
6 changes: 3 additions & 3 deletions src/openalea/mtg/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def colormap(g, property_name, cmap='jet',lognorm=True):
"""
prop = g.property(property_name)

keys = prop.keys()
v = np.array(prop.values())
keys = list(prop.keys())
v = np.array(list(prop.values()))

_cmap = cm.get_cmap(cmap)
norm = Normalize() if not lognorm else LogNorm()
Expand All @@ -22,6 +22,6 @@ def colormap(g, property_name, cmap='jet',lognorm=True):
colors = (_cmap(values)[:,0:3])*255
colors = np.array(colors,dtype=np.int).tolist()

g.properties()['color'] = dict(zip(keys,colors))
g.properties()['color'] = dict(list(zip(keys,colors)))
return g

4 changes: 2 additions & 2 deletions src/openalea/mtg/draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ def draw_mtg_labels(G, pos,
verticalalignment=kwds.get('verticalalignment','center')

text_items={} # there is no text collection so we'll fake one
for n, label in labels.items():
for n, label in list(labels.items()):
(x,y)=pos[n]
if not cb.is_string_like(label):
label=str(label) # this will cause "1" and 1 to be labeled the same
Expand Down Expand Up @@ -834,7 +834,7 @@ def draw_mtg_edge_labels(G, pos,
else:
labels = edge_labels
text_items={}
for (n1,n2), label in labels.items():
for (n1,n2), label in list(labels.items()):
(x1,y1)=pos[n1]
(x2,y2)=pos[n2]
(x,y) = (x1 * label_pos + x2 * (1.0 - label_pos),
Expand Down
4 changes: 2 additions & 2 deletions src/openalea/mtg/gui/mtg_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def notify_position(self, pos):
self.notify_listeners(("metadata_changed", "position", pos))

def notify_update(self, **kwargs):
for item in kwargs.iteritems():
for item in kwargs.items():
self.notify_listeners(item)

pos = self.g().node(self.vid).position
Expand Down Expand Up @@ -375,7 +375,7 @@ def initialise_graph_view_from_model(graphView, graphModel):
"""
g = graphModel.graph
gm = graphModel
print g, gm
print(g, gm)
for v in g:
if v is not g.root:
gm.notify_listeners(("vertex_added", ("vertex", gm.vid2obj(v))))
Expand Down
Loading