Generate a summary dict.

        Args:
            print_subelectrodes: Also print data on all the possible
                subelectrodes.

        Returns:
            A summary of this electrode"s properties in dict format.
556290
def as_dict_summary(self, print_subelectrodes=True):
        
        chg_comp = self.fully_charged_entry.composition
        dischg_comp = self.fully_discharged_entry.composition

        ion = self.working_ion
        d = {"average_voltage": self.get_average_voltage(),
             "max_voltage": self.max_voltage,
             "min_voltage": self.min_voltage,
             "max_delta_volume": self.max_delta_volume,
             "max_voltage_step": self.max_voltage_step,
             "capacity_grav": self.get_capacity_grav(),
             "capacity_vol": self.get_capacity_vol(),
             "energy_grav": self.get_specific_energy(),
             "energy_vol": self.get_energy_density(),
             "working_ion": self._working_ion.symbol,
             "nsteps": self.num_steps,
             "framework": self._vpairs[0].framework.to_data_dict,
             "formula_charge": chg_comp.reduced_formula,
             "id_charge": self.fully_charged_entry.entry_id,
             "formula_discharge": dischg_comp.reduced_formula,
             "id_discharge": self.fully_discharged_entry.entry_id,
             "fracA_charge": chg_comp.get_atomic_fraction(ion),
             "fracA_discharge": dischg_comp.get_atomic_fraction(ion),
             "max_instability": self.get_max_instability(),
             "min_instability": self.get_min_instability(),
             "material_ids" : [itr_ent.entry_id for itr_ent in self._entries],
             "stable_material_ids" : [itr_ent.entry_id for itr_ent in self.get_stable_entries()],
             "unstable_material_ids": [itr_ent.entry_id for itr_ent in self.get_unstable_entries()],
             }

        if all(['decomposition_energy' in itr_ent.data for itr_ent in self._entries]):
            d.update({"stability_charge": self.fully_charged_entry.data['decomposition_energy'],
                 "stability_discharge": self.fully_discharged_entry.data['decomposition_energy'],
                 "stability_data":{itr_ent.entry_id: itr_ent.data['decomposition_energy'] for itr_ent in self._entries},
                 })

        if all(['muO2' in itr_ent.data for itr_ent in self._entries]):
            d.update({"muO2_data" : {itr_ent.entry_id: itr_ent.data['muO2'] for itr_ent in self._entries}})

        if print_subelectrodes:
            f_dict = lambda c: c.as_dict_summary(print_subelectrodes=False)
            d["adj_pairs"] = list(map(f_dict,
                                 self.get_sub_electrodes(adjacent_only=True)))
            d["all_pairs"] = list(map(f_dict,
                                 self.get_sub_electrodes(adjacent_only=False)))
        return d
908503
def info(self):
        
        return {
            'key': self.key,
            'processor': self.processor,
            'extractor': self.extractor,
            'output_path': self.output_path,
            'output_format': self.output_format,
            'template': self.template,
            'type': type(self)
        }
393347
def display_all(self):
        
        print( ("total elapse %0.6f seconds, last elapse %0.6f seconds, "
                "took %s times measurement") % (
                    self.total_elapse, self.elapse, len(self.records)))
541637
def print_summary(self):
        
        for input in self.form.find_all(
                ("input", "textarea", "select", "button")):
            input_copy = copy.copy(input)
            # Text between the opening tag and the closing tag often
            # contains a lot of spaces that we don't want here.
            for subtag in input_copy.find_all() + [input_copy]:
                if subtag.string:
                    subtag.string = subtag.string.strip()
            print(input_copy)
547479
def print_summary(ui)
      # Print whether it passed/failed at the top
      if failed?
        ui.puts "\n[!] Failed\n".red
      else
        ui.notice "Passed"
      end

      # A generic proc to handle the similarities between
      # errors and warnings.
      do_rules = proc do |name, rules|
        unless rules.empty?
          ui.puts ""
          ui.section(name.bold) do
            rules.each do |rule|
              title = rule.title.bold + " - #{rule.object_applied_to}"
              subtitles = [rule.description, link(rule.ref)]
              subtitles += [rule.metadata[:files].join(":")] if rule.metadata[:files]
              ui.labeled(title, subtitles)
              ui.puts ""
            end
          end
        end
      end

      # Run the rules
      do_rules.call("Errors".red, errors)
      do_rules.call("Warnings".yellow, warnings)
    end
