jpeterbaker / maxfield

Code for maximizing the Ingress fields on a given set fo portals
GNU General Public License v3.0
165 stars 56 forks source link

getting ValueError: zero lenght field name in format #11

Closed borachinua closed 10 years ago

borachinua commented 10 years ago

Greetings,

I'm trying to get this running on a CentOS 6 VM and I'm about 90% there. However, I'm running into an issue in the PlanPrinter.py when trying to setup the agent link files.

I've included a bunch of OS/package information and the run attempt below.

Please let me know if you need any more information.

specifics:

Linux python 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2

python-pycurl-7.19.0-8.el6.x86_64 python-iniparse-0.3.1-2.1.el6.noarch python-libs-2.6.6-52.el6.x86_64 python-nose-0.10.4-3.1.el6.noarch python-dateutil-1.4.1-6.el6.noarch python-matplotlib-0.99.1.2-1.el6.x86_64 python-urlgrabber-3.9.1-9.el6.noarch rpm-python-4.8.0-37.el6.x86_64 newt-python-0.52.11-3.el6.x86_64 python-2.6.6-52.el6.x86_64 python-setuptools-0.6.10-3.el6.noarch

numpy and networkx are both installed

Here is the output of the tried run:

[pel@python maxfield-master]$ python makePlan.py 2 vinal.csv out/ vinal.pkl IMPROVEMENT: total: 47 max: 4 weighted: 55 All keys used. Improvement impossible Choosing plan requiring 47 additional keys, max of 4 from single portal Planning agent movements: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 /usr/lib64/python2.6/site-packages/matplotlib/backends/backend_gtk.py:621: DeprecationWarning: Use the new widget gtk.Tooltip self.tooltips = gtk.Tooltips() Traceback (most recent call last): File "makePlan.py", line 206, in PP.agentLinks() File "/home/pel/maxlinks/maxfield-master/lib/PlanPrinter.py", line 328, in agentLinks self.names[q]\ ValueError: zero length field name in format [pel@python maxfield-master]$ [pel@python maxfield-master]$ cd out [pel@python out]$ ls -l total 192 -rw-rw-r--. 1 pel pel 1005 Mar 20 16:43 keyPrep.txt -rw-rw-r--. 1 pel pel 760 Mar 20 16:43 keys_for_agent_1_of_2.txt -rw-rw-r--. 1 pel pel 760 Mar 20 16:43 keys_for_agent_2_of_2.txt -rw-rw-r--. 1 pel pel 114826 Mar 20 16:43 linkMap.png -rw-rw-r--. 1 pel pel 269 Mar 20 16:43 links_for_agent_1_of_2.txt -rw-rw-r--. 1 pel pel 706 Mar 20 16:43 ownershipPrep.txt -rw-rw-r--. 1 pel pel 22808 Mar 20 16:43 portalMap.png -rw-rw-r--. 1 pel pel 29341 Mar 20 16:43 vinal.pkl [pel@python out]$ [pel@python out]$ cat keyPrep.txt Keys Needed | Lacked | 3 | 3 | A Perpetual Flower for Kate 2 | 2 | Allan and Herbert Clark Asiatic Sea 3 | 3 | Anne Mackay Memorial Library 2 | 2 | Bruce N. Freeman Lake 4 | 4 | Chelmsford 5 | 5 | Chelmsford Billerica Gift to Chelmsford 3 | 3 | Chelmsford Highland Park 1 | 1 | Chelmsford Southwell Park 0 | 0 | Hadley Park 2 | 2 | North Chelms Congregational 3 | 3 | North Chelmsford Hardware Est 1946 3 | 3 | North Chelmsford Old Town Hall 0 | 0 | North Chelmsford The Mills 1 | 1 | Riverside Cemetery 2 | 2 | Saint John the Evangelist 2 | 2 | US Post Office Kennedy Drive 2 | 2 | Vietnam Memorial 3 | 3 | Williamsburg Condo Post Office 1 | 1 | Williamsburg at Chelmsford 2 | 2 | statue in Vinal Square [pel@python out]$ cat keys_for_agent_1_of_2.txt Keys for Agent 1 of 2

Map# Keys Name 14 2 A Perpetual Flower for Kate 19 Allan and Herbert Clark Asiatic Sea 12 2 Anne Mackay Memorial Library 10 Bruce N. Freeman Lake 9 4 Chelmsford 6 4 Chelmsford Billerica Gift to Chelmsford 16 2 Chelmsford Highland Park 2 1 Chelmsford Southwell Park 13 Hadley Park 8 North Chelms Congregational 3 1 North Chelmsford Hardware Est 1946 11 2 North Chelmsford Old Town Hall 15 North Chelmsford The Mills 17 Riverside Cemetery 18 1 Saint John the Evangelist 4 1 US Post Office Kennedy Drive 7 2 Vietnam Memorial 1 1 Williamsburg Condo Post Office 0 Williamsburg at Chelmsford 5 1 statue in Vinal Square [pel@python out]$ cat keys_for_agent_2_of_2.txt Keys for Agent 2 of 2

Map# Keys Name 14 1 A Perpetual Flower for Kate 19 2 Allan and Herbert Clark Asiatic Sea 12 1 Anne Mackay Memorial Library 10 2 Bruce N. Freeman Lake 9 Chelmsford 6 1 Chelmsford Billerica Gift to Chelmsford 16 1 Chelmsford Highland Park 2 Chelmsford Southwell Park 13 Hadley Park 8 2 North Chelms Congregational 3 2 North Chelmsford Hardware Est 1946 11 1 North Chelmsford Old Town Hall 15 North Chelmsford The Mills 17 1 Riverside Cemetery 18 1 Saint John the Evangelist 4 1 US Post Office Kennedy Drive 7 Vietnam Memorial 1 2 Williamsburg Condo Post Office 0 1 Williamsburg at Chelmsford 5 1 statue in Vinal Square [pel@python out]$ cat links_for_agent_1_of_2.txt Complete link schedule issued to agent 1 of 2

Total time estimate: 24 minutes

Agent distance: 45 m Agent experience: 29699 AP

Links marked with * can be made EARLY

Link Agent Map# Link Origin

Link Destination

[pel@python out]$ cat ownershipPrep.txt These portals' first links are incoming They should be at full resonators before linking Anne Mackay Memorial Library Bruce N. Freeman Lake Chelmsford Chelmsford Billerica Gift to Chelmsford Chelmsford Highland Park Chelmsford Southwell Park North Chelms Congregational North Chelmsford Hardware Est 1946 North Chelmsford Old Town Hall Riverside Cemetery Saint John the Evangelist US Post Office Kennedy Drive Vietnam Memorial Williamsburg Condo Post Office Williamsburg at Chelmsford statue in Vinal Square

These portals' first links are outgoing Their resonators can be applied when first agent arrives A Perpetual Flower for Kate Allan and Herbert Clark Asiatic Sea [pel@python out]$

my CSV looks like this:

[pel@python maxfield-master]$ cat vinal.csv Allan and Herbert Clark Asiatic Sea,426346,-713979 Bruce N. Freeman Lake,426380,-713914 Williamsburg Condo Post Office,426460,-713899 Williamsburg at Chelmsford,426466,-713893 Chelmsford Southwell Park,426414,-713801 US Post Office Kennedy Drive,426390,-713804 North Chelmsford Hardware Est 1946,426397,-713840 Anne Mackay Memorial Library,426372,-713838 statue in Vinal Square,426387,-713824 Chelmsford Billerica Gift to Chelmsford,426386,-713819 North Chelms Congregational,426382,-713823 Chelmsford,426382,-713818 Vietnam Memorial,426385,-713816 North Chelmsford Old Town Hall,426375,-713815 North Chelmsford The Mills,426360,-713798 Chelmsford Highland Park,426360,-713798 Saint John the Evangelist,426357,-713732 Riverside Cemetery,426358,-713718 A Perpetual Flower for Kate,426363,-713713 Hadley Park,426363,-713713 [pel@python maxfield-master]$

jpeterbaker commented 10 years ago

Looks like a difference in the string format() function in Python 2.6. If you are able, try it with 2.7. I will work making it 2.6-compatible.

On Thu, Mar 20, 2014 at 3:45 PM, borachinua notifications@github.comwrote:

Greetings,

I'm trying to get this running on a CentOS 6 VM and I'm about 90% there. However, I'm running into an issue in the PlanPrinter.py when trying to setup the agent link files.

I've included a bunch of OS/package information and the run attempt below.

Please let me know if you need any more information.

specifics:

Linux python 2.6.32-431.el6.x86_64 #1https://github.com/jpeterbaker/maxfield/pull/1SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2

