Skip to content
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

IndexError #32

Open
KJFreakish opened this issue Aug 11, 2016 · 5 comments
Open

IndexError #32

KJFreakish opened this issue Aug 11, 2016 · 5 comments

Comments

@KJFreakish
Copy link

KJFreakish commented Aug 11, 2016

I can't seem to get past this IndexError, or find a solution for it. It happens if I run check.py or spawn.py.

$ python spawn.py Traceback (most recent call last): File "spawn.py", line 250, in <module> main() File "spawn.py", line 150, in main tscans = genwork() File "spawn.py", line 104, in genwork dlng = dlat / math.cos(math.radians((rect[0]+rect[2])*0.5)) IndexError: list index out of range
--edit--

I should add that I'm also running the latest version.

@TBTerra
Copy link
Owner

TBTerra commented Aug 11, 2016

looks like an error in the work part of your config, could i see it

@jatinhariani
Copy link

Got something similar:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "spawn.py", line 143, in worker
    print 'worker {} is doing {} pass'.format(wid,num2words[6])
IndexError: list index out of range

Traceback (most recent call last):
  File "spawn.py", line 250, in <module>
    main()
  File "spawn.py", line 193, in main
    t.join()
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 940, in join
    self.__block.wait()
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 340, in wait
    waiter.acquire()
KeyboardInterrupt

Happens only on spawn.py for me.

config.json:

{
    "auth_service": "ptc",
    "users":[
//removed
    ],
    "work":[
        [19.11649, 72.89421, 19.10919, 72.90039]
    ],
    "stepsPerPassPerWorker": 50,
    "scanDelay": 10.2
}

@TBTerra
Copy link
Owner

TBTerra commented Aug 11, 2016

@jatinhariani that bug is from an older version and is fixed now

@KJFreakish most likely issue is that your entries in work are not 4 values, (for a rectangle) so when it asks for value 3, it cant get it because it doesnt exist

@KJFreakish
Copy link
Author

KJFreakish commented Aug 11, 2016

@TBTerra

I'm on my phone right now, but managed to get my configuration.

{
"auth_service": "ptc",
"users":[
{"username": "removed1", "password": "removed0"},
{"username": "removed2", "password": "removed0"},
{"username": "removed3", "password": "removed0"},
{"username": "removed4", "password": "removed0"},
{"username": "removed5", "password": "removed0"},
{"username": "removed6", "password": "removed0"},
{"username": "removed7", "password": "removed0"},
{"username": "removed8", "password": "removed0"},
{"username": "removed9", "password": "removed0"},
{"username": "removed10", "password": "removed0"},
{"username": "removed11", "password": "removed0"},
{"username": "removed12", "password": "removed0"},
{"username": "removed13", "password": "removed0"},
{"username": "removed14", "password": "removed0"},
{"username": "removed15", "password": "removed0"},
{"username": "removed16", "password": "removed0"},
{"username": "removed17", "password": "removed0"},
{"username": "removed18", "password": "removed0"},
{"username": "removed19", "password": "removed0"},
{"username": "removed20", "password": "removed0"}

],
"work":[
    [50.513487, -104.709747],
    [50.394357, -104.520233]
],
"stepsPerPassPerWorker": 50,
"scanDelay": 10.2

}

--edit--

I got it working by looking at the users config above. Turns out I misunderstood the config file, and had brackets that I didn't need.

@TBTerra
Copy link
Owner

TBTerra commented Aug 12, 2016

your work consists of two points, what the code is looking for is a rectange, change it to

[50.513487, -104.709747, 50.394357, -104.520233]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants