Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 12, 2024
1 parent e81d0cf commit 4cfc719
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 27 deletions.
8 changes: 5 additions & 3 deletions cirrocumulus/concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 10 additions & 6 deletions cirrocumulus/diff_exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 4 additions & 2 deletions cirrocumulus/local_db_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/AutocompleteVirtualized.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
4 changes: 2 additions & 2 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
24 changes: 12 additions & 12 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
});
}

Expand Down

0 comments on commit 4cfc719

Please sign in to comment.