certik / hermescode

Automatically exported from code.google.com/p/hermescode
0 stars 0 forks source link

[PATCH] wrapped element orders into python, and created legend #79

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This patch 
1) adds legend for the element orders
2) gets element orders into python

 python/examples/01.py               |    2 +-
 python/hermes2d/_hermes2d.pxd       |    2 +
 python/hermes2d/_hermes2d.pyx       |   18 ++++++
 python/hermes2d/plot.py             |  103 ++++++++++++++++++++++++++++-------
 python/hermes2d/tests/test_plots.py |   14 +++++
 5 files changed, 119 insertions(+), 20 deletions(-)

Original issue reported on code.google.com by regm...@gmail.com on 22 Sep 2009 at 10:14

Attachments:

GoogleCodeExporter commented 9 years ago
The patch is almost ok!

However, please use the python code style guidelines
(http://python.org/dev/peps/pep-0008/), so:

splitNodes  -> split_nodes
getMax -> get_max
getMin -> get_min

add a space after all commas, but delete a space before ")", e.g.:

p = Rectangle(xy=(maxX + 0.1,y), width=0.1, height=0.1, fill=True, 
facecolor=colors[i] ) 

becomes:

p = Rectangle(xy=(maxX + 0.1, y), width=0.1, height=0.1, fill=True, 
facecolor=colors[i]) 

as to this chunk:

+        
+        #print "Elements: ", len(mesh.elements), "Orders: ",
len(mesh.get_elements_order(space))
+        #print mesh.get_elements_order(space)
+        
+        if space != None:
+            return plot_mesh_mpl_orders(mesh.nodes_dict, mesh.elements,
polynomial_orders=mesh.get_elements_order(space))
+        else:
+            return plot_mesh_mpl_orders(mesh.nodes_dict, mesh.elements)
+            
+        #return plot_mesh_mpl_orders(mesh.nodes_dict, mesh.elements)

please remove the commented out lines.

But otherwise we are almost done -- just edit the files, do "git commit -a 
--amend"
and resend the patch.

Original comment by ondrej.c...@gmail.com on 23 Sep 2009 at 5:01

GoogleCodeExporter commented 9 years ago
Fixed:
1. Bug in legend fixed.
2. Tried to follow guidelines

Original comment by regm...@gmail.com on 24 Sep 2009 at 9:51

Attachments:

GoogleCodeExporter commented 9 years ago
Now it looks good. It's in. Thanks for the contribution!

Original comment by ondrej.c...@gmail.com on 24 Sep 2009 at 10:40