hszinc/pintutil.py
def define_haystack_units():
    """
    Missing units found in project-haystack
    Added to the registry
    """
    ureg = UnitRegistry()
    ureg.define('% = [] = percent')
    ureg.define('pixel = [] = px = dot = picture_element = pel')
    ureg.define('decibel = [] = dB')
    ureg.define('ppu = [] = parts_per_unit')
    ureg.define('ppm = [] = parts_per_million')
    ureg.define('ppb = [] = parts_per_billion')
    ureg.define('%RH = [] = percent_relative_humidity = percentRH')
    ureg.define('cubic_feet = ft ** 3 = cu_ft')
    ureg.define('cfm = cu_ft * minute = liter_per_second / 0.4719475')
    ureg.define('cfh = cu_ft * hour')
    ureg.define('cfs = cu_ft * second')
    ureg.define('VAR = volt * ampere')
    ureg.define('kVAR = 1000 * volt * ampere')
    ureg.define('MVAR = 1000000 * volt * ampere')
    ureg.define('inH2O = in_H2O')
    ureg.define('dry_air = []')
    ureg.define('gas = []')
    ureg.define('energy_efficiency_ratio = [] = EER')
    ureg.define('coefficient_of_performance = [] = COP')
    ureg.define('data_center_infrastructure_efficiency = [] = DCIE')
    ureg.define('power_usage_effectiveness = [] = PUE')
    ureg.define('formazin_nephelometric_unit = [] = fnu')
    ureg.define('nephelometric_turbidity_units = [] = ntu')
    ureg.define('power_factor = [] = PF')
    ureg.define('degree_day_celsius = [] = degdaysC')
    ureg.define('degree_day_farenheit = degree_day_celsius * 9 / 5 = degdaysF')
    ureg.define('footcandle = lumen / sq_ft = ftcd')
    ureg.define('Nm = newton * meter')
    ureg.define('%obsc = [] = percent_obscuration = percentobsc')
    ureg.define('cycle = []')
    ureg.define('cph = cycle / hour')
    ureg.define('cpm = cycle / minute')
    ureg.define('cps = cycle / second')
    ureg.define('hecto_cubic_foot = 100 * cubic_foot')
    ureg.define('tenths_second = second / 10')
    ureg.define('hundredths_second = second / 100')

    #ureg.define('irradiance = W / sq_meter = irr')
    # In the definition of project haystack, there's a redundancy as irr = W/m^2
    # no need to use : watts_per_square_meter_irradiance
    
    # CURRENCY
    # I know...we won'T be able to convert right now !
    ureg.define('australian_dollar = [] = AUD')
    ureg.define('british_pound = [] = GBP = £')
    ureg.define('canadian_dollar = [] = CAD')
    ureg.define('chinese_yuan = [] = CNY = 元')
    ureg.define('emerati_dirham = [] = AED')
    ureg.define('euro = [] = EUR = €')
    ureg.define('indian_rupee = [] = INR = ₹')
    ureg.define('japanese_yen = [] = JPY = ¥')
    ureg.define('russian_ruble = [] = RUB = руб')
    ureg.define('south_korean_won = [] = KRW = ₩')
    ureg.define('swedish_krona = [] = SEK = kr')
    ureg.define('swiss_franc = [] = CHF = Fr')
    ureg.define('taiwan_dollar = [] = TWD')
    ureg.define('us_dollar = [] = USD = $')
    ureg.define('new_israeli_shekel = [] = NIS')

    return ureg
def define_haystack_units():
    """
    Missing units found in project-haystack
    Added to the registry
    """
    ureg = UnitRegistry()
    ureg.define('% = [] = percent')
    ureg.define('pixel = [] = px = dot = picture_element = pel')
    ureg.define('decibel = [] = dB')
    ureg.define('ppu = [] = parts_per_unit')
    ureg.define('ppm = [] = parts_per_million')
    ureg.define('ppb = [] = parts_per_billion')
    ureg.define('%RH = [] = percent_relative_humidity = percentRH')
    ureg.define('cubic_feet = ft ** 3 = cu_ft')
    ureg.define('cfm = cu_ft * minute = liter_per_second / 0.4719475')
    ureg.define('cfh = cu_ft * hour')
    ureg.define('cfs = cu_ft * second')
    ureg.define('VAR = volt * ampere')
    ureg.define('kVAR = 1000 * volt * ampere')
    ureg.define('MVAR = 1000000 * volt * ampere')
    ureg.define('inH2O = in_H2O')
    ureg.define('dry_air = []')
    ureg.define('gas = []')
    ureg.define('energy_efficiency_ratio = [] = EER')
    ureg.define('coefficient_of_performance = [] = COP')
    ureg.define('data_center_infrastructure_efficiency = [] = DCIE')
    ureg.define('power_usage_effectiveness = [] = PUE')
    ureg.define('formazin_nephelometric_unit = [] = fnu')
    ureg.define('nephelometric_turbidity_units = [] = ntu')
    ureg.define('power_factor = [] = PF')
    ureg.define('degree_day_celsius = [] = degdaysC')
    ureg.define('degree_day_farenheit = degree_day_celsius * 9 / 5 = degdaysF')
    ureg.define('footcandle = lumen / sq_ft = ftcd')
    ureg.define('Nm = newton * meter')
    ureg.define('%obsc = [] = percent_obscuration = percentobsc')
    ureg.define('cycle = []')
    ureg.define('cph = cycle / hour')
    ureg.define('cpm = cycle / minute')
    ureg.define('cps = cycle / second')
    ureg.define('hecto_cubic_foot = 100 * cubic_foot')
    ureg.define('tenths_second = second / 10')
    ureg.define('hundredths_second = second / 100')

    #ureg.define('irradiance = W / sq_meter = irr')
    # In the definition of project haystack, there's a redundancy as irr = W/m^2
    # no need to use : watts_per_square_meter_irradiance
    
    # CURRENCY
    # I know...we won'T be able to convert right now !
    ureg.define('australian_dollar = [] = AUD')
    ureg.define('british_pound = [] = GBP = £')
    ureg.define('canadian_dollar = [] = CAD')
    ureg.define('chinese_yuan = [] = CNY = 元')
    ureg.define('emerati_dirham = [] = AED')
    ureg.define('euro = [] = EUR = €')
    ureg.define('indian_rupee = [] = INR = ₹')
    ureg.define('japanese_yen = [] = JPY = ¥')
    ureg.define('russian_ruble = [] = RUB = руб')
    ureg.define('south_korean_won = [] = KRW = ₩')
    ureg.define('swedish_krona = [] = SEK = kr')
    ureg.define('swiss_franc = [] = CHF = Fr')
    ureg.define('taiwan_dollar = [] = TWD')
    ureg.define('us_dollar = [] = USD = $')
    ureg.define('new_israeli_shekel = [] = NIS')

    return ureg
