Skip to content

Commit

Permalink
ruff check fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alphasentaurii committed Sep 17, 2024
1 parent 25c6092 commit ef36b3f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion spacekit/analyzer/explore.py
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ def atomic_vector_plotter(
x_units = x_units

# Scatter Plot
if type(signal) == np.array:
if isinstance(signal, np.array):
series_index = list(range(len(signal)))

converted_array = pd.Series(signal.ravel(), index=series_index)
Expand Down
2 changes: 1 addition & 1 deletion spacekit/extractor/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def split_arrays(self, data, t=0.6, v=0.85):
arrays
split sampled arrays
"""
if type(data) == pd.DataFrame:
if isinstance(data, pd.DataFrame):
sample = data.sample(frac=1)
else:
sample = data
Expand Down
8 changes: 3 additions & 5 deletions spacekit/extractor/scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import csv
from zipfile import ZipFile
from astropy.io import fits, ascii
from astropy.table import Table
from botocore.config import Config
from decimal import Decimal
from boto3.dynamodb.conditions import Attr
Expand Down Expand Up @@ -1428,18 +1429,15 @@ def make_dataframe_line(self, json_filename_list):
ingest_key = fd_key.replace(" ", "_")
key_suffix = ingest_key.split(".")[-1]
if key_suffix not in ["data", "unit", "format", "dtype"]:
if (
str(type(json_data_item))
== "<class 'astropy.table.table.Table'>"
):
if isinstance(json_data_item, Table):
for coltitle in json_data_item.colnames:
ingest_value = json_data_item[coltitle].tolist()
id_key = title_suffix + ingest_key + "." + coltitle
ingest_dict["data"][id_key] = [ingest_value]
else:
ingest_value = json_data_item
id_key = title_suffix + ingest_key
if str(type(ingest_value)) == "<class 'list'>":
if isinstance(ingest_value, list):
ingest_dict["data"][id_key] = [ingest_value]
else:
ingest_dict["data"][id_key] = ingest_value
Expand Down
2 changes: 1 addition & 1 deletion spacekit/preprocessor/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ def normalize_training_images(X_tr, X_ts, X_vl=None):


def array_to_tensor(arr, reshape=False, shape=(-1, 1)):
if type(arr) == tf.Tensor:
if isinstance(arr, tf.Tensor):
return arr
if reshape is True:
arr = arr.reshape(shape[0], shape[1])
Expand Down

0 comments on commit ef36b3f

Please sign in to comment.