From 2aa0bfe0362aaff03d7aad5f2d5d66bb4c7f85ef Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 21:02:30 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- cirrocumulus/concat.py | 8 +++++--- cirrocumulus/diff_exp.py | 16 ++++++++++------ cirrocumulus/local_db_api.py | 6 ++++-- src/AutocompleteVirtualized.js | 4 ++-- src/actions/index.js | 4 ++-- src/util.js | 24 ++++++++++++------------ 6 files changed, 35 insertions(+), 27 deletions(-) diff --git a/cirrocumulus/concat.py b/cirrocumulus/concat.py index 5ef32512..d90e958c 100644 --- a/cirrocumulus/concat.py +++ b/cirrocumulus/concat.py @@ -148,9 +148,11 @@ def concat_spatial(paths: list[str], output_path: str, ncols: int = 2): def create_parser(description=False): parser = argparse.ArgumentParser( - description="Concatenate datasets in a grid layout. If all the datasets are spatial datasets, then tissue images are concatenated." - if description - else None + description=( + "Concatenate datasets in a grid layout. If all the datasets are spatial datasets, then tissue images are concatenated." + if description + else None + ) ) parser.add_argument( "dataset", diff --git a/cirrocumulus/diff_exp.py b/cirrocumulus/diff_exp.py index 4b4fc09f..a25da862 100644 --- a/cirrocumulus/diff_exp.py +++ b/cirrocumulus/diff_exp.py @@ -137,11 +137,15 @@ def __init__( scores=scores, pvals=pvals, logfoldchanges=foldchanges, - frac_expressed1=frac_expressed_df.loc[group_one].values - if frac_expressed_df is not None - else None, - frac_expressed2=frac_expressed_df.loc[group_two].values - if frac_expressed_df is not None - else None, + frac_expressed1=( + frac_expressed_df.loc[group_one].values + if frac_expressed_df is not None + else None + ), + frac_expressed2=( + frac_expressed_df.loc[group_two].values + if frac_expressed_df is not None + else None + ), ) self.pair2results = pair2results diff --git a/cirrocumulus/local_db_api.py b/cirrocumulus/local_db_api.py index 79bfaacb..2f6b0bbc 100644 --- a/cirrocumulus/local_db_api.py +++ b/cirrocumulus/local_db_api.py @@ -50,8 +50,10 @@ def __init__(self, paths: list[str]): if url.lower().endswith(".json.gz") or url.lower().endswith(".json"): import gzip - with gzip.open(fs.open(url)) if url.lower().endswith(".json.gz") else fs.open( - url + with ( + gzip.open(fs.open(url)) + if url.lower().endswith(".json.gz") + else fs.open(url) ) as f: d = json.load(f) if "id" in d: diff --git a/src/AutocompleteVirtualized.js b/src/AutocompleteVirtualized.js index b64b5075..bb8e0dff 100644 --- a/src/AutocompleteVirtualized.js +++ b/src/AutocompleteVirtualized.js @@ -262,8 +262,8 @@ export default function AutocompleteVirtualized(props) { result.text != null ? result.text : result.id != null - ? result.id - : result; + ? result.id + : result; textToOption.delete(text.toLowerCase()); }); tokens.forEach((token) => { diff --git a/src/actions/index.js b/src/actions/index.js index 70b3b76e..59bf4ef2 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -2425,8 +2425,8 @@ function getNewEmbeddingData(state, features) { embedding.spatial != null ? embedding.spatial.type : embedding.type - ? embedding.type - : TRACE_TYPE_SCATTER; + ? embedding.type + : TRACE_TYPE_SCATTER; let coordinates = traceType !== TRACE_TYPE_META_IMAGE ? cachedData[embeddingKey] : null; if (coordinates == null && embedding.mode != null) { diff --git a/src/util.js b/src/util.js index 04e20d8c..029b5b0a 100644 --- a/src/util.js +++ b/src/util.js @@ -680,10 +680,10 @@ export function rankdata(values) { return a.value < b.value ? -1 : a.value === b.value - ? a.position < b.position - ? -1 - : 1 - : 1; + ? a.position < b.position + ? -1 + : 1 + : 1; }); // Walk the sorted array, filling output array using sorted positions, @@ -722,20 +722,20 @@ function indexSortPairs(ranks, ascending) { return a.value < b.value ? -1 : a.value === b.value - ? a.position < b.position - ? -1 - : 1 - : 1; + ? a.position < b.position + ? -1 + : 1 + : 1; }); } else { ranks.sort(function (a, b) { return a.value < b.value ? 1 : a.value === b.value - ? a.position < b.position - ? 1 - : -1 - : -1; + ? a.position < b.position + ? 1 + : -1 + : -1; }); }