Exemplo n.º 1
0
def _schema_has_fits_hdu(schema):
    has_fits_hdu = [False]

    for node in treeutil.iter_tree(schema):
        if isinstance(node, dict) and 'fits_hdu' in node:
            has_fits_hdu[0] = True

    return has_fits_hdu[0]
Exemplo n.º 2
0
def _schema_has_fits_hdu(schema):
    has_fits_hdu = [False]

    for node in treeutil.iter_tree(schema):
        if isinstance(node, dict) and 'fits_hdu' in node:
            has_fits_hdu[0] = True

    return has_fits_hdu[0]
Exemplo n.º 3
0
    def find_examples_in_schema(self):
        """Returns generator for all examples in schema at given path"""
        with open(str(self.fspath), 'rb') as fd:
            schema_tree = yaml.load(fd)

        for node in treeutil.iter_tree(schema_tree):
            if (isinstance(node, dict) and 'examples' in node
                    and isinstance(node['examples'], list)):
                for desc, example in node['examples']:
                    yield example
Exemplo n.º 4
0
    def find_examples_in_schema(self):
        """Returns generator for all examples in schema at given path"""
        from asdf import treeutil

        with open(str(self.fspath), 'rb') as fd:
            schema_tree = yaml.safe_load(fd)

        for node in treeutil.iter_tree(schema_tree):
            if (isinstance(node, dict) and
                'examples' in node and
                isinstance(node['examples'], list)):
                for desc, example in node['examples']:
                    yield example
Exemplo n.º 5
0
 def check_asdf(asdf):
     for node in treeutil.iter_tree(asdf.tree):
         if node != asdf.tree:
             assert not isinstance(node, tagged.Tagged)
Exemplo n.º 6
0
 def check_asdf(asdf):
     for node in treeutil.iter_tree(asdf.tree):
         if node != asdf.tree:
             assert not isinstance(node, tagged.Tagged)