예제 #1
0
    def qiskit_progress_bar(self, line="", cell=None):  # pylint: disable=unused-argument
        """A Jupyter magic function to generate progressbar."""
        args = magic_arguments.parse_argstring(self.qiskit_progress_bar, line)
        if args.type == "html":
            pbar = HTMLProgressBar()
        elif args.type == "text":
            pbar = TextProgressBar()
        else:
            raise qiskit.QiskitError("Invalid progress bar type.")

        return pbar
예제 #2
0
    def qiskit_progress_bar(self, line='', cell=None):
        """A Jupyter magic function to generate progressbar.
        """
        args = magic_arguments.parse_argstring(self.qiskit_progress_bar, line)
        if args.type == 'html':
            HTMLProgressBar()
        elif args.type == 'text':
            TextProgressBar()
        else:
            raise qiskit.QiskitError('Invalid progress bar type.')

        self.shell.ex(cell)