-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #397 from esheldon/empty-slice
FIX empty slice case
- Loading branch information
Showing
5 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
usage. | ||
""" | ||
|
||
__version__ = '1.2.2' | ||
__version__ = '1.2.3' | ||
|
||
from . import fitslib | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import tempfile | ||
import os | ||
import numpy as np | ||
from ..fitslib import write, FITS | ||
|
||
|
||
def test_empty_image_slice(): | ||
|
||
shape = (10, 10) | ||
data = np.arange(shape[0] * shape[1]).reshape(shape) | ||
|
||
with tempfile.TemporaryDirectory() as tmpdir: | ||
fname = os.path.join(tmpdir, 'test.fits') | ||
write(fname, data, clobber=True) | ||
|
||
with FITS(fname) as fits: | ||
assert fits[0][0:0, 0:0].size == 0 | ||
|
||
assert fits[0][0:8, 0:0].size == 0 | ||
|
||
assert fits[0][0:0, 0:8].size == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters