"llmdeploy/serve/vscode:/vscode.git/clone" did not exist on "cb8ac1b08b405c3d80806b990247af8a7a9d3ed4"
Commit 252e2d2e authored by Chris Shallue's avatar Chris Shallue Committed by Christopher Shallue
Browse files

Update formatting.

PiperOrigin-RevId: 213963765
parent 9d0f41b7
...@@ -124,5 +124,5 @@ class MedianFilterTest(absltest.TestCase): ...@@ -124,5 +124,5 @@ class MedianFilterTest(absltest.TestCase):
np.testing.assert_array_equal([7, 1, 5, 2, 3], result) np.testing.assert_array_equal([7, 1, 5, 2, 3], result)
if __name__ == '__main__': if __name__ == "__main__":
absltest.main() absltest.main()
...@@ -138,8 +138,8 @@ def interpolate_missing_time(time, cadence_no=None, fill_value="extrapolate"): ...@@ -138,8 +138,8 @@ def interpolate_missing_time(time, cadence_no=None, fill_value="extrapolate"):
time: A numpy array of monotonically increasing values, with missing values time: A numpy array of monotonically increasing values, with missing values
denoted by NaN or Inf. denoted by NaN or Inf.
cadence_no: Optional numpy array of cadence numbers corresponding to the cadence_no: Optional numpy array of cadence numbers corresponding to the
time values. If not provided, missing time values are assumed to be time values. If not provided, missing time values are assumed to be evenly
evenly spaced between present time values. spaced between present time values.
fill_value: Specifies how missing time values should be treated at the fill_value: Specifies how missing time values should be treated at the
beginning and end of the array. See scipy.interpolate.interp1d. beginning and end of the array. See scipy.interpolate.interp1d.
...@@ -186,8 +186,8 @@ def interpolate_masked_spline(all_time, all_masked_time, all_masked_spline): ...@@ -186,8 +186,8 @@ def interpolate_masked_spline(all_time, all_masked_time, all_masked_spline):
points linearly interpolated. points linearly interpolated.
""" """
interp_spline = [] interp_spline = []
for time, masked_time, masked_spline in zip( for time, masked_time, masked_spline in zip(all_time, all_masked_time,
all_time, all_masked_time, all_masked_spline): all_masked_spline):
if masked_time.size: if masked_time.size:
interp_spline.append(np.interp(time, masked_time, masked_spline)) interp_spline.append(np.interp(time, masked_time, masked_spline))
else: else:
......
...@@ -124,8 +124,8 @@ class SplineMetadata(object): ...@@ -124,8 +124,8 @@ class SplineMetadata(object):
bad_bkspaces: List of break-point spacing values that failed. bad_bkspaces: List of break-point spacing values that failed.
likelihood_term: The likelihood term of the Bayesian Information Criterion; likelihood_term: The likelihood term of the Bayesian Information Criterion;
-2*ln(L), where L is the likelihood of the data given the model. -2*ln(L), where L is the likelihood of the data given the model.
penalty_term: The penalty term for the number of parameters in the penalty_term: The penalty term for the number of parameters in the Bayesian
Bayesian Information Criterion. Information Criterion.
bic: The value of the Bayesian Information Criterion; equal to bic: The value of the Bayesian Information Criterion; equal to
likelihood_term + penalty_coeff * penalty_term. likelihood_term + penalty_coeff * penalty_term.
""" """
...@@ -165,12 +165,11 @@ def choose_kepler_spline(all_time, ...@@ -165,12 +165,11 @@ def choose_kepler_spline(all_time,
maxiter: Maximum number of attempts to fit each spline after removing badly maxiter: Maximum number of attempts to fit each spline after removing badly
fit points. fit points.
penalty_coeff: Coefficient of the penalty term for using more parameters in penalty_coeff: Coefficient of the penalty term for using more parameters in
the Bayesian Information Criterion. Decreasing this value will allow the Bayesian Information Criterion. Decreasing this value will allow more
more parameters to be used (i.e. smaller break-point spacing), and parameters to be used (i.e. smaller break-point spacing), and vice-versa.
vice-versa.
verbose: Whether to log individual spline errors. Note that if bkspaces verbose: Whether to log individual spline errors. Note that if bkspaces
contains many values (particularly small ones) then this may cause contains many values (particularly small ones) then this may cause logging
logging pollution if calling this function for many light curves. pollution if calling this function for many light curves.
Returns: Returns:
spline: List of numpy arrays; values of the best-fit spline corresponding to spline: List of numpy arrays; values of the best-fit spline corresponding to
...@@ -297,12 +296,11 @@ def fit_kepler_spline(all_time, ...@@ -297,12 +296,11 @@ def fit_kepler_spline(all_time,
maxiter: Maximum number of attempts to fit each spline after removing badly maxiter: Maximum number of attempts to fit each spline after removing badly
fit points. fit points.
penalty_coeff: Coefficient of the penalty term for using more parameters in penalty_coeff: Coefficient of the penalty term for using more parameters in
the Bayesian Information Criterion. Decreasing this value will allow the Bayesian Information Criterion. Decreasing this value will allow more
more parameters to be used (i.e. smaller break-point spacing), and parameters to be used (i.e. smaller break-point spacing), and vice-versa.
vice-versa.
verbose: Whether to log individual spline errors. Note that if bkspaces verbose: Whether to log individual spline errors. Note that if bkspaces
contains many values (particularly small ones) then this may cause contains many values (particularly small ones) then this may cause logging
logging pollution if calling this function for many light curves. pollution if calling this function for many light curves.
Returns: Returns:
spline: List of numpy arrays; values of the best-fit spline corresponding to spline: List of numpy arrays; values of the best-fit spline corresponding to
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment