Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pre-commits #330

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .coveragerc_omit
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ omit =
vitessce/data_utils/anndata.py
vitessce/data_utils/ome.py
vitessce/data_utils/entities.py
vitessce/data_utils/multivec.py
vitessce/data_utils/multivec.py
1 change: 0 additions & 1 deletion .coveragerc_real
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[report]
exclude_lines =

2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use conda vitessce-python-dev
use conda vitessce-python-dev
15 changes: 0 additions & 15 deletions .github/workflows/lint.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
fail_fast: false
default_language_version:
python: python3
default_stages:
- commit
- push
minimum_pre_commit_version: 2.16.0
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
types_or: [python, pyi, jupyter]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: detect-private-key
- id: check-ast
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=lf]
- id: trailing-whitespace
- id: check-case-conflict
# Check that there are no merge conflicts (could be generated by template sync)
- id: check-merge-conflict
args: [--assume-in-merge]
18 changes: 2 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,10 @@ In this repository, there are multiple conda environments for different purposes
## Linting and testing

```sh
flake8
pre-commit run --all
pytest
```

### Formatting

One file:

```sh
autopep8 --in-place --aggressive ./path/to/file.py
```

All `.py` files:

```sh
find . -name '*.py' -exec autopep8 --in-place --aggressive '{}' \;
```


## Documentation

Expand Down Expand Up @@ -115,7 +101,7 @@ vw = vc.widget(proxy=True)
vw
```

or
or

```py
vc.display(proxy=True, host_name="http://localhost:8888")
Expand Down
2 changes: 1 addition & 1 deletion binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ dependencies:
- pip:
- loompy
- scanpy
- vitessce[all]
- vitessce[all]
2 changes: 1 addition & 1 deletion demos/.envrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use conda vitessce-python-demos
use conda vitessce-python-demos
4 changes: 2 additions & 2 deletions demos/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Processing scripts for Vitessce demo datasets

Previously, we developed custom processing scripts for Vitessce demo data in the `vitessce-data` repository.
Previously, we developed custom processing scripts for Vitessce demo data in the `vitessce-data` repository.

However, now that there are consensus single-cell file formats (e.g., h5ad) and an ecosystem of data processing packages in the community, we aim to leverage those. Writing demo dataset processing code using Scanpy and AnnData in small Snakemake workflows in this repository should allow us to iterate more quickly and share more demos.

