Skip to content

maps are not subscriptable #55

@keflavich

Description

@keflavich

I get the error:

]Traceback (most recent call last):
  File "<ipython-input-20-e12c0a20cd7b>", line 1, in <module>
    s = scouse.stage_1(config=config_file, interactive=True) # GUI based
  File "/blue/adamginsburg/adamginsburg/repos/scousepy/scousepy/scouse.py", line 377, in stage_1
    generate_SAAs(self, coverageobject)
  File "/blue/adamginsburg/adamginsburg/repos/scousepy/scousepy/stage_1.py", line 169, in generate_SAAs
    SAA=results[j]
TypeError: 'map' object is not subscriptable

in stage 1. This most likely results from this part:

if scouseobject.njobs > 1:
# if __name__ == 'scousepy.stage_1':
# print(__name__)
results = parallel_map(create_saa, inputlist, numcores=scouseobject.njobs)
else:
if scouseobject.verbose:
results=[create_saa(input) for input in tqdm(inputlist)]
else:
results=[create_saa(input) for input in inputlist]
if scouseobject.verbose:
progress_bar = print_to_terminal(stage='s1', step='coverageend', length=len(coverage[:,0]),var=w)
for j in range(len(coverage[:,0])):
SAA=results[j]

in which parallel_map is used. Most likely, we need to do list(parallel_map...) or restructure the loop on line 168-169 to loop over the entries in the map rather than an index.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions