Python print verbose

13 Python code examples are found related to " print verbose". You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.
Example 1
Source File: params.py    From tenpy with GNU General Public License v3.0 6 votes vote down vote up
def print_if_verbose(self, option, action=None, use_default=False):
        """Print out `option` if verbosity and other conditions are met.

        Parameters
        ----------
        option : str
            Key/option name for the parameter being read out.
        action : str, optional
            Use to adapt printout message to specific actions (e.g. "Deleting")
        """
        name = self.name
        verbose = self.verbose
        new_key = option in self.unused
        if verbose >= 100 or (new_key and verbose >= (2. if use_default else 1.)):
            val = self.options.get(option, "<not set>")
            if action is None:
                action = "Option"
            defaultstring = "(default) " if use_default else ""
            print("{action} {option!r}={val!r} {defaultstring}for config {name!s}".format(
                action=action, name=name, option=option, val=val, defaultstring=defaultstring)) 
Example 2
Source File: models.py    From Dallinger with MIT License 6 votes vote down vote up
def print_verbose(self):
        """Print a verbose representation of a network."""
        print("Nodes: ")
        for a in self.nodes(failed="all"):
            print(a)

        print("\nVectors: ")
        for v in self.vectors(failed="all"):
            print(v)

        print("\nInfos: ")
        for i in self.infos(failed="all"):
            print(i)

        print("\nTransmissions: ")
        for t in self.transmissions(failed="all"):
            print(t)

        print("\nTransformations: ")
        for t in self.transformations(failed="all"):
            print(t) 
Example 3
Source File: controlhandler.py    From QB_Nebulae_V2 with MIT License 6 votes vote down vote up
def printAllControlsVerbose(self):
        line = "############################\n"
        line += "Primary Channel Pots:"
        for i,chn in enumerate(self.channels):
            if i % 4 == 0:
                line +="\n"
            line += chn.name + ": " + str(chn.getPotValue()) + "\t"
        line += "\nPrimary Channel CVs:"
        for i,chn in enumerate(self.channels):
            if i % 4 == 0:
                line +="\n"
            line += chn.name + ": " + str(chn.getCVValue()) + "\t"
        line += "\nSecondary Channels:"
        for i,chn in enumerate(self.altchannels):
            if i % 4 == 0:
                line += "\n"
            line += chn.name + ": " + str(chn.getValue()) + "\t"
        line += "\n############################\n"
        print line 
Example 4
Source File: models.py    From Wallace with MIT License 6 votes vote down vote up
def print_verbose(self):
        """Print a verbose representation of a network."""
        print "Nodes: "
        for a in (self.nodes(failed="all")):
            print a

        print "\nVectors: "
        for v in (self.vectors(failed="all")):
            print v

        print "\nInfos: "
        for i in (self.infos(failed="all")):
            print i

        print "\nTransmissions: "
        for t in (self.transmissions(failed="all")):
            print t

        print "\nTransformations: "
        for t in (self.transformations(failed="all")):
            print t 
Example 5
Source File: run_ops_automator_local.py    From aws-ops-automator with Apache License 2.0 5 votes vote down vote up
def print_verbose(msg, *a):
    if verbose:
        s = msg if len(a) == 0 else msg.format(*a)
        t = time.time()
        dt = datetime.fromtimestamp(t)
        s = LOG_FORMAT.format(dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second, str(dt.microsecond)[0:3], s)
        print(s) 
Example 6
Source File: corextopic.py    From corex_topic with Apache License 2.0 5 votes vote down vote up
def print_verbose(self):
        if self.verbose:
            print(self.tcs)
        if self.verbose > 1:
            print(self.alpha[:, :, 0])
            print(self.theta) 
Example 7
Source File: corex.py    From CorEx with GNU General Public License v2.0 5 votes vote down vote up
def print_verbose(self):
        if self.verbose:
            print(self.tcs)
        if self.verbose > 1:
            print(self.alpha[:,:,0])
            if hasattr(self, "mis"):
                print(self.mis[:,:,0]) 
Example 8
Source File: corex.py    From bio_corex with Apache License 2.0 5 votes vote down vote up
def print_verbose(self):
        if self.verbose:
            print(self.tcs)
        if self.verbose > 1:
            print(self.alpha[:, :, 0])
            print(self.theta)
            if hasattr(self, "mis"):
                print(self.mis) 
