broadinstitute / pe2loaddata

Script to parse a Phenix metadata XML file and generate a .CSV for CellProfiler's loaddata module
BSD 2-Clause "Simplified" License
2 stars 7 forks source link

TypeError: 'NoneType' object is not subscriptable #29

Open kboit opened 2 years ago

kboit commented 2 years ago

I'm using python version 3.9.12 on a MacBook Pro via terminal, but I run into the same issue when I run this on Windows 10 command prompt. I'm trying to use the test images provided in pe2loaddata/tests/data/images folder, but it prints the following: TypeError: 'NoneType' object is not subscriptable. Any help would be appreciated, I'm very new to Python!

mtegtmey@wm06b-74e pe2loaddata % pe2loaddata --index-directory /Users/mtegtmey/Downloads/pe2loaddata/tests/data/images config.yml output.csv              

Traceback (most recent call last):
  File "/Users/mtegtmey/opt/miniconda3/bin/pe2loaddata", line 33, in <module>
    sys.exit(load_entry_point('pe2loaddata', 'console_scripts', 'pe2loaddata')())
  File "/Users/mtegtmey/opt/miniconda3/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/mtegtmey/opt/miniconda3/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/mtegtmey/opt/miniconda3/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/mtegtmey/opt/miniconda3/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/mtegtmey/Downloads/pe2loaddata/src/pe2loaddata/__main__.py", line 246, in main
    headless(
  File "/Users/mtegtmey/Downloads/pe2loaddata/src/pe2loaddata/__main__.py", line 62, in headless
    channels, metadata = transformer.load_config(configuration)
  File "/Users/mtegtmey/Downloads/pe2loaddata/src/pe2loaddata/transformer.py", line 88, in load_config
    channels = config['channels']
TypeError: 'NoneType' object is not `subscriptable
bethac07 commented 2 years ago

Hi,

Are you using the config at the top level of the repository or the one from the tests folder? The images in the test folder need to be used alongside the config in the test folder.

Can you also confirm how you installed - via pip from pypi, cloned and pip installed, etc? Thanks!