Skip to content

Creating an ImageFileCollection with filenames set will create an empty collection #661

@york-stsci

Description

@york-stsci

If I create a list of FITS files, and then create an ImageFileCollection with filenames set to that list, the created collection ends up being empty. For example,

my_files = glob.glob("/path/to/directory/*.fits")
my_collection = ImageFileCollection(filenames=my_files)

the resulting collection is empty. However, if I instead do:

my_files = glob.glob("/path/to/directory/*.fits")
my_collection = ImageFileCollection(filenames=my_files, location="something_completely_random")

then I get a collection made up of everything in filenames (as long as location is not None). Looking at the init function, it seems that it only checks the value of filenames if location isn't None. Shouldn't it check filenames for a list of files regardless?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions