diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 37c4d8e..456d267 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -51,6 +51,23 @@ repos: # - id: sort-simple-yaml - id: trailing-whitespace + - repo: https://github.com/igorshubovych/markdownlint-cli + rev: v0.33.0 + hooks: + - id: markdownlint + args: ["--disable", "MD013"] + + # - repo: https://github.com/markdownlint/markdownlint + # rev: v0.12.0 + # hooks: + # - id: markdownlint + + - repo: https://github.com/charliermarsh/ruff-pre-commit + rev: "v0.0.257" + hooks: + - id: ruff + args: [--fix, --exit-non-zero-on-fix] + - repo: https://github.com/asottile/add-trailing-comma rev: v2.4.0 hooks: @@ -141,16 +158,5 @@ repos: # hooks: # - id: codespell - - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.33.0 - hooks: - - id: markdownlint - args: ["--disable", "MD013"] - - # - repo: https://github.com/markdownlint/markdownlint - # rev: v0.12.0 - # hooks: - # - id: markdownlint - default_language_version: python: python3.10 diff --git a/1fetch.py b/1fetch.py index 3f32b02..a12c0ff 100755 --- a/1fetch.py +++ b/1fetch.py @@ -35,11 +35,11 @@ def fetch_data_summaries() -> None: print(f"fetching {data_summary_set} data") # url = "https://api.ouraring.com/v1/sleep" # -> last week - url = f"https://api.ouraring.com/v1/{data_summary_set}?start={config['date_start']}" + url = f"https://api.ouraring.com/v1/{data_summary_set}?start={config['date_start']}" # noqa: E501 # start=YYYY-MM-DD # end=YYYY-MM-DD headers = { - # "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0 ", + # "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0 ", # noqa: E501 "Authorization": f"Bearer {token}", } cont = requests.get(url, headers=headers, timeout=3).content diff --git a/2analyze.py b/2analyze.py index 9fe4ff0..aa0ebcd 100755 --- a/2analyze.py +++ b/2analyze.py @@ -85,7 +85,8 @@ def prep_data_sleep() -> pd.DataFrame: df["time to fall asleep"] = df["onset_latency"] / 60 - # df["time to fall asleep"].where(df["time to fall asleep"] > 100, 100, inplace=True) + # df["time to fall asleep"].where(df["time to fall asleep"] + # > 100, 100, inplace=True) df["time awake"] = df["awake"] / 60