astroquery/vamdc/core.py
def query_molecule(self, molecule_name, chem_re_flags=0, cache=True):
        """
        Query for the VAMDC data for a specific molecule

        Parameters
        ----------
        molecule_name: str
            The common name (including unicode characters) or the ordinary
            molecular formula (e.g., CH3OH for Methanol) of the molecule.
        chem_re_flags: int
            The re (regular expression) flags for comparison of the molecule
            name with the lookuptable keys
        cache: bool
            Use the astroquery cache to store/recover the result

        Returns
        -------
        result: ``vamdclib.request.Result``
            A vamdclib Result object that has a data attribute.  The result
            object has dictionary-like entries but has more functionality built
            on top of that
        """

        myhash = "{0}_re{1}".format(molecule_name, chem_re_flags)
        myhashpath = os.path.join(self.CACHE_LOCATION,
                                  myhash)
        if os.path.exists(myhashpath) and cache:
            with open(myhashpath, 'rb') as fh:
                xml = fh.read()
            result = self._vresults.Result(xml=xml)
            result.populate_model()
        else:
            species_id_dict = self.species_lookuptable.find(molecule_name,
                                                            flags=chem_re_flags)
            if len(species_id_dict) == 1:
                species_id = list(species_id_dict.values())[0]
            else:
                raise ValueError("Too many species matched: {0}"
                                 .format(species_id_dict))

            request = self._vrequest.Request(node=self._cdms)
            query_string = "SELECT ALL WHERE VAMDCSpeciesID='%s'" % species_id
            request.setquery(query_string)
            result = request.dorequest()

            if cache:
                with open(myhashpath, 'wb') as fh:
                    xml = fh.write(result.Xml)

        return result

        # example use of specmodel; return to this later...
        # Q = self.specmodel.calculate_partitionfunction(result.data['States'],
        #                                  temperature=tex)[species_id]

        Query for the VAMDC data for a specific molecule

        Parameters
        ----------
        molecule_name: str
            The common name (including unicode characters) or the ordinary
            molecular formula (e.g., CH3OH for Methanol) of the molecule.
        chem_re_flags: int
            The re (regular expression) flags for comparison of the molecule
            name with the lookuptable keys
        cache: bool
            Use the astroquery cache to store/recover the result

        Returns
        -------
        result: ``vamdclib.request.Result``
            A vamdclib Result object that has a data attribute.  The result
            object has dictionary-like entries but has more functionality built
            on top of that
        
Query for the VAMDC data for a specific molecule
Parameters

str
The common name (including unicode characters) or the ordinary
molecular formula  of the molecule.
chem_re_flags: int
The re (regular expression) flags for comparison of the molecule
name with the lookuptable keys
cache: bool
Use the astroquery cache to store/recover the result

Returns

``vamdclib.request.Result``
A vamdclib Result object that has a data attribute.  The result
object has dictionary-like entries but has more functionality built
on top of that
Query for the VAMDC data for a specific molecule Parameters str The common name ( including unicode characters ) or the ordinary molecular formula of the molecule . chem_re_flags : int The re ( regular expression ) flags for comparison of the molecule name with the lookuptable keys cache : bool Use the astroquery cache to store / recover the result Returns ` ` vamdclib . request . Result ` ` A vamdclib Result object that has a data attribute . The result object has dictionary - like entries but has more functionality built on top of that
def query_molecule(self, molecule_name, chem_re_flags=0, cache=True):
        myhash = "{0}_re{1}".format(molecule_name, chem_re_flags)
        myhashpath = os.path.join(self.CACHE_LOCATION,
                                  myhash)
        if os.path.exists(myhashpath) and cache:
            with open(myhashpath, 'rb') as fh:
                xml = fh.read()
            result = self._vresults.Result(xml=xml)
            result.populate_model()
        else:
            species_id_dict = self.species_lookuptable.find(molecule_name,
                                                            flags=chem_re_flags)
            if len(species_id_dict) == 1:
                species_id = list(species_id_dict.values())[0]
            else:
                raise ValueError("Too many species matched: {0}"
                                 .format(species_id_dict))
            request = self._vrequest.Request(node=self._cdms)
            query_string = "SELECT ALL WHERE VAMDCSpeciesID='%s'" % species_id
            request.setquery(query_string)
            result = request.dorequest()
            if cache:
                with open(myhashpath, 'wb') as fh:
                    xml = fh.write(result.Xml)
        return result
def query_molecule ( self , molecule_name , chem_re_flags = 0 , cache = True ) : myhash = "{0}_re{1}" . format ( molecule_name , chem_re_flags ) myhashpath = os . path . join ( self . CACHE_LOCATION , myhash ) if os . path . exists ( myhashpath ) and cache : with open ( myhashpath , 'rb' ) as fh : xml = fh . read ( ) result = self . _vresults . Result ( xml = xml ) result . populate_model ( ) else : species_id_dict = self . species_lookuptable . find ( molecule_name , flags = chem_re_flags ) if len ( species_id_dict ) == 1 : species_id = list ( species_id_dict . values ( ) ) [ 0 ] else : raise ValueError ( "Too many species matched: {0}" . format ( species_id_dict ) ) request = self . _vrequest . Request ( node = self . _cdms ) query_string = "SELECT ALL WHERE VAMDCSpeciesID='%s'" % species_id request . setquery ( query_string ) result = request . dorequest ( ) if cache : with open ( myhashpath , 'wb' ) as fh : xml = fh . write ( result . Xml ) return result
Query for the VAMDC data for a specific molecule
Parameters
Query for the VAMDC data for a specific molecule Parameters
"""
        Query for the VAMDC data for a specific molecule

        Parameters
        ----------
        molecule_name: str
            The common name (including unicode characters) or the ordinary
            molecular formula (e.g., CH3OH for Methanol) of the molecule.
        chem_re_flags: int
            The re (regular expression) flags for comparison of the molecule
            name with the lookuptable keys
        cache: bool
            Use the astroquery cache to store/recover the result

        Returns
        -------
        result: ``vamdclib.request.Result``
            A vamdclib Result object that has a data attribute.  The result
            object has dictionary-like entries but has more functionality built
            on top of that
        """ # example use of specmodel; return to this later... # Q = self.specmodel.calculate_partitionfunction(result.data['States'], #                                  temperature=tex)[species_id]
self
molecule_name
chem_re_flags
cache