def define_haystack_units ( ) : ureg = UnitRegistry ( ) ureg . define ( '% = [] = percent' ) ureg . define ( 'pixel = [] = px = dot = picture_element = pel' ) ureg . define ( 'decibel = [] = dB' ) ureg . define ( 'ppu = [] = parts_per_unit' ) ureg . define ( 'ppm = [] = parts_per_million' ) ureg . define ( 'ppb = [] = parts_per_billion' ) ureg . define ( '%RH = [] = percent_relative_humidity = percentRH' ) ureg . define ( 'cubic_feet = ft ** 3 = cu_ft' ) ureg . define ( 'cfm = cu_ft * minute = liter_per_second / 0.4719475' ) ureg . define ( 'cfh = cu_ft * hour' ) ureg . define ( 'cfs = cu_ft * second' ) ureg . define ( 'VAR = volt * ampere' ) ureg . define ( 'kVAR = 1000 * volt * ampere' ) ureg . define ( 'MVAR = 1000000 * volt * ampere' ) ureg . define ( 'inH2O = in_H2O' ) ureg . define ( 'dry_air = []' ) ureg . define ( 'gas = []' ) ureg . define ( 'energy_efficiency_ratio = [] = EER' ) ureg . define ( 'coefficient_of_performance = [] = COP' ) ureg . define ( 'data_center_infrastructure_efficiency = [] = DCIE' ) ureg . define ( 'power_usage_effectiveness = [] = PUE' ) ureg . define ( 'formazin_nephelometric_unit = [] = fnu' ) ureg . define ( 'nephelometric_turbidity_units = [] = ntu' ) ureg . define ( 'power_factor = [] = PF' ) ureg . define ( 'degree_day_celsius = [] = degdaysC' ) ureg . define ( 'degree_day_farenheit = degree_day_celsius * 9 / 5 = degdaysF' ) ureg . define ( 'footcandle = lumen / sq_ft = ftcd' ) ureg . define ( 'Nm = newton * meter' ) ureg . define ( '%obsc = [] = percent_obscuration = percentobsc' ) ureg . define ( 'cycle = []' ) ureg . define ( 'cph = cycle / hour' ) ureg . define ( 'cpm = cycle / minute' ) ureg . define ( 'cps = cycle / second' ) ureg . define ( 'hecto_cubic_foot = 100 * cubic_foot' ) ureg . define ( 'tenths_second = second / 10' ) ureg . define ( 'hundredths_second = second / 100' ) #ureg.define('irradiance = W / sq_meter = irr') # In the definition of project haystack, there's a redundancy as irr = W/m^2 # no need to use : watts_per_square_meter_irradiance # CURRENCY # I know...we won'T be able to convert right now ! ureg . define ( 'australian_dollar = [] = AUD' ) ureg . define ( 'british_pound = [] = GBP = £') ureg . define ( 'canadian_dollar = [] = CAD' ) ureg . define ( 'chinese_yuan = [] = CNY = 元') ureg . define ( 'emerati_dirham = [] = AED' ) ureg . define ( 'euro = [] = EUR = €') ureg . define ( 'indian_rupee = [] = INR = ₹') ureg . define ( 'japanese_yen = [] = JPY = ¥') ureg . define ( 'russian_ruble = [] = RUB = руб') ureg . define ( 'south_korean_won = [] = KRW = ₩') ureg . define ( 'swedish_krona = [] = SEK = kr' ) ureg . define ( 'swiss_franc = [] = CHF = Fr' ) ureg . define ( 'taiwan_dollar = [] = TWD' ) ureg . define ( 'us_dollar = [] = USD = $' ) ureg . define ( 'new_israeli_shekel = [] = NIS' ) return ureg
Missing units found in project-haystack
    Added to the registry
Missing units found in project - haystack Added to the registry