sukri12 / pysal

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

Random_Region documentation is not correct #205

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
>>> w = pysal.lat2W(10,10)
>>> t0 = Random_Region(w.id_order, num_regions=10, contiguity=w)
>>> t0 = Random_Region(w.id_order, num_regions=10, contiguity=w, permutations=2)
Traceback (most recent call last):
  File "<ipython-input-60-00b0ed1f3c87>", line 1, in <module>
    t0 = Random_Region(w.id_order, num_regions=10, contiguity=w, permutations=2)
TypeError: __init__() got an unexpected keyword argument 'permutations'

But the documentation says:
>>> random.seed(100)
    >>> np.random.seed(100)
    >>> t3 = pysal.region.Random_Regions(ids, num_regions=nregs, contiguity=w, permutations=2)
    >>> t3.solutions[0].regions[1]
    [71, 72, 70, 93, 51, 91, 85, 74, 63, 73, 61, 62, 82]

so permutations is in the docs, but trying to specify permutations raises an 
error.

Original issue reported on code.google.com by sjsrey on 4 Apr 2012 at 5:08

GoogleCodeExporter commented 8 years ago
Random_Region != Random_Regions

Perhaps this should be made clearer in the docs?

Also is permutations the best name for that attribute. WOuldn't "solutions" be 
a better name?

Original comment by sjsrey on 4 Apr 2012 at 5:45

GoogleCodeExporter commented 8 years ago

Original comment by sjsrey on 13 Jul 2012 at 6:22

GoogleCodeExporter commented 8 years ago

Original comment by sjsrey on 4 Jan 2013 at 6:21