117419
def print_db_stats():
    
    dbroot = get_db_root()
    n_ids = len(list(dbroot.glob("[N,W]*")))
    print("Number of WACs and NACs in database: {}".format(n_ids))
    print("These kind of data are in the database: (returning pd.DataFrame)")
    d = {}
    for key, val in PathManager.extensions.items():
        d[key] = [len(list(dbroot.glob("**/*" + val)))]
    return pd.DataFrame(d)
318951
def summary(self, input_size=None, hashsummary=False):
        

        if input_size is None:
            print(self)
            print("-" * 120)
            number = sum(p.numel() for p in self.model.parameters())
            print("Number of model parameters: {:,}".format(number))
            print("-" * 120)
        else:
            summary(self, input_size)

        if hashsummary:
            for idx, hashvalue in enumerate(self.hashsummary()):
                print(f"{idx}: {hashvalue}")
93818
def print_summary(self) -> None:
        
        print("Tasks execution time summary:")
        for mon_task in self._monitor_tasks:
            print("%s:\t%.4f (sec)" % (mon_task.task_name, mon_task.total_time))
707802
def display(self):
        
        data = []
        first_row = ['Stat']
        first_row.extend(self._names)
        data.append(first_row)

        stats = self._stats()

        for stat in stats:
            k, n, f = stat
            # blank row
            if k is None:
                row = [''] * len(data[0])
                data.append(row)
                continue

            row = [n]
            for key in self._names:
                raw = getattr(self[key], k)

                # if rf is a series print nan
                if k == 'rf' and not type(raw) == float:
                    row.append(np.nan)
                elif f is None:
                    row.append(raw)
                elif f == 'p':
                    row.append(fmtp(raw))
                elif f == 'n':
                    row.append(fmtn(raw))
                elif f == 'dt':
                    row.append(raw.strftime('%Y-%m-%d'))
                else:
                    raise NotImplementedError('unsupported format %s' % f)
            data.append(row)

        print(tabulate(data, headers='firstrow'))
958888
def print_subprocess_output(subp):
    ''''''
    if subp:
        if subp.errorcode != 0:
            print('<error errorcode="%s">' % str(subp.errorcode))
            print(subp.stderr)
            print("</error>")
            print_tag('stdout', '\n%s\n' % subp.stdout)
        else:
            print_tag('success', '\n%s\n' % subp.stdout)
            print_tag('warnings', '\n%s\n' % subp.stderr)
65474
def plot_summary_translated(self):
        """"""

        fig2 = plt.figure()
        ax1 = fig2.add_subplot(221)
        ax1.set_title('OCV (V)')
        ax2 = fig2.add_subplot(222)
        ax2.set_title('IR (Ohm)')
        ax3 = fig2.add_subplot(223)
        ax3.set_title('Resistances (Ohm)')
        ax4 = fig2.add_subplot(224)
        ax4.set_title('Capacitances (F)')
        ax4.set_yscale("log")

        plot_data = self.get_best_fit_parameters_translated_grouped()
        print(plot_data['ocv'])
        print(plot_data['ir'])
        print(plot_data['r0'])

        ax1.plot(self.get_fit_cycles(), plot_data['ocv'])
        ax2.plot(self.get_fit_cycles(), plot_data['ir'])

        for i in range(self.circuits):
            ax3.plot(self.get_fit_cycles(), plot_data['r' + str(i)])
            ax4.plot(self.get_fit_cycles(), plot_data['c' + str(i)])

        plt.show()
562425
def show_description(self):
        

        def printit(c, v):
            underline = "-" * len(dr.get_name(c))
            resp = self.responses[v["type"]]
            name = "%s[%s] %s%s" % (resp.color, resp.label, dr.get_name(c), Style.RESET_ALL)
            print(name, file=self.stream)
            print(underline, file=self.stream)
            print(render(c, v), file=self.stream)
            print(file=self.stream)

        for c in sorted(self.broker.get_by_type(rule), key=dr.get_name):
            v = self.broker[c]
            _type = v.get('type')
            if _type in self.responses:
                self.counts[_type] += 1
            if (_type and ((self.fail_only and _type == 'rule') or
                           ((self.missing and _type == 'skip') or
                            (not self.fail_only and _type != 'skip')))):
                printit(c, v)
        print(file=self.stream)

        self.print_header("Rule Execution Summary", Fore.CYAN)
        for c in self.counts:
            print(self.responses[c].color + self.responses[c].title + str(self.counts[c]) + Style.RESET_ALL, file=self.stream)
