Skip to content

Commit

Permalink
Merge pull request #37 from EliHei2/run-precommit
Browse files Browse the repository at this point in the history
run-precommit
  • Loading branch information
LucaMarconato authored Oct 13, 2024
2 parents 5ed53dc + 0903fe8 commit 196ac7a
Show file tree
Hide file tree
Showing 52 changed files with 1,855 additions and 1,807 deletions.
5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE/➕-performance-improvement.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: "➕ Performance Improvement"
about: Suggest an improvement in the performance
title: ''
labels: ''
title: ""
labels: ""
assignees: andrewmoorman, EliHei2

---

**Describe the issue with the current implementation**
Expand Down
6 changes: 4 additions & 2 deletions .github/ISSUE_TEMPLATE/🐛-bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
name: "\U0001F41B Bug Report"
about: Create a report to help us improve
title: "[BUG]"
labels: ''
labels: ""
assignees: andrewmoorman, EliHei2

---

---

name: Bug Report
about: Report a bug or unexpected behavior
title: "[BUG] "
Expand All @@ -21,6 +21,7 @@ A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -33,6 +34,7 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots or logs to help explain your problem.

**Environment (please complete the following information):**

- OS: [e.g. macOS, Windows, Linux]
- Python version: [e.g. 3.9]
- Package version: [e.g. 1.2.3]
Expand Down
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/🚀-feature-request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: "\U0001F680 Feature Request"
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
Expand Down
33 changes: 16 additions & 17 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,22 @@ permissions:

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: "3.10"

- name: Install package and documentation dependencies
run: |
Expand Down
32 changes: 16 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
fail_fast: false
default_language_version:
python: python3
python: python3
default_stages:
- commit
- push
- commit
- push
minimum_pre_commit_version: 2.16.0
ci:
skip: []
skip: []
repos:
- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
- repo: https://github.com/asottile/blacken-docs
rev: 1.18.0
hooks:
- id: blacken-docs
- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
- repo: https://github.com/asottile/blacken-docs
rev: 1.18.0
hooks:
- id: blacken-docs
44 changes: 11 additions & 33 deletions .scripts/create_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ def main(args):
download_file(transcripts_url, transcripts_path)
download_file(nuclei_url, nuclei_path)

xs = XeniumSample().load_transcripts(
path=transcripts_path, min_qv=args.min_qv
)
xs = XeniumSample().load_transcripts(path=transcripts_path, min_qv=args.min_qv)
xs.load_nuclei(path=nuclei_path)

if args.parallel:
Expand Down Expand Up @@ -83,9 +81,7 @@ def main(args):


