Lattice v. Armature Scripting

I initially posted about this problem in the Blender Newbies Forums, but it’s not looking like I’m going to find an answer there, so I thought I would give it a shot here:

I started fiddling with Blender about a month ago and am now trying to do some scripting. The situation is thus:
I have a cylinder that needs to be deformed to show standing waves based on data that I will eventually import. My first step was to figure out whether to use a lattice or an armature. I’ve gone for lattice, since it allows me to keep the end points of my cylinder constant and when I looked at the PythonDoc for armature and lattice, it looks like it is much easier to create new lattice points as well as set lattice point positions than it is to create bones and set hinge positions. Or maybe I’m too much of a newbie to understand where bone positions, etc. are hidden in the doc. I reduce the lattice to a line within the cylinder, so that in my script I only need to call and adjust one vertex. The flaw with scripting with the lattice is that when I want to create a new lattice and set partitions (lattice.setPartitions(x,y,z)), it turns out that x,y,z may not be set to 1. However, in the GUI, it is possible to set x,y,z to 1.

Thus the question:
How can one set two of the partitions of lattice to 1 via scripting? This is possible via GUI, so it would seem very strange for it to be impossible via scripting… :confused:
Any other advice is also very much welcome.

Thanks!