656790
def printParameters(self):
    
    print "------------PY  TemporalPooler Parameters ------------------"
    print "numInputs                  = ", self.getNumInputs()
    print "numColumns                 = ", self.getNumColumns()
    print "columnDimensions           = ", self._columnDimensions
    print "numActiveColumnsPerInhArea = ", self.getNumActiveColumnsPerInhArea()
    print "potentialPct               = ", self.getPotentialPct()
    print "globalInhibition           = ", self.getGlobalInhibition()
    print "localAreaDensity           = ", self.getLocalAreaDensity()
    print "stimulusThreshold          = ", self.getStimulusThreshold()
    print "synPermActiveInc           = ", self.getSynPermActiveInc()
    print "synPermInactiveDec         = ", self.getSynPermInactiveDec()
    print "synPermConnected           = ", self.getSynPermConnected()
    print "minPctOverlapDutyCycle     = ", self.getMinPctOverlapDutyCycles()
    print "dutyCyclePeriod            = ", self.getDutyCyclePeriod()
    print "boostStrength              = ", self.getBoostStrength()
    print "spVerbosity                = ", self.getSpVerbosity()
    print "version                    = ", self._version
662875
def print_options(self):
        
        summary = []
        for opt_name, opt in self.options.items():
            if opt.hidden:
                continue
            summary.append(opt.summary())
        print("\n".join(summary))
979350
def _parse_radic_header(header_group, dipole_mode="all"):
    
    header = ''.join(header_group[1])

    nr_of_electrodes = _get_nr_of_electrodes(header.split('\n'))
    groups = itertools.groupby(
        header.split('\n'),
        lambda line: (
            line.startswith('[End Readings]') or
            line.startswith('[Begin Readings]')
        )
    )

    for key, group in groups:
        # there is only one group we are interested in: the first one
        if key:
            tmp = np.array(
                [
                    np.fromstring(
                        x, sep=' ', dtype=int
                    )
                    for x in next(groups)[1]
                ],
            )

            # curpots = tmp.T.copy()
            # curpots.resize(nr_of_electrodes + 2, tmp.shape[0])
            break

    # now we have the raw readings, pad them with zeros
    readings = []
    for raw_reading in tmp:
        voltage_rus = raw_reading[3:]
        # note that we now have the last electrode in here, too (so one more
        # than we have RUs. This electrode is always 0
        normed_reading = np.zeros(nr_of_electrodes)
        for i in voltage_rus[np.where(voltage_rus > 0)]:
            normed_reading[i - 1] = i
        readings.append(np.hstack((raw_reading[0:3], normed_reading)))

    # now generate the available configurations
    # add calibration
    reading_configs = {}
    for nr, reading in enumerate(readings):
        # nr = reading[0]
        A = reading[1]
        B = reading[2]

        voltages = []

        # loop over the RU-settings
        # we always measure to the next zero electrode
        for i in range(3, nr_of_electrodes + 3):
            for j in range(i + 1, nr_of_electrodes + 3):
                if reading[j] == 0:
                    M = i - 2
                    N = j - 2
                    all_active = ((reading[i] == 0) and (reading[j] == 0))
                    # print('a', 'b', 'm, n', A, B, M, N, all_active)
                    voltages.append((A, B, M, N, all_active))
                    break

        reading_configs[nr + 1] = np.array(voltages)
    return reading_configs
764276
def _print_result_info(traces, events):
    
    print_v('Returning %i traces:'%len(traces))
    for r in sorted(traces.keys()):
        x = traces[r]
        print_v('  %s (%s): %s -> %s (min: %s, max: %s, len: %i)'%(r, type(x), x[0],x[-1],min(x),max(x),len(x)))
    print_v('Returning %i events:'%len(events))
    for r in sorted(events.keys()):
        x = events[r]
        print_v('  %s: %s -> %s (len: %i)'%(r, x[0] if len(x)>0 else '-',x[-1] if len(x)>0 else '-',len(x)))
995248
def _format_summary_node(self, task_class):
        
        modulename = task_class.__module__
        classname = task_class.__name__
        nodes = []

        nodes.append(
            self._format_class_nodes(task_class))

        nodes.append(
            self._format_config_nodes(modulename, classname)
        )

        methods = ('run', 'runDataRef')
        for method in methods:
            if hasattr(task_class, method):
                method_obj = getattr(task_class, method)
                nodes.append(
                    self._format_method_nodes(method_obj,
                                              modulename,
                                              classname))
        return nodes