Skip to content

Commit

Permalink
More ruff fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadair committed Mar 6, 2024
1 parent e2c1ebe commit 83de1d6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/changelog_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
and the second top level heading.
"""
import io
import sys
import json
import sys

if __name__ == '__main__':
input_stream = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8')
Expand Down
8 changes: 4 additions & 4 deletions dkist/net/attrs_values.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"Functions for working with the net submodule"
import json
import urllib
import datetime as dt
import importlib.resources
import json
import urllib
from pathlib import Path

import platformdirs
Expand Down Expand Up @@ -118,7 +118,7 @@ def attempt_local_update(*, timeout: int = 1, user_file: Path = None, silence_er

# Test that the file we just saved can be parsed as json
try:
with open(user_file, "r") as f:
with open(user_file) as f:
json.load(f)
except Exception:
log.error("Downloaded file is not valid JSON.")
Expand Down Expand Up @@ -158,7 +158,7 @@ def get_search_attrs_values(*, allow_update: bool = True, timeout: int = 1) -> d
log.debug("No update to attr values needed.")
log.debug("Using attr values from %s", local_path)

with open(local_path, "r") as f:
with open(local_path) as f:
search_values = json.load(f)

search_values = {param["parameterName"]: param["values"] for param in search_values["parameterValues"]}
Expand Down
16 changes: 10 additions & 6 deletions dkist/net/tests/test_attrs_values.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import os
import json
import shutil
import logging
import datetime
import importlib
import json
import logging
import os
import shutil
from platform import system

import platformdirs
Expand All @@ -12,8 +12,12 @@
from sunpy.net import attrs as a

import dkist.data
from dkist.net.attrs_values import (_fetch_values_to_file, _get_cached_json,
attempt_local_update, get_search_attrs_values)
from dkist.net.attrs_values import (
_fetch_values_to_file,
_get_cached_json,
attempt_local_update,
get_search_attrs_values,
)

PACKAGE_FILE = importlib.resources.files(dkist.data) / "api_search_values.json"

Expand Down

0 comments on commit 83de1d6

Please sign in to comment.