Skip to content

Commit

Permalink
Adding __bibtex__ and __citation__
Browse files Browse the repository at this point in the history
  • Loading branch information
bsipocz committed May 19, 2019
1 parent 8fe3775 commit 8e91222
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
File renamed without changes.
18 changes: 15 additions & 3 deletions astroquery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@
from ._astropy_init import *
# ----------------------------------------------------------------------------

# For egg_info test builds to pass, put package imports here.
# if not _ASTROPY_SETUP_:
# from astroquery import *
import os


# Set the bibtex entry to the article referenced in CITATION.
def _get_bibtex():
citation_file = os.path.join(os.path.dirname(__file__), 'CITATION')

with open(citation_file, 'r') as citation:
refs = citation.read().split('@ARTICLE')[1:]
if len(refs) == 0: return ''
bibtexreference = "@ARTICLE{0}".format(refs[0])
return bibtexreference


__citation__ = __bibtex__ = _get_bibtex()

0 comments on commit 8e91222

Please sign in to comment.