-
Notifications
You must be signed in to change notification settings - Fork 0
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
Crash when number of parliamentary seats greater than state seats #1
Comments
I keyed in the data field of 123/00/04 as follows: |
It looks like the plugin is unable to handle the scenario where the number of parliamentary seats is greater than the number of state seats. |
Sean, The interim solution is to allow the no. of DUN to equal the PAR. This was Eg Set PBT 1 as PAR 1, DUN 1. PBT 2 as PAR 2, DUN 2. Regards, PY Wong On Wed, Sep 23, 2015 at 11:34 PM, Sean Lin [email protected] wrote:
|
The basic distribution of seats is that 2 to 4 state seats, = 1 parliament seat. Rgds Sent using CloudMagic Email The interim solution is to allow the no. of DUN to equal the PAR. This was Eg Set PBT 1 as PAR 1, DUN 1. PBT 2 as PAR 2, DUN 2. Regards, PY Wong On Wed, Sep 23, 2015 at 11:34 PM, Sean Lin [email protected] wrote:
|
Yes. That was the normal assumption. Kuala Lumpur was an edge case that was not taken into account. |
Python errors:
An error has occured while executing Python code:
Traceback (most recent call last):
File "C:/Users/user/.qgis2/python/plugins\Redistricting\redistricting_dock.py", line 297, in live_show
self.lb_recommendation.setText(balancer.recommendation_by_par(str(current_par)))
File "C:/Users/user/.qgis2/python/plugins\Redistricting\balancer.py", line 378, in recommendation_by_par
dun_size_with_min_seats = float(voters_par) / seats_state_min
ZeroDivisionError: float division by zero
Python version:
2.7.4 (default, Apr 6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]
QGIS version:
2.6.1-Brighton Brighton, e2a51df
Python path: ['C:/PROGRA
2/QGISBR1/apps/qgis/./python/plugins\processing', 'C:/Program Files (x86)/JetBrains/PyCharm 3.4.1/pycharm-debug.egg', 'C:/PROGRA2/QGISBR1/apps/qgis/./python', u'C:/Users/user/.qgis2/python', u'C:/Users/user/.qgis2/python/plugins', 'C:/PROGRA2/QGISBR1/apps/qgis/./python/plugins', 'C:\PROGRA2\QGISBR1\bin\python27.zip', 'C:\PROGRA2\QGISBR1\apps\Python27\DLLs', 'C:\PROGRA2\QGISBR1\apps\Python27\lib', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\plat-win', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\lib-tk', 'C:\PROGRA2\QGISBR1\bin', 'C:\PROGRA2\QGISBR1\apps\Python27', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\PIL', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win32.egg', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\python_dateutil-2.2-py2.7.egg', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\pytz-2014.2-py2.7.egg', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\win32', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\win32\lib', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\Pythonwin', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win32.egg', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\six-1.6.1-py2.7.egg', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\wx-2.8-msw-unicode', 'C:\Users\user.qgis2\python\plugins\MetaSearch\ext-libs', 'C:/Users/user/.qgis2/python/plugins\Redistricting\packages', 'C:\PROGRA2\QGISBR1\apps\qgis\python\plugins\fTools\tools', 'C:/Users/user/Desktop/QGIS Training/09 KL']When I select new map:
An error has occured while executing Python code:
Traceback (most recent call last):
File "C:/Users/user/.qgis2/python/plugins\Redistricting\redistricting_dock.py", line 297, in live_show
self.lb_recommendation.setText(balancer.recommendation_by_par(str(current_par)))
File "C:/Users/user/.qgis2/python/plugins\Redistricting\balancer.py", line 378, in recommendation_by_par
dun_size_with_min_seats = float(voters_par) / seats_state_min
ZeroDivisionError: float division by zero
Python version:
2.7.4 (default, Apr 6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]
QGIS version:
2.6.1-Brighton Brighton, e2a51df
Python path: ['C:/PROGRA
2/QGISBR1/apps/qgis/./python/plugins\processing', 'C:/Program Files (x86)/JetBrains/PyCharm 3.4.1/pycharm-debug.egg', 'C:/PROGRA2/QGISBR1/apps/qgis/./python', u'C:/Users/user/.qgis2/python', u'C:/Users/user/.qgis2/python/plugins', 'C:/PROGRA2/QGISBR1/apps/qgis/./python/plugins', 'C:\PROGRA2\QGISBR1\bin\python27.zip', 'C:\PROGRA2\QGISBR1\apps\Python27\DLLs', 'C:\PROGRA2\QGISBR1\apps\Python27\lib', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\plat-win', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\lib-tk', 'C:\PROGRA2\QGISBR1\bin', 'C:\PROGRA2\QGISBR1\apps\Python27', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\PIL', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win32.egg', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\python_dateutil-2.2-py2.7.egg', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\pytz-2014.2-py2.7.egg', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\win32', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\win32\lib', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\Pythonwin', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win32.egg', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\six-1.6.1-py2.7.egg', 'C:\PROGRA2\QGISBR1\apps\Python27\lib\site-packages\wx-2.8-msw-unicode', 'C:\Users\user.qgis2\python\plugins\MetaSearch\ext-libs', 'C:/Users/user/.qgis2/python/plugins\Redistricting\packages', 'C:\PROGRA2\QGISBR1\apps\qgis\python\plugins\fTools\tools', 'C:/Users/user/Desktop/QGIS Training/09 KL']The text was updated successfully, but these errors were encountered: