22
33import logging
44import pickle
5+ from pathlib import Path
56
67import astropy
78import astropy .stats .bayesian_blocks as bblocks
89import numpy as np
910from matplotlib import pyplot as plt
1011from matplotlib .axes import Axes # for type hints only
11- from pathlib import Path
12-
1312
1413# https://docs.astropy.org/en/stable/api/astropy.stats.bayesian_blocks.html
1514import lightcurves .HopFinder as hf
@@ -37,7 +36,8 @@ def load_lc(path: str | Path) -> LightCurve:
3736 with path .open ("rb" ) as f :
3837 return pickle .load (f )
3938
40- '''
39+
40+ '''
4141this following is exactly like the previous one.. might not be necessary
4242def load_lc_npy(path: str | Path) -> LightCurve:
4343 """
@@ -52,6 +52,7 @@ def load_lc_npy(path: str | Path) -> LightCurve:
5252 return pickle.load(f)
5353'''
5454
55+
5556def load_lc_csv (path : str ) -> LightCurve :
5657 """
5758 Load a pickled LightCurve instance from a CSV file saved with `save_csv()`.
@@ -153,8 +154,8 @@ def clean_data(
153154 ts_ = ts [nan_mask ]
154155 ts_clean = ts_ [time_unique_id ]
155156 return (time_unique , flux_clean , flux_error_clean , ts_clean )
156- else :
157- return ( time_unique , flux_clean , flux_error_clean , None )
157+ return ( time_unique , flux_clean , flux_error_clean , None )
158+
158159
159160def get_gti_iis (
160161 time : np .ndarray , n_gaps : int , n_pick : int | None
@@ -316,7 +317,7 @@ def __init__(
316317 friendly_error = "Input arrays do not have same length"
317318 raise ValueError (friendly_error )
318319 if len (flux [np .isnan (flux )]) > 0 or len (flux_error [np .isnan (flux_error )]) > 0 :
319- friendly_error = "flux or flux_error contain np.nan values"
320+ friendly_error = "flux or flux_error contain np.nan values"
320321 raise TypeError (friendly_error )
321322 if len (time ) != len (np .unique (time )):
322323 friendly_error = "time contains duplicate values"
@@ -422,7 +423,7 @@ def save_npy(self, path: str) -> None:
422423 Use `load_lc_npy()` to read this file.
423424 This does not update `LC.py`, it saves current object state.
424425 TBD: actaully since this is an object it just saves a pickle that could be called .npy
425- the save npy business needs to be revisited I think it might be nonesense
426+ the save npy business needs to be revisited I think it might be nonesense
426427 """
427428 path = Path (path )
428429 with path .open ("wb" ) as pickle_file :
0 commit comments