Skip to content

Commit

Permalink
Merge pull request #228 from dstansby/deflate-docs
Browse files Browse the repository at this point in the history
Deflate docs
  • Loading branch information
dstansby committed Jul 28, 2023
2 parents dad8076 + 42f2d5c commit 635c5b5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
7 changes: 5 additions & 2 deletions cdflib/gzip_wrapper.py → cdflib/_gzip_wrapper.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
try:
from deflate import gzip_decompress as gzip_inflate
from deflate import gzip_compress as gzip_deflate
from deflate import gzip_decompress as gzip_inflate

except ImportError:
from gzip import decompress as gzip_inflate
from gzip import compress as gzip_deflate
from gzip import decompress as gzip_inflate


__all__ = ["gzip_inflate", "gzip_deflate"]
2 changes: 1 addition & 1 deletion cdflib/cdfread.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from .gzip_wrapper import gzip_inflate
import hashlib
import io
import os
Expand All @@ -12,6 +11,7 @@
import numpy as np

import cdflib.epochs as epoch
from cdflib._gzip_wrapper import gzip_inflate
from cdflib.dataclasses import (
AEDR,
VDR,
Expand Down
2 changes: 1 addition & 1 deletion cdflib/cdfwrite.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import binascii
from .gzip_wrapper import gzip_deflate
import hashlib
import io
import logging
Expand All @@ -17,6 +16,7 @@
import numpy as np

import cdflib.epochs as cdfepoch
from cdflib._gzip_wrapper import gzip_deflate
from cdflib.logging import logger

__all__ = ["CDF"]
Expand Down
6 changes: 6 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
Changelog
=========

1.1.0
=====
- If the `deflate <https://github.com/dcwatson/deflate>`_ library is installed
it is now used to decompress data, which can lead to around 2x speedups over
the native gzip Python library.

1.0.5
=====
- Fixed the output of :meth:`cdflib.epochs.CDFepoch.compute_tt2000` to
Expand Down
3 changes: 2 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ cdflib requires python 3 and numpy. To install run
What is cdflib?
------------------

cdflib is an effort to replicate the CDF libraries using a pure python implementation. This means users do not need to install the `CDF NASA libraries <https://cdf.gsfc.nasa.gov/>`_.
cdflib is an effort to replicate the CDF libraries using a pure python implementation.
This means users do not need to install the `CDF NASA libraries <https://cdf.gsfc.nasa.gov/>`_.

The only module you need to install is ``numpy``, but there are a few things you can do with ``astropy`` and ``xarray``.

Expand Down

0 comments on commit 635c5b5

Please sign in to comment.