Esempio n. 1
0
    def interactive_query(self, display_cols, **kwds):
        """
        Generate an interact shell to query the database.

        This method generates an interact shell (in the notebook only) that
        allows the user to manipulate query parameters and see the updated
        results.

        .. TODO::

            This function could use improvement. Add full options of typical
            :class:`~GraphQuery` (i.e.: have it accept list input); and update
            options in interact to make it less annoying to put in operators.

        EXAMPLES::

            sage: D = GraphDatabase()
            sage: D.interactive_query(display_cols=['graph6', 'num_vertices', 'degree_sequence'], num_edges=5, max_degree=3)  # py2 # optional -- sagenb
            <html>...</html>

        .. WARNING::

            Above doctest is known to fail with Python 3 due to ``sagenb``. See
            :trac:`27435` for more details.
        """
        from sagenb.notebook.interact import interact
        print('<html><h1>Interactive Graph Query</h1></html>')
        f = self._gen_interact_func(display=display_cols, **kwds)
        interact(f)
Esempio n. 2
0
    def interactive_query(self, display_cols, **kwds):
        """
        TODO: This function could use improvement. Add full options of
        typical GraphQuery (i.e.: have it accept list input); and update
        options in interact to make it less annoying to put in operators.

        Generates an interact shell (in the notebook only) that allows the
        user to manipulate query parameters and see the updated results.

        EXAMPLE::

            sage: D = GraphDatabase()
            sage: D.interactive_query(display_cols=['graph6','num_vertices','degree_sequence'],num_edges=5,max_degree=3)
            <html>...</html>
        """
        from sagenb.notebook.interact import interact
        print('<html><h1>Interactive Graph Query</h1></html>')
        f = self._gen_interact_func(display=display_cols,**kwds)
        interact(f)