python-pycurl-7.19.0-8.el6.x86_64 python-iniparse-0.3.1-2.1.el6.noarch python-libs-2.6.6-52.el6.x86_64 python-nose-0.10.4-3.1.el6.noarch python-dateutil-1.4.1-6.el6.noarch python-matplotlib-0.99.1.2-1.el6.x86_64 python-urlgrabber-3.9.1-9.el6.noarch rpm-python-4.8.0-37.el6.x86_64 newt-python-0.52.11-3.el6.x86_64 python-2.6.6-52.el6.x86_64 python-setuptools-0.6.10-3.el6.noarch

numpy and networkx are both installed

Here is the output of the tried run:

[pel@python maxfield-master]$ python makePlan.py 2 vinal.csv out/ vinal.pkl IMPROVEMENT: total: 47 max: 4 weighted: 55 All keys used. Improvement impossible Choosing plan requiring 47 additional keys, max of 4 from single portal Planning agent movements: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 /usr/lib64/python2.6/site-packages/matplotlib/backends/backend_gtk.py:621: DeprecationWarning: Use the new widget gtk.Tooltip self.tooltips = gtk.Tooltips() Traceback (most recent call last): File "makePlan.py", line 206, in PP.agentLinks() File "/home/pel/maxlinks/maxfield-master/lib/PlanPrinter.py", line 328, in agentLinks self.names[q]\ ValueError: zero length field name in format [pel@python maxfield-master]$ [pel@python maxfield-master]$ cd out [pel@python out]$ ls -l total 192 -rw-rw-r--. 1 pel pel 1005 Mar 20 16:43 keyPrep.txt -rw-rw-r--. 1 pel pel 760 Mar 20 16:43 keys_for_agent_1_of_2.txt -rw-rw-r--. 1 pel pel 760 Mar 20 16:43 keys_for_agent_2_of_2.txt -rw-rw-r--. 1 pel pel 114826 Mar 20 16:43 linkMap.png -rw-rw-r--. 1 pel pel 269 Mar 20 16:43 links_for_agent_1_of_2.txt -rw-rw-r--. 1 pel pel 706 Mar 20 16:43 ownershipPrep.txt -rw-rw-r--. 1 pel pel 22808 Mar 20 16:43 portalMap.png -rw-rw-r--. 1 pel pel 29341 Mar 20 16:43 vinal.pkl [pel@python out]$ [pel@python out]$ cat keyPrep.txt Keys Needed | Lacked | 3 | 3 | A Perpetual Flower for Kate 2 | 2 | Allan and Herbert Clark Asiatic Sea 3 | 3 | Anne Mackay Memorial Library 2 | 2 | Bruce N. Freeman Lake 4 | 4 | Chelmsford 5 | 5 | Chelmsford Billerica Gift to Chelmsford 3 | 3 | Chelmsford Highland Park 1 | 1 | Chelmsford Southwell Park 0 | 0 | Hadley Park 2 | 2 | North Chelms Congregational 3 | 3 | North Chelmsford Hardware Est 1946 3 | 3 | North Chelmsford Old Town Hall 0 | 0 | North Chelmsford The Mills 1 | 1 | Riverside Cemetery 2 | 2 | Saint John the Evangelist 2 | 2 | US Post Office Kennedy Drive 2 | 2 | Vietnam Memorial 3 | 3 | Williamsburg Condo Post Office 1 | 1 | Williamsburg at Chelmsford 2 | 2 | statue in Vinal Square [pel@python out]$ cat keys_for_agent_1_of_2.txt Keys for Agent 1 of 2

Map# Keys Name 14 2 A Perpetual Flower for Kate 19 Allan and Herbert Clark Asiatic Sea 12 2 Anne Mackay Memorial Library 10 Bruce N. Freeman Lake 9 4 Chelmsford 6 4 Chelmsford Billerica Gift to Chelmsford 16 2 Chelmsford Highland Park 2 1 Chelmsford Southwell Park 13 Hadley Park 8 North Chelms Congregational 3 1 North Chelmsford Hardware Est 1946 11 2 North Chelmsford Old Town Hall 15 North Chelmsford The Mills 17 Riverside Cemetery 18 1 Saint John the Evangelist 4 1 US Post Office Kennedy Drive 7 2 Vietnam Memorial 1 1 Williamsburg Condo Post Office 0 Williamsburg at Chelmsford 5 1 statue in Vinal Square [pel@python out]$ cat keys_for_agent_2_of_2.txt Keys for Agent 2 of 2

