Skip to content

Commit

Permalink
hack to allow vamdc import for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
keflavich committed Oct 21, 2016
1 parent e6b57d5 commit 78ffa18
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions astroquery/vamdc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,15 @@ class VamdcClass(BaseQuery):
TIMEOUT = conf.timeout
CACHE_LOCATION = conf.cache_location

def __init__(self):

def __init__(self, doimport=True):
super(VamdcClass, self).__init__()

if not doimport:
# this is a hack to allow the docstrings to be produced without
# importing the necessary modules
return

from vamdclib import nodes as vnodes
from vamdclib import request as vrequest
from vamdclib import results as vresults
Expand Down Expand Up @@ -125,4 +131,5 @@ def query_molecule(self, molecule_name, chem_re_flags=0, cache=True):
try:
Vamdc = VamdcClass()
except ImportError:
Vamdc = NotImplementedError
log.warn("vamdclib could not be imported; the vamdc astroquery module will not work")
Vamdc = VamdcClass(doimport=False)

0 comments on commit 78ffa18

Please sign in to comment.