Expand Down Expand Up @@ -91,4 +91,4 @@ Configure the Google Cloud CLI by running `gcloud auth login` ([reference](https

```sh
snakemake --cores all --rerun-triggers mtime --config upload=true
```
```
4 changes: 2 additions & 2 deletions demos/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ subworkflow codeluppi_2018:
subworkflow codeluppi_2018_via_zarr:
workdir:
"codeluppi-2018-via-zarr"

subworkflow combat_2022:
workdir:
"combat-2022"
Expand Down Expand Up @@ -131,4 +131,4 @@ rule fill_templates:
for subworkflow_dir in params.subworkflow_dirs:
if os.path.exists(os.path.join(subworkflow_dir, 'vitessce.template.json')):
shell(f"python fill_template.py -d {subworkflow_dir} -t local > {os.path.join(subworkflow_dir, 'vitessce.local.json')}")
shell(f"python fill_template.py -d {subworkflow_dir} -t remote -v {BUCKET_VERSION} > {os.path.join(subworkflow_dir, 'vitessce.remote.json')}")
shell(f"python fill_template.py -d {subworkflow_dir} -t remote -v {BUCKET_VERSION} > {os.path.join(subworkflow_dir, 'vitessce.remote.json')}")
2 changes: 1 addition & 1 deletion demos/codeluppi-2018-via-zarr/vitessce.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,4 @@
"h": 2
}
]
}
}
2 changes: 1 addition & 1 deletion demos/codeluppi-2018/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@ rule download_molecules_hdf5:
shell:
'''
curl -L --retry 999 --retry-delay 3 -C - -o {output} {params.file_url}
'''
'''
2 changes: 1 addition & 1 deletion demos/codeluppi-2018/vitessce.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,4 +276,4 @@
"h": 2
}
]
}
}
1 change: 0 additions & 1 deletion demos/combat-2022/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,3 @@ rule download_data:
'''
curl -L --retry 999 --retry-delay 3 -C - -o {output} {params.file_url}
'''

2 changes: 1 addition & 1 deletion demos/combat-2022/config.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
output:
- combat_2022_cell.h5ad.zarr
- combat_2022_cell.h5ad.zarr
2 changes: 1 addition & 1 deletion demos/combat-2022/vitessce.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,4 @@
"uid": "G"
}
]
}
}
2 changes: 1 addition & 1 deletion demos/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ def flatten(l):
return [item for sublist in l for item in sublist]

def is_aws(output_path):
return not output_path.endswith('.ome.zarr')
return not output_path.endswith('.ome.zarr')
2 changes: 1 addition & 1 deletion demos/create_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ Add the following to the main demos Snakefile:
subworkflow $SUBWORKFLOW_KEY:
workdir:
"$SUBWORKFLOW_DIR"
EOF
EOF
2 changes: 1 addition & 1 deletion demos/eng-2019/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ rule download_file:
shell:
'''
curl -L -o {output} {BASE_URL}.{wildcards.prefix}.json
'''
'''
2 changes: 1 addition & 1 deletion demos/eng-2019/vitessce.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,4 @@
"h": 4
}
]
}
}
2 changes: 1 addition & 1 deletion demos/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ dependencies:
- generate-tiff-offsets>=0.1.7
- obonet==0.2.5
- leidenalg
- ome-zarr==0.2.1
- ome-zarr==0.2.1
1 change: 0 additions & 1 deletion demos/habib-2017/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,3 @@ rule download_data:
'''
curl -L -o {output} {params.file_url}
'''

2 changes: 1 addition & 1 deletion demos/habib-2017/config.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
output:
- habib_2017_nature_methods.h5ad.zarr
- habib_2017_nature_methods.h5ad.zarr
2 changes: 1 addition & 1 deletion demos/habib-2017/vitessce.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@
"uid": "F"
}
]
}
}
1 change: 0 additions & 1 deletion demos/human-lymph-node-10x-visium/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ rule create_zarr:
-oa {output.adata} \
-oi {output.img}
'''

2 changes: 1 addition & 1 deletion demos/human-lymph-node-10x-visium/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
output:
- human_lymph_node_10x_visium.h5ad.zarr
- human_lymph_node_10x_visium.ome.zarr
- human_lymph_node_10x_visium.ome.zarr
2 changes: 1 addition & 1 deletion demos/human-lymph-node-10x-visium/vitessce.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,4 @@
"x": 4, "y": 6, "w": 2, "h": 6
}
]
}
}
2 changes: 1 addition & 1 deletion demos/kuppe-2022/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ rule download_atac:
shell:
'''
curl -L --retry 999 --retry-delay 3 -C - -o {output} "{params.file_url}"
'''
'''
2 changes: 1 addition & 1 deletion demos/kuppe-2022/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ output:
- kuppe_2022_nature.atac.h5ad.zarr
- kuppe_2022_nature.joint.h5ad.zarr
- kuppe_2022_nature.visium.h5ad.zarr
- kuppe_2022_nature.visium.ome.zarr
- kuppe_2022_nature.visium.ome.zarr
2 changes: 1 addition & 1 deletion demos/kuppe-2022/vitessce.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -351,4 +351,4 @@
"uid": "I"
}
]
}
}
2 changes: 1 addition & 1 deletion demos/marshall-2022/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ rule download_adata:
shell:
'''
curl -L -o {output} "{params.file_url}"
'''
'''
2 changes: 1 addition & 1 deletion demos/marshall-2022/vitessce.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@
"uid": "H"
}
]
}
}
4 changes: 2 additions & 2 deletions demos/meta-2022-azimuth/vitessce.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
},
"uid": "C"
},

{
"component": "featureList",
"h": 6,
Expand All @@ -137,4 +137,4 @@
"uid": "F"
}
]
}
}
2 changes: 1 addition & 1 deletion demos/satija-2020/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ rule download_cl_obo:
shell:
'''
curl -L -o {output} {params.file_url}
'''
'''
2 changes: 1 addition & 1 deletion demos/satija-2020/vitessce.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,4 @@
"y": 4
}
]
}
}
2 changes: 1 addition & 1 deletion demos/sn-atac-seq-hubmap-2020/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ rule download_file:
shell:
'''
curl -L -o {output} {BASE_URL}.{wildcards.prefix}.json
'''
'''
2 changes: 1 addition & 1 deletion demos/sn-atac-seq-hubmap-2020/vitessce.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@
}
],
"initStrategy": "auto"
}
}
2 changes: 1 addition & 1 deletion demos/wang-2018/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ rule download_file:
shell:
'''
curl -L -o {output} {BASE_URL}.{wildcards.prefix}.json
'''
'''
2 changes: 1 addition & 1 deletion demos/wang-2018/vitessce.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@
"h": 2
}
]
}
}
2 changes: 1 addition & 1 deletion docs/_static/stylesheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ legend {
z-index: 201;
text-align: center;
margin: 0 auto;
}
}
2 changes: 1 addition & 1 deletion docs/api_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ vitessce.data_utils
.. automodule:: vitessce.data_utils.ome
:members:
.. automodule:: vitessce.data_utils.anndata
:members:
:members:
2 changes: 1 addition & 1 deletion docs/data_examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Data preparation examples

notebooks/data_export_s3
notebooks/data_export_files
notebooks/widget_brain_with_base_dir
notebooks/widget_brain_with_base_dir
3 changes: 0 additions & 3 deletions docs/data_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,3 @@ Jupyter process: remote service like Colab/Binder; Files: remote & accessed via
===================================================================================

Unfortunately, this will not work because the remote server cannot access the files that are on another machine behind SSH.



2 changes: 1 addition & 1 deletion docs/notebooks/.envrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use conda vitessce-python-notebooks
use conda vitessce-python-notebooks
2 changes: 1 addition & 1 deletion docs/notebooks/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ dependencies:
- pip
- pip:
- loompy>=3.0.6
- scikit-misc>=0.1.3
- scikit-misc>=0.1.3
2 changes: 1 addition & 1 deletion docs/widget_examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Widget examples
notebooks/widget_pbmc
notebooks/widget_loom
notebooks/widget_from_dict
notebooks/widget_pbmc_remote.ipynb
notebooks/widget_pbmc_remote.ipynb
Loading
Loading