ararpy 0.1.1__py3-none-any.whl → 0.1.12__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ararpy/calc/arr.py CHANGED
@@ -499,6 +499,8 @@ def transpose(obj, ignore: bool = True):
499
499
 
500
500
  """
501
501
  try:
502
+ if len(obj) == 0:
503
+ return obj
502
504
  if not is_twoD(obj):
503
505
  raise ValueError("The requested object is not two dimensional.")
504
506
  obj = obj if is_homo(obj) else homo(obj)
ararpy/calc/corr.py CHANGED
@@ -30,6 +30,18 @@ def blank(a0: list, e0: list, a1: list, e1: list):
30
30
  return arr.sub((a0, e0), (a1, e1))
31
31
 
32
32
 
33
+ def gain(a0: list, e0: list, a1: list, e1: list):
34
+ """
35
+ :param a0: a list of tested isotope value
36
+ :param e0: 1 sigma error of a0, list type
37
+ :param a1: a list of blank isotope value
38
+ :param e1: 1 sigma error of a1, list type
39
+ :return: list of corrected data | error list
40
+ """
41
+ # Do not force negative value to zero in correcting blank...
42
+ return arr.div((a0, e0), (a1, e1))
43
+
44
+
33
45
  def mdf(rm: float, srm: float, m1: float, m2: float, ra: float = 298.56,
34
46
  sra: float = 0):
35
47
  """
ararpy/calc/isochron.py CHANGED
@@ -134,7 +134,7 @@ def get_ellipse(x: float, sx: float, y: float, sy: float, r: float, plt_sfactor:
134
134
  return ellipse_points
135
135
 
136
136
 
137
- def get_line_points(xscale, yscale, coeffs=None):
137
+ def get_line_points(xscale, yscale, coeffs):
138
138
  """
139
139
 
140
140
  Parameters
@@ -147,7 +147,9 @@ def get_line_points(xscale, yscale, coeffs=None):
147
147
  -------
148
148
  List of data points
149
149
  """
150
-
150
+ xscale = [float(i) for i in xscale]
151
+ yscale = [float(i) for i in yscale]
152
+ coeffs = [float(i) for i in coeffs]
151
153
  if not isinstance(coeffs, list) or len(coeffs) < 2:
152
154
  raise ValueError(f"Coeffs should be a list with length with 2.")
153
155
  get_y = lambda x: coeffs[0] + coeffs[1] * x