Skip to content

Commit

Permalink
V1.2.1 (#67)
Browse files Browse the repository at this point in the history
- Patches missing file bug for Ganeshalingam et al. 2013 release.
- Hides any benign warnings when parsing data files.
  • Loading branch information
djperrefort authored Aug 3, 2020
1 parent b6e0f22 commit fca43fa
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
include sndata/sdss/Spectra_txt.zip
include sndata/loss/sndb_meta.csv
8 changes: 7 additions & 1 deletion docs/source/change_log.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ Change Log
This page documents any API changes between different versions of the
``sndata`` package.

V 1.2.1
-------

- Patches missing file bug for Ganeshalingam et al. 2013 release.
- Hides any benign warnings when parsing data files.

V 1.2.0
-------

- Adds data from the first data release of the BLick Observatory Supernova Search (``sndata.loss.Ganeshalingam13``)
- Adds data from the first data release of the BLick Observatory Supernova Search (``sndata.loss.Ganeshalingam13``).
- The ``format`` argument is added to the ``utils.convert_to_jd`` function.
- Support is added to ``utils.convert_to_jd`` for converting UT times to JD.

Expand Down
16 changes: 16 additions & 0 deletions sndata/base_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
docs.
"""

import functools
import shutil
import warnings
from typing import List
from typing import Union

Expand All @@ -23,6 +25,18 @@
VizierTableId = Union[int, str]


def ignore_warnings_wrapper(func: callable) -> callable:
"""Ignores warnings issued by the wrapped function call"""

@functools.wraps(func)
def inner(*args, **kwargs):
with warnings.catch_warnings():
warnings.simplefilter('ignore')
return func(*args, **kwargs)

return inner


class DefaultParser:
"""Prebuilt data parsing tools for Vizier tables and photometric filters
Expand Down Expand Up @@ -113,6 +127,7 @@ def get_available_tables(self) -> List[VizierTableId]:
return self._get_available_tables()

@utils.lru_copy_cache(maxsize=None)
@ignore_warnings_wrapper
def load_table(self, table_id: VizierTableId) -> Table:
"""Return a Vizier table published by this data release
Expand All @@ -136,6 +151,7 @@ def get_available_ids(self) -> List[str]:
utils.require_data_path(self._data_dir)
return self._get_available_ids()

@ignore_warnings_wrapper
def get_data_for_id(self, obj_id: str, format_table: bool = True) -> Table:
"""Returns data for a given object ID
Expand Down

0 comments on commit fca43fa

Please sign in to comment.