Map# Keys Name 14 1 A Perpetual Flower for Kate 19 2 Allan and Herbert Clark Asiatic Sea 12 1 Anne Mackay Memorial Library 10 2 Bruce N. Freeman Lake 9 Chelmsford 6 1 Chelmsford Billerica Gift to Chelmsford 16 1 Chelmsford Highland Park 2 Chelmsford Southwell Park 13 Hadley Park 8 2 North Chelms Congregational 3 2 North Chelmsford Hardware Est 1946 11 1 North Chelmsford Old Town Hall 15 North Chelmsford The Mills 17 1 Riverside Cemetery 18 1 Saint John the Evangelist 4 1 US Post Office Kennedy Drive 7 Vietnam Memorial 1 2 Williamsburg Condo Post Office 0 1 Williamsburg at Chelmsford 5 1 statue in Vinal Square [pel@python out]$ cat links_for_agent_1_of_2.txt Complete link schedule issued to agent 1 of 2

Total time estimate: 24 minutes

Agent distance: 45 m Agent experience: 29699 AP

Links marked with * can be made EARLY

Link Agent Map# Link Origin Link Destination

[pel@python out]$ cat ownershipPrep.txt These portals' first links are incoming They should be at full resonators before linking Anne Mackay Memorial Library Bruce N. Freeman Lake Chelmsford Chelmsford Billerica Gift to Chelmsford Chelmsford Highland Park Chelmsford Southwell Park North Chelms Congregational North Chelmsford Hardware Est 1946 North Chelmsford Old Town Hall Riverside Cemetery Saint John the Evangelist US Post Office Kennedy Drive Vietnam Memorial Williamsburg Condo Post Office Williamsburg at Chelmsford statue in Vinal Square

These portals' first links are outgoing Their resonators can be applied when first agent arrives A Perpetual Flower for Kate Allan and Herbert Clark Asiatic Sea [pel@python out]$

my CSV looks like this:

[pel@python maxfield-master]$ cat vinal.csv Allan and Herbert Clark Asiatic Sea,426346,-713979 Bruce N. Freeman Lake,426380,-713914 Williamsburg Condo Post Office,426460,-713899 Williamsburg at Chelmsford,426466,-713893 Chelmsford Southwell Park,426414,-713801 US Post Office Kennedy Drive,426390,-713804 North Chelmsford Hardware Est 1946,426397,-713840 Anne Mackay Memorial Library,426372,-713838 statue in Vinal Square,426387,-713824 Chelmsford Billerica Gift to Chelmsford,426386,-713819 North Chelms Congregational,426382,-713823 Chelmsford,426382,-713818 Vietnam Memorial,426385,-713816 North Chelmsford Old Town Hall,426375,-713815 North Chelmsford The Mills,426360,-713798 Chelmsford Highland Park,426360,-713798 Saint John the Evangelist,426357,-713732 Riverside Cemetery,426358,-713718 A Perpetual Flower for Kate,426363,-713713 Hadley Park,426363,-713713 [pel@python maxfield-master]$

Reply to this email directly or view it on GitHubhttps://github.com/jpeterbaker/maxfield/issues/11 .

borachinua commented 10 years ago

Greetings, I got python 2.7 installed on a centos 6 server and was able to run the application. works perfect.

getting it installed on centos 6 was a bit of a pain as "yum" is tied to python 2.6 so I could not touch that. this was the procedure I used to install python 2.7 under an alternate location. I then modified my path to have "/opt/python/bin" to be first: export PATH=/opt/python/bin:$PATH

This is all done as the root user: cd /opt mkdir python yum -y groupinstall "Development tools" yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel freetype.x86_64 freetype.i686 freetype-devel.x86_64 freetype-devel.i686 libpng-devel.i686 libpng-devel.x86_64 yum install wget wget --no-check-certificate https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz tar xf Python-2.7.6.tar.xz cd Python-2.7.6 ./configure --prefix=/opt/python make && make altinstall cd /opt/python/ cd bin ln -s python2.7 python wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py /opt/python/bin/python ez_setup.py /opt/python/bin/pip install networkx /opt/python/bin/pip install numpy /opt/python/bin/pip install matplotlib