Skip to content

Commit

Permalink
Merge pull request #341 from esheldon/release
Browse files Browse the repository at this point in the history
Prepare for release 1.1.6
  • Loading branch information
esheldon authored Dec 15, 2021
2 parents 7e0293e + 4bf1117 commit 979fb83
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 33 deletions.
9 changes: 9 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
version 1.1.6
-------------

Bug Fixes

- fixed bug where Updating an existing record in an image header raises an
exception (user ussegliog)
- fix bug append not forwarding arguments to write (Nicolas Tessore)

version 1.1.5
---------------------------------

Expand Down
2 changes: 1 addition & 1 deletion fitsio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
usage.
"""

__version__ = '1.1.5'
__version__ = '1.1.6'

from . import fitslib

Expand Down
57 changes: 30 additions & 27 deletions fitsio/fitslib.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,13 @@ def read_scamp_head(fname, header=None):
with open(fname) as fobj:
lines = fobj.readlines()

lines = [l.strip() for l in lines if l[0:3] != 'END']
lines = [line.strip() for line in lines if line[0:3] != 'END']

# if header is None an empty FITSHDR is created
hdr = FITSHDR(header)

for l in lines:
hdr.add_record(l)
for line in lines:
hdr.add_record(line)

return hdr

Expand Down Expand Up @@ -376,8 +376,8 @@ def write(filename, data, extname=None, extver=None, header=None,
Defaults to 'SUBTRACTIVE_DITHER_1' which follows the fpack defaults
hcomp_scale: float
Scale value for HCOMPRESS, 0.0 means lossless compression. Default is 0.0
following the fpack defaults.
Scale value for HCOMPRESS, 0.0 means lossless compression. Default is
0.0 following the fpack defaults.
hcomp_smooth: bool
If True, apply smoothing when decompressing. Default False
"""
Expand Down Expand Up @@ -635,11 +635,11 @@ def write(self, data, units=None, extname=None, extver=None,
tile_dims: tuple of ints, optional
The size of the tiles used to compress images.
qlevel: float, optional
Quantization level for floating point data. Lower generally result in
more compression, we recommend one reads the FITS standard or cfitsio
manual to fully understand the effects of quantization. None or 0
means no quantization, and for gzip also implies lossless. Default is
4.0 which follows the fpack defaults
Quantization level for floating point data. Lower generally result
in more compression, we recommend one reads the FITS standard or
cfitsio manual to fully understand the effects of quantization.
None or 0 means no quantization, and for gzip also implies
lossless. Default is 4.0 which follows the fpack defaults
qmethod: string or int
The quantization method as string or integer.
'NO_DITHER' or fitsio.NO_DITHER (-1)
Expand All @@ -652,8 +652,8 @@ def write(self, data, units=None, extname=None, extver=None,
Defaults to 'SUBTRACTIVE_DITHER_1' which follows the fpack defaults
hcomp_scale: float
Scale value for HCOMPRESS, 0.0 means lossless compression. Default is 0.0
following the fpack defaults.
Scale value for HCOMPRESS, 0.0 means lossless compression. Default
is 0.0 following the fpack defaults.
hcomp_smooth: bool
If True, apply smoothing when decompressing. Default False
Expand Down Expand Up @@ -741,11 +741,11 @@ def write_image(self, img, extname=None, extver=None,
tile_dims: tuple of ints, optional
The size of the tiles used to compress images.
qlevel: float, optional
Quantization level for floating point data. Lower generally result in
more compression, we recommend one reads the FITS standard or cfitsio
manual to fully understand the effects of quantization. None or 0
means no quantization, and for gzip also implies lossless. Default is
4.0 which follows the fpack defaults
Quantization level for floating point data. Lower generally result
in more compression, we recommend one reads the FITS standard or
cfitsio manual to fully understand the effects of quantization.
None or 0 means no quantization, and for gzip also implies
lossless. Default is 4.0 which follows the fpack defaults
qmethod: string or int
The quantization method as string or integer.
'NO_DITHER' or fitsio.NO_DITHER (-1)
Expand All @@ -758,8 +758,8 @@ def write_image(self, img, extname=None, extver=None,
Defaults to 'SUBTRACTIVE_DITHER_1' which follows the fpack defaults
hcomp_scale: float
Scale value for HCOMPRESS, 0.0 means lossless compression. Default is 0.0
following the fpack defaults.
Scale value for HCOMPRESS, 0.0 means lossless compression. Default
is 0.0 following the fpack defaults.
hcomp_smooth: bool
If True, apply smoothing when decompressing. Default False
Expand Down Expand Up @@ -866,11 +866,11 @@ def create_image_hdu(self,
tile_dims: tuple of ints, optional
The size of the tiles used to compress images.
qlevel: float, optional
Quantization level for floating point data. Lower generally result in
more compression, we recommend one reads the FITS standard or cfitsio
manual to fully understand the effects of quantization. None or 0
means no quantization, and for gzip also implies lossless. Default is
4.0 which follows the fpack defaults.
Quantization level for floating point data. Lower generally result
in more compression, we recommend one reads the FITS standard or
cfitsio manual to fully understand the effects of quantization.
None or 0 means no quantization, and for gzip also implies
lossless. Default is 4.0 which follows the fpack defaults.
qmethod: string or int
The quantization method as string or integer.
'NO_DITHER' or fitsio.NO_DITHER (-1)
Expand All @@ -883,8 +883,8 @@ def create_image_hdu(self,
Defaults to 'SUBTRACTIVE_DITHER_1' which follows the fpack defaults
hcomp_scale: float
Scale value for HCOMPRESS, 0.0 means lossless compression. Default is 0.0
following the fpack defaults.
Scale value for HCOMPRESS, 0.0 means lossless compression. Default
is 0.0 following the fpack defaults.
hcomp_smooth: bool
If True, apply smoothing when decompressing. Default False
Expand Down Expand Up @@ -1469,7 +1469,10 @@ def __repr__(self):
name = '%s[%s]' % (name, ver)

rep.append(
"%s%-6d %-15s %s" % (spacing, i, _hdu_type_map[t], name))
"%s%-6d %-15s %s" % (
spacing, i, _hdu_type_map[t], name
)
)

rep = '\n'.join(rep)
return rep
Expand Down
6 changes: 4 additions & 2 deletions fitsio/hdu/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,10 @@ def write_keys(self, records_in, clean=True):

if INVALID_HDR_CHARS_RE.search(name):
raise RuntimeError(
"header key '%s' has invalid characters! Characters in "
"%s are not allowed!" % (name, INVALID_HDR_CHARS)
"header key '%s' has invalid characters! "
"Characters in %s are not allowed!" % (
name, INVALID_HDR_CHARS
)
)

value = r['value']
Expand Down
6 changes: 4 additions & 2 deletions fitsio/hdu/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ def get_colname(self, colnum):
"""
if colnum < 0 or colnum > (len(self._colnames)-1):
raise ValueError(
"colnum out of range [0,%s-1]" % (0, len(self._colnames)))
"colnum out of range [0,%s-1]" % len(self._colnames)
)
return self._colnames[colnum]

def get_vstorage(self):
Expand Down Expand Up @@ -1730,7 +1731,8 @@ def _extract_colnum(self, col):

if (colnum < 0) or (colnum > (self._ncol-1)):
raise ValueError(
"column number should be in [0,%d]" % (0, self._ncol-1))
"column number should be in [0,%d]" % (self._ncol-1)
)
else:
colstr = mks(col)
try:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def check_system_cfitsio_objects(self, obj_name):

setup(
name="fitsio",
version="1.1.5",
version="1.1.6",
description=description,
long_description=long_description,
long_description_content_type='text/markdown; charset=UTF-8; variant=GFM',
Expand Down

0 comments on commit 979fb83

Please sign in to comment.