Skip to content

Commit

Permalink
ruff and fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
entorb committed Mar 18, 2023
1 parent dd8b7e4 commit 4bc69ee
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
28 changes: 17 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions 1fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion 2analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 4bc69ee

Please sign in to comment.