Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.12.3"
rev: "v0.12.5"
hooks:
# id: ruff-check would go here if using both
- id: ruff-format
Expand Down
12 changes: 5 additions & 7 deletions src/lightcurves/LC.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ def get_gti_iis(
if n_pick:
# only consider the n_pick longest GTIs
# TBD: double check, might compute index differences, not time gaps..
gap_len = np.array([t - s for s, t in zip(GTI_start_ii, GTI_end_ii, strict=False)])
gap_len = np.array(
[t - s for s, t in zip(GTI_start_ii, GTI_end_ii, strict=False)]
)
gap_len1 = np.sort(gap_len)
ii = [x for x in range(len(gap_len)) if gap_len[x] in gap_len1[-n_pick:]]
# n_gaps = considered gaps (longest not gaps)
Expand Down Expand Up @@ -332,9 +334,7 @@ def __repr__(self):
def __len__(self):
return len(self.time)

def __getitem__(
self, inbr: int | slice | list[int]
) -> np.ndarray | LightCurve:
def __getitem__(self, inbr: int | slice | list[int]) -> np.ndarray | LightCurve:
"""
Access elements or subsets of the LightCurve using indexing or slicing.
Expand Down Expand Up @@ -583,9 +583,7 @@ def plot_shade(
y1 = np.ones(len(x)) * np.min(self.flux)
ax.fill_between(x, y, y1, step="mid", alpha=0.2, zorder=0, **kwargs)

def plot_grid(
self, spacing: float = 10, ax: Axes | None = None, **kwargs
) -> None:
def plot_grid(self, spacing: float = 10, ax: Axes | None = None, **kwargs) -> None:
"""
Add a minor grid to the time axis at specified spacing.
Expand Down