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

Add check for empty IFC in filtering #801

Merged
merged 2 commits into from
May 30, 2023
Merged

Conversation

tbowers7
Copy link
Contributor

The files_filtered() method chokes on a 'NoneType' object is not subscriptable error if the ImageFileCollection is already empty before being asked to filter further.

This commit adds a check for an empty IFC and simply passes an empty list for the set of files in the collection.

modified:   CHANGES.rst
modified:   ccdproc/image_collection.py

Please have a look at the following list and replace the "[ ]" with a "[x]" if
the answer to this question is yes.

  • For new contributors: Did you add yourself to the "Authors.rst" file?

For documentation changes:

  • For documentation changes: Does your commit message include a "[skip ci]"?
    Note that it should not if you changed any examples!

For bugfixes:

  • Did you add an entry to the "Changes.rst" file?
  • Did you add a regression test?
  • Does the commit message include a "Fixes #issue_number" (replace "issue_number").
  • Does this PR add, rename, move or remove any existing functions or parameters?

For new functionality:

  • Did you add an entry to the "Changes.rst" file?
  • Did you include a meaningful docstring with Parameters, Returns and Examples?
  • Does the commit message include a "Fixes #issue_number" (replace "issue_number").
  • Did you include tests for the new functionality?
  • Does this PR add, rename, move or remove any existing functions or parameters?

Please note that the last point is not a requirement. It is meant as a check if
the pull request potentially breaks backwards-compatibility.


The ``files_filtered()`` method chokes on a ``'NoneType' object is not
subscriptable`` error if the ImageFileCollection is already empty before being
asked to filter further.

This commit adds a check for empty IFC and simply passes an empty list for the
set of files in the collection.

	modified:   CHANGES.rst
	modified:   ccdproc/image_collection.py
@mwcraig
Copy link
Member

mwcraig commented May 30, 2023

CLosing/reopening to re-run CI

@mwcraig mwcraig closed this May 30, 2023
@mwcraig mwcraig reopened this May 30, 2023
@codecov
Copy link

codecov bot commented May 30, 2023

Codecov Report

Merging #801 (b02f2e1) into main (623162d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #801   +/-   ##
=======================================
  Coverage   97.55%   97.55%           
=======================================
  Files           9        9           
  Lines        1390     1392    +2     
=======================================
+ Hits         1356     1358    +2     
  Misses         34       34           
Impacted Files Coverage Δ
ccdproc/image_collection.py 99.20% <100.00%> (+<0.01%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mwcraig mwcraig added this to the 2.4.1 milestone May 30, 2023
@mwcraig mwcraig added the bug label May 30, 2023
@mwcraig mwcraig merged commit dd21411 into astropy:main May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants