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

input_data_dict should NOT be required to run CellmapsImageDownloader #2

Open
coleslaw481 opened this issue May 19, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@coleslaw481
Copy link
Contributor

  • cellmaps_imagedownloader version: 0.1.0a4
  • Python version: 3.8
  • Operating System: mac

Description

Attempting to invoke CellmapsImageDownloader run() method fails because it expects samples and unique keys with values in input_data_dict parameter in constructor

What I Did

imagegen = ImageGeneNodeAttributeGenerator(
            unique_list=ImageGeneNodeAttributeGenerator.get_unique_list_from_csvfile(<unique APMS csv file>),
            samples_list=ImageGeneNodeAttributeGenerator.get_samples_from_csvfile(<samples APMS csv file>))

CellmapsImageDownloader(outdir='/tmp/foo,
                                       imagedownloader=FakeImageDownloader(),
                                       imagegen=imagegen,
                                       provenance=self._provenance).run()


Above outputs:

2023-05-19 15:34:27,637 ERROR 950ms cellmaps_pipelinecmd.py::main():157 Caught exception: 'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "/Users/churas/anaconda3/envs/python382/bin/cellmaps_pipelinecmd.py", line 153, in main
    return CellmapsPipeline(outdir=theargs.outdir,
  File "/Users/churas/anaconda3/envs/python382/lib/python3.8/site-packages/cellmaps_pipeline/runner.py", line 142, in run
    exit_status = self._runner.run()
  File "/Users/churas/anaconda3/envs/python382/lib/python3.8/site-packages/cellmaps_pipeline/runner.py", line 73, in run
    if self._download_images() != 0:
  File "/Users/churas/anaconda3/envs/python382/lib/python3.8/site-packages/cellmaps_pipeline/runner.py", line 93, in _download_images
    return CellmapsImageDownloader(outdir=self._image_dir,
  File "/Users/churas/anaconda3/envs/python382/lib/python3.8/site-packages/cellmaps_imagedownloader/runner.py", line 606, in run
    self._register_input_datasets()
  File "/Users/churas/anaconda3/envs/python382/lib/python3.8/site-packages/cellmaps_imagedownloader/runner.py", line 403, in _register_input_datasets
    source_file=self._input_data_dict[CellmapsImageDownloader.SAMPLES_FILEKEY],
TypeError: 'NoneType' object is not subscriptable
@coleslaw481 coleslaw481 added the bug Something isn't working label May 19, 2023
@coleslaw481 coleslaw481 changed the title input_data_dict should NOT be required to run `CellmapsImageDownloader input_data_dict should NOT be required to run CellmapsImageDownloader May 19, 2023
@coleslaw481
Copy link
Contributor Author

The code expected input_data_dict to have the path to the input samples and unique files, but a user could create both without having ever input a file.

To handle this the code will write out the samples and the unique list to the output directory in the case where the input_data_dict lacks needed information and then register those files as input datasets. It would be up to the caller to provide adequate provenance for the samples and unique data to FAIRSCAPE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant