Heat capacity (kJ/m2-K) of a construction or material.
    thickness (m) * density (kg/m3) * specific heat (J/kg-K) * 0.001
197390
def heatcapacity(ddtt):
    
    object_type = ddtt.obj[0]
    if object_type == 'Construction':
        heatcapacity = 0
        layers = ddtt.obj[2:]
        field_idd = ddtt.getfieldidd('Outside_Layer')
        validobjects = field_idd['validobjects']
        for layer in layers:
            found = False
            for key in validobjects:
                try:
                    heatcapacity += ddtt.theidf.getobject(key, layer).heatcapacity
                    found = True
                except AttributeError:
                    pass
            if not found:
                raise AttributeError("%s material not found in IDF" % layer)
    elif object_type == 'Material':
        thickness = ddtt.obj[ddtt.objls.index('Thickness')]
        density = ddtt.obj[ddtt.objls.index('Density')]
        specificheat = ddtt.obj[ddtt.objls.index('Specific_Heat')]
        heatcapacity = thickness * density * specificheat * 0.001
    elif object_type == 'Material:AirGap':
        heatcapacity = 0
    elif object_type == 'Material:InfraredTransparent':
        heatcapacity = 0
    elif object_type == 'Material:NoMass':
        warnings.warn(
            "Material:NoMass materials included in heat capacity calculation",
            UserWarning)
        heatcapacity = 0
    elif object_type == 'Material:RoofVegetation':
        warnings.warn(
            "Material:RoofVegetation thermal properties are based on dry soil",
            UserWarning)
        thickness = ddtt.obj[ddtt.objls.index('Thickness')]
        density = ddtt.obj[ddtt.objls.index('Density_of_Dry_Soil')]
        specificheat = ddtt.obj[ddtt.objls.index('Specific_Heat_of_Dry_Soil')]
        heatcapacity = thickness * density * specificheat * 0.001
    else:
        raise AttributeError("%s has no heatcapacity property" % object_type)
    return heatcapacity
566284
def T(self):
        
        paramTemp = self.getParam('temperature')

        if not paramTemp is np.nan:
            return paramTemp
        elif ed_params.estimateMissingValues:
            self.flags.addFlag('Calculated Temperature')
            return self.calcTemperature()
        else:
            return np.nan
235286
def calculate_measurement(m1, m2, m3)
      if power_configuration == :single_phase_2wire
        m1
      elsif power_configuration == :single_phase_3wire
        (m1 + m2)
      elsif power_configuration == :three_phase_3wire
        (m1 + m3)
      elsif power_configuration == :three_phase_4wire
        (m1 + m2 + m3)
      end
    end
743698
def *(other)
      case other
      when Unit
        raise ArgumentError, 'Cannot multiply by temperatures' if [other, self].any?(&:temperature?)
        opts = RubyUnits::Unit.eliminate_terms(@scalar * other.scalar, @numerator + other.numerator, @denominator + other.denominator)
        opts[:signature] = @signature + other.signature
        RubyUnits::Unit.new(opts)
      when Numeric
        RubyUnits::Unit.new(scalar: @scalar * other, numerator: @numerator, denominator: @denominator, signature: @signature)
      else
        x, y = coerce(other)
        x * y
      end
    end
1163447
function getMaterialData (data, materialData) {
  materialData.color.set(data.color);
  materialData.emissive.set(data.emissive);
  materialData.emissiveIntensity = data.emissiveIntensity;
  materialData.fog = data.fog;
  materialData.metalness = data.metalness;
  materialData.roughness = data.roughness;
  materialData.wireframe = data.wireframe;
  materialData.wireframeLinewidth = data.wireframeLinewidth;

  if (data.normalMap) { materialData.normalScale = data.normalScale; }

  if (data.ambientOcclusionMap) {
    materialData.aoMapIntensity = data.ambientOcclusionMapIntensity;
  }

  if (data.displacementMap) {
    materialData.displacementScale = data.displacementScale;
    materialData.displacementBias = data.displacementBias;
  }

  return materialData;
}
345621
def value(self, units=None):
        """"""
        if units is None:
            return self._value

        if not units.upper() in CustomPressure.legal_units:
            raise UnitsError("unrecognized pressure unit: '" + units + "'")
        units = units.upper()
        if units == self._units:
            return self._value
        if self._units == "IN":
            mb_value = self._value * 33.86398
        elif self._units == "MM":
            mb_value = self._value * 1.3332239
        else:
            mb_value = self._value
        if units in ("MB", "HPA"):
            return mb_value
        if units == "IN":
            return mb_value / 33.86398
        if units == "MM":
            return mb_value / 1.3332239

        raise UnitsError("unrecognized pressure unit: '" + units + "'")
1120598
private int coding(final int coding) throws KNXFormatException
	{
		if (coding < 0 || coding > 0xff)
			throw new KNXIllegalArgumentException("coding " + binary(coding) + " out of range [0..0xff]");

		final String desc;
		final String unit;
		int exp = 0;

		final int vifExtensionBit = 0b10000000;
		if ((coding & vifExtensionBit) == 0) {
			final int vifMask = 0b11111000;
			final int id = coding & vifMask;
			final int n = coding & ~vifMask;

			if (id == 0b00000000) { // 0.001 Wh to 10 000 Wh
				desc = "energy";
				unit = "Wh";
				exp = n - 3;
			}
			else if (id == 0b00001000) { // 0.001 kJ to 10 000 kJ
				desc = "energy";
				unit = "J";
				exp = n;
			}
			else if (id == 0b00010000) { // 0.001 l to 10000 l
				desc = "volume";
				unit = "m³";
				exp = n - 6;
			}
			else if (id == 0b00011000) { // 0.001 kg to 10 000 kg
				desc = "mass";
				unit = "kg";
				exp = n - 3;
			}
			else if (id == 0b00101000) { // 0.001 W to 10000 W
				desc = "power";
				unit = "W";
				exp = n - 3;
			}
			else if (id == 0b00110000) { // 0.001 kJ/h to 10 000 kJ/h
				desc = "power";
				unit = "J/h";
				exp = n;
			}
			else if (id == 0b00111000) { // 0.001 l/h to 10 000 l/h
				desc = "volume flow";
				unit = "m³/h";
				exp = n - 6;
			}
			else if (id == 0b01000000) { // 0.0001 l/min to 1000 l/min
				desc = "volume flow";
				unit = "m³/min";
				exp = n - 7;
			}
			else if (id == 0b01001000) { // 0.001 ml/s to 10000 ml/s
				desc = "volume flow";
				unit = "m³/sec";
				exp = n - 9;
			}
			else if (id == 0b01010000) { // 0.001 kg/h to 10000 kg/h
				desc = "mass flow";
				unit = "kg/h";
				exp = n - 3;
			}
			else if (coding == 0b01101110) { // dimensionless
				desc = "units for HCA";
				unit = "";
			}
			else
				throw newException("reserved coding", binary(coding));
		}
		else {
			final int vifExtMask = 0b11111110;
			final int id = coding & vifExtMask;
			final int n = coding & ~vifExtMask;

			if (id == 0b10000000) { // 0.1 MWh to 1 MWh
				desc = "energy";
				unit = "Wh";
				exp = n + 5;
			}
			else if (id == 0b10001000) { // 0.1 GJ to 1 GJ
				desc = "energy";
				unit = "J";
				exp = n + 8;
			}
			else if (id == 0b10101000) { // 0.1 MW to 1 MW
				desc = "power";
				unit = "W";
				exp = n + 5;
			}
			else if (id == 0b10110000) { // 0.1 GJ/h to 1 GJ/h
				desc = "power";
				unit = "J/h";
				exp = n + 8;
			}
			else if (coding == dimensionlessCounter) {
				desc = "dimensionless counter";
				unit = "";
			}
			else
				throw newException("reserved coding", binary(coding));
		}

		description = desc;
		this.unit = unit;
		return exp;
	}
