Coverage for /Users/andrewkaiser/Documents/GradSchool/Research/gwent/gwent/utils.py : 90%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
"""Convenience function to intialize a parameter as an astropy quantity.
Parameters ---------- param : float, or Astropy Quantity Parameter to initialize default_unit : str Astropy unit string, sets as default for param.
Returns ------- an astropy quantity
Examples -------- self.f0 = make_quant(f0,'MHz')
Notes ----- Taken from <https://github.com/Hazboun6/hasasia/blob/master/hasasia/sensitivity.py#L834>
""" "Quantity {0} with incompatible unit {1}".format(param, default_unit) ) else:
"""Updates and initializes variable dictionaries used to keep track of current values and variable minima and maxima.
Parameters ---------- obj : object Instance of class with parameter variables value : array-like value(s) that are assigned into dictionary
Notes ----- value contains the variable name in the first index the next is the current value of the variable the last two are optional and contain the variable min and max
Examples -------- obj.var_dict = ['M',value] where obj is in this case an instance of a BinaryBlackHole
""" else:
raise ValueError(LenError_1()) isinstance(vals[0], (float, int, u.Quantity)) and isinstance(vals[1], (float, int, u.Quantity)) and isinstance(vals[2], (float, int, u.Quantity)) ): "val": vals[0], "min": vals[1], "max": vals[2], "sampled": False, } else: isinstance(no_unit_vals, (list, np.ndarray)) and len(no_unit_vals) != 3 ): else: "val": vals, "min": None, "max": None, "sampled": True, } else: "val": vals, "min": None, "max": None, "sampled": False, } else: raise ValueError(LenError_2()) else: raise ValueError(LenError_2())
else: "val": vals, "min": None, "max": None, "sampled": False, } else: else: raise ValueError(DictError_Full()) else:
- A name and value in a list (ie. ["name",val]), or \n\ - A name, a value, a minimum value, and maximum value in a list (ie. ["name",val,min,max]), \n\ where where name is a string, and val,min,and max are either floats, ints, or an astropy Quantity.'
where name is a string, and val, min, and max are either floats, ints, or astropy Quantities.'
where name is a string, and val is either a float, an int, or an astropy Quantity.'
return "Could not tell if values are pulsar values or min/maxes. Try using more than 3 pulsars."
return "To assign an array of values, it must be either [min,max], or an array of individual pulsar parameters of length n_p." |