if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Create dataset from Xenium Human Pancreatic data."
)
parser = argparse.ArgumentParser(description="Create dataset from Xenium Human Pancreatic data.")
parser.add_argument(
"--raw_data_dir",
type=str,
Expand All @@ -104,9 +100,7 @@ def main(args):
required=True,
help="URL for transcripts data.",
)
parser.add_argument(
"--nuclei_url", type=str, required=True, help="URL for nuclei data."
)
parser.add_argument("--nuclei_url", type=str, required=True, help="URL for nuclei data.")
parser.add_argument(
"--min_qv",
type=int,
Expand All @@ -125,21 +119,11 @@ def main(args):
default=180,
help="Step size in y direction for tiles.",
)
parser.add_argument(
"--x_size", type=int, default=200, help="Width of each tile."
)
parser.add_argument(
"--y_size", type=int, default=200, help="Height of each tile."
)
parser.add_argument(
"--margin_x", type=int, default=None, help="Margin in x direction."
)
parser.add_argument(
"--margin_y", type=int, default=None, help="Margin in y direction."
)
parser.add_argument(
"--r_tx", type=int, default=3, help="Radius for building the graph."
)
parser.add_argument("--x_size", type=int, default=200, help="Width of each tile.")
parser.add_argument("--y_size", type=int, default=200, help="Height of each tile.")
parser.add_argument("--margin_x", type=int, default=None, help="Margin in x direction.")
parser.add_argument("--margin_y", type=int, default=None, help="Margin in y direction.")
parser.add_argument("--r_tx", type=int, default=3, help="Radius for building the graph.")
parser.add_argument(
"--val_prob",
type=float,
Expand All @@ -158,9 +142,7 @@ def main(args):
default=3,
help="Number of nearest neighbors for nuclei.",
)
parser.add_argument(
"--dist_nc", type=int, default=10, help="Distance threshold for nuclei."
)
parser.add_argument("--dist_nc", type=int, default=10, help="Distance threshold for nuclei.")
parser.add_argument(
"--k_tx",
type=int,
Expand All @@ -179,12 +161,8 @@ def main(args):
default=True,
help="Whether to compute edge labels.",
)
parser.add_argument(
"--sampling_rate", type=float, default=1, help="Rate of sampling tiles."
)
parser.add_argument(
"--parallel", action="store_true", help="Use parallel processing."
)
parser.add_argument("--sampling_rate", type=float, default=1, help="Rate of sampling tiles.")
parser.add_argument("--parallel", action="store_true", help="Use parallel processing.")
parser.add_argument(
"--num_workers",
type=int,
Expand Down
24 changes: 6 additions & 18 deletions .scripts/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ def main(args: argparse.Namespace) -> None:


if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Predict using the Segger model"
)
parser = argparse.ArgumentParser(description="Predict using the Segger model")
parser.add_argument(
"--dataset_path",
type=str,
Expand All @@ -51,24 +49,16 @@ def main(args: argparse.Namespace) -> None:
required=True,
help="Path to the model checkpoint",
)
parser.add_argument(
"--init_emb", type=int, default=8, help="Initial embedding size"
)
parser.add_argument("--init_emb", type=int, default=8, help="Initial embedding size")
parser.add_argument(
"--hidden_channels",
type=int,
default=64,
help="Number of hidden channels",
)
parser.add_argument(
"--out_channels", type=int, default=16, help="Number of output channels"
)
parser.add_argument(
"--heads", type=int, default=4, help="Number of attention heads"
)
parser.add_argument(
"--aggr", type=str, default="sum", help="Aggregation method"
)
parser.add_argument("--out_channels", type=int, default=16, help="Number of output channels")
parser.add_argument("--heads", type=int, default=4, help="Number of attention heads")
parser.add_argument("--aggr", type=str, default="sum", help="Aggregation method")
parser.add_argument(
"--score_cut",
type=float,
Expand All @@ -81,9 +71,7 @@ def main(args: argparse.Namespace) -> None:
default=4,
help="Number of nearest neighbors for nuclei",
)
parser.add_argument(
"--dist_nc", type=int, default=20, help="Distance threshold for nuclei"
)
parser.add_argument("--dist_nc", type=int, default=20, help="Distance threshold for nuclei")
parser.add_argument(
"--k_tx",
type=int,
Expand Down
36 changes: 9 additions & 27 deletions .scripts/train_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,39 +95,21 @@ def main(args):
default=4,
help="Batch size for validation",
)
parser.add_argument(
"--init_emb", type=int, default=8, help="Initial embedding size"
)
parser.add_argument("--init_emb", type=int, default=8, help="Initial embedding size")
parser.add_argument(
"--hidden_channels",
type=int,
default=64,
help="Number of hidden channels",
)
parser.add_argument(
"--out_channels", type=int, default=16, help="Number of output channels"
)
parser.add_argument(
"--heads", type=int, default=4, help="Number of attention heads"
)
parser.add_argument(
"--aggr", type=str, default="sum", help="Aggregation method"
)
parser.add_argument(
"--accelerator", type=str, default="cuda", help="Type of accelerator"
)
parser.add_argument(
"--strategy", type=str, default="auto", help="Training strategy"
)
parser.add_argument(
"--precision", type=str, default="16-mixed", help="Precision mode"
)
parser.add_argument(
"--devices", type=int, default=4, help="Number of devices"
)
parser.add_argument(
"--epochs", type=int, default=100, help="Number of epochs"
)
parser.add_argument("--out_channels", type=int, default=16, help="Number of output channels")
parser.add_argument("--heads", type=int, default=4, help="Number of attention heads")
parser.add_argument("--aggr", type=str, default="sum", help="Aggregation method")
parser.add_argument("--accelerator", type=str, default="cuda", help="Type of accelerator")
parser.add_argument("--strategy", type=str, default="auto", help="Training strategy")
parser.add_argument("--precision", type=str, default="16-mixed", help="Precision mode")
parser.add_argument("--devices", type=int, default=4, help="Number of devices")
parser.add_argument("--epochs", type=int, default=100, help="Number of epochs")
parser.add_argument(
"--default_root_dir",
type=str,
Expand Down
Loading

0 comments on commit 196ac7a

Please sign in to comment.