342339
function determineStepSize(min, max, unit, capacity) {
	var range = max - min;
	var interval = INTERVALS[unit];
	var milliseconds = interval.size;
	var steps = interval.steps;
	var i, ilen, factor;

	if (!steps) {
		return Math.ceil(range / (capacity * milliseconds));
	}

	for (i = 0, ilen = steps.length; i < ilen; ++i) {
		factor = steps[i];
		if (Math.ceil(range / (milliseconds * factor)) <= capacity) {
			break;
		}
	}

	return factor;
}
18073
def diam_kolmogorov(EnergyDis, Temp, ConcAl, ConcClay, coag, material,
                    DIM_FRACTAL):
    
    return (material.Diameter
            * ((eta_kolmogorov(EnergyDis, Temp).magnitude / material.Diameter)
               * ((6 * frac_vol_floc_initial(ConcAl, ConcClay, coag, material))
                  / np.pi
                  )**(1/3)
               )**(3 / DIM_FRACTAL)
            )
478755
public static EntropyStats entropy(SparseMatrix m) {
        double sum = 0;
        double[] colSums = new double[m.columns()];
        double[] rowSums = new double[m.rows()];
        for (int r = 0; r < m.rows(); ++r) {
            SparseDoubleVector sv = m.getRowVector(r);
            for (int c : sv.getNonZeroIndices()) {
                double v = m.get(r, c);
                sum += v;
                colSums[c] += v;
                rowSums[r] += v;
            }
        }

        double entropy = 0;
        double[] colEntropy = new double[m.columns()];
        double[] rowEntropy = new double[m.rows()];
        for (int r = 0; r < m.rows(); ++r) {
            SparseDoubleVector sv = m.getRowVector(r);
            for (int c : sv.getNonZeroIndices()) {
                double v = m.get(r, c);
                entropy -= entropy(v, sum);
                colEntropy[c] -= entropy(v, colSums[c]);
                rowEntropy[r] -= entropy(v, rowSums[r]);
            }
        }
        return new EntropyStats(entropy, colEntropy, rowEntropy);
    }
294511
def temperature(self, what):
        """"""
        self._temperature = units.validate_quantity(what, u.K)
1367646
def temperature(temp: Number, unit: str = 'C') -> str:
    
    unit = unit.upper()
    if not (temp and unit in ('C', 'F')):
        return ''
    if unit == 'C':
        converted = temp.value * 1.8 + 32
        converted = str(int(round(converted))) + '°F'  # type: ignore
    elif unit == 'F':
        converted = (temp.value - 32) / 1.8
        converted = str(int(round(converted))) + '°C'  # type: ignore
    return f'{temp.value}°{unit} ({converted})'
79347
def K(self):
        """"""
        K1 = np.float_power(pi, 0.5 * self.n_min * self.n_min)
        K1 /= (
            np.float_power(2, 0.5 * self.n_min * self._n_max)
            * self._mgamma(0.5 * self._n_max, self.n_min)
            * self._mgamma(0.5 * self.n_min, self.n_min)
        )

        K2 = np.float_power(
            2, self.alpha * self.size + 0.5 * self.size * (self.size + 1)
        )
        for i in xrange(self.size):
            K2 *= gamma(self.alpha + i + 1)
        return K1 * K2
193140
def energy_density(self, strain, convert_GPa_to_eV=True):
        
        return sum([c.energy_density(strain, convert_GPa_to_eV)
                    for c in self])
76275
def semimajor(P,M):
    
    if type(P) != Quantity:
        P = P*u.day
    if type(M) != Quantity:
        M = M*u.M_sun
    a = ((P/2/np.pi)**2*const.G*M)**(1./3)
    return a.to(u.AU)
510881
def asdensity(self) -> 'Density':
        """"""
        matrix = bk.outer(self.tensor, bk.conj(self.tensor))
        return Density(matrix, self.qubits, self._memory)
1369181
def _get_distance_term(self, C, rjb, mag):
        
        c_3 = self._get_anelastic_coeff(C)
        rval = np.sqrt(rjb ** 2. + C["h"] ** 2.)
        return (C["c1"] + C["c2"] * (mag - self.CONSTS["Mref"])) *\
            np.log(rval / self.CONSTS["Rref"]) +\
            c_3 * (rval - self.CONSTS["Rref"])