Example 9
Source File: cross_section.py    From section-properties with MIT License 5 votes vote down vote up
def print_verbose(self, d, root_result, axis):
        """Prints information related to the function solver convergence to the terminal.

        :param float d: Location of the plastic centroid axis
        :param root_result: Result object from the root finder
        :type root_result: :class:`scipy.optimize.RootResults`
        :param string axis: Axis being considered by the function sovler
        """

        str = "---{0} plastic centroid calculation converged at ".format(axis)
        str += "{0:.5e} in {1} iterations.".format(d, root_result.iterations)
        print(str) 
Example 10
Source File: logging.py    From sequestrum with MIT License 5 votes vote down vote up
def print_verbose(error_message):
    """
        Prints message with green color to show success
    """
    print("\033[1;32mVERBOSE\033[0m {}".format(error_message)) 
Example 11
Source File: sign-message.py    From replace-by-fee-tools with GNU General Public License v3.0 5 votes vote down vote up
def print_verbose(signature, key, msg):
    secret = CBitcoinSecret(key)
    address = P2PKHBitcoinAddress.from_pubkey(secret.pub)
    message = BitcoinMessage(msg)
    print('Address: %s' % address)
    print('Message: %s' % msg)
    print('Signature: %s' % signature)
    print('Verified: %s' % VerifyMessage(address, message, signature))
    print('\nTo verify using bitcoin core:')
    print('\n`bitcoin-cli verifymessage %s \'%s\' \'%s\'`\n' % (address, signature.decode('ascii'), msg)) 
Example 12
Source File: utils.py    From btproxy with GNU General Public License v3.0 5 votes vote down vote up
def print_verbose(*args):
    global print_lock
    if argparser.args.verbose: 
        with print_lock:
            print(*args) 
Example 13
Source File: printing.py    From REDPy with GNU General Public License v3.0 4 votes vote down vote up
def printVerboseCatalog(rtable, ftable, ctable, opt):
	"""
	Prints flat catalog to text file with additional columns

	rtable: Repeater table
	ftable: Families table
	ctable: Correlation table
	opt: Options object describing station/run parameters

	Columns correspond to cluster number, event time, frequency index, amplitude, time
	since last event in hours, correlation coefficient with respect to the best
	correlated event, and correlation coefficient with respect to the core event.
	"""

	with open('{}{}/catalog.txt'.format(opt.outputPath, opt.groupName), 'w') as f:
			
		startTimes = rtable.cols.startTime[:]
		startTimeMPL = rtable.cols.startTimeMPL[:]
		windowStarts = rtable.cols.windowStart[:]
		windowAmps = rtable.cols.windowAmp[:]
		ids = rtable.cols.id[:]
		id1 = ctable.cols.id1[:]
		id2 = ctable.cols.id2[:]
		ccc = ctable.cols.ccc[:]
		fi = np.nanmean(rtable.cols.FI[:], axis=1)
	
		f.write("cnum\tevTime                    \tfi\txcormax\txcorcore\tdt(hr)\tamps\n")
		for cnum in range(ftable.attrs.nClust):
			fam = np.fromstring(ftable[cnum]['members'], dtype=int, sep=' ')
		
			catalogind = np.argsort(startTimeMPL[fam])
			catalog = startTimeMPL[fam][catalogind]
			spacing = np.diff(catalog)*24
			idf = ids[fam]
			ix = np.where(np.in1d(id2,idf))
			C = np.eye(len(idf))
			r1 = [np.where(idf==xx)[0][0] for xx in id1[ix]]
			r2 = [np.where(idf==xx)[0][0] for xx in id2[ix]]
			C[r1,r2] = ccc[ix]
			C[r2,r1] = ccc[ix]
			xcorrmax = C[np.argmax(np.sum(C,0)),:]
			core = ftable[cnum]['core']
			xcorrcore = C[np.where(fam==core)[0][0],:]
		
			j = -1
			for i in catalogind:
				evTime = (UTCDateTime(startTimes[fam][i]) +
					windowStarts[fam][i]/opt.samprate)
				amp = windowAmps[fam[i],:]
				if j == -1:
					dt = np.nan
				else:
					dt = spacing[j]
				j += 1
			
				f.write("{0}\t{1}\t{2: 4.3f}\t{4:3.2f}\t{5:3.2f}\t{3:12.6f}\t[".format(
				    cnum,evTime.isoformat(),fi[fam][i],dt,xcorrmax[i],xcorrcore[i]))
				for a in amp:
					f.write(" {:10.2f} ".format(a))
				f.write("]\n")