Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ekiefl authored Oct 9, 2024
0 parents commit 138a3fb
Show file tree
Hide file tree
Showing 10 changed files with 348 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--
# TODO: If you're a maintainer of this repo, open `.github/PULL_REQUEST_TEMPLATE.md`, replace <NAME> with the repo name, and remove this line.
Many thanks for contributing to Arcadia-Science/<NAME>!
Please fill in the appropriate checklist below (delete whatever is not relevant).
These are the most common things requested on pull requests (PRs).
-->

## PR checklist

- [ ] Tag the issue(s) or milestones this PR fixes (e.g. `Fixes #123, Resolves #456`).
- [ ] Describe the changes you've made.
- [ ] Describe any tests you have conducted to confirm that your changes behave as expected.
- [ ] If you've added new software dependencies, make sure that those dependencies are included in the appropriate `conda` environments.
- [ ] If you've added new functionality, make sure that the documentation is updated accordingly.
- [ ] If you encountered bugs or features that you won't address, but should be addressed eventually, create new issues for them.
31 changes: 31 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: lint

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.12"

- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install pre-commit==3.5.0 ruff==0.4.8
- name: Run Ruff
run: ruff check --output-format=github .

- name: Run Ruff formatter
run: ruff format --check .
84 changes: 84 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# packages installed in editable mode
envs/src/**

# Snakemake-related folders and files
.snakemake/
/input/
/output/
/demo/output/
/demo/input/
/logs

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
.napari_cache

# Translations
*.mo
*.pot

# Sphinx documentation
docs/_build/

# MkDocs documentation
/site/

# PyBuilder
target/

# Pycharm and VSCode
.idea/
venv/

# Jupyter notebook checkpoints
.ipynb_checkpoints

# pyenv
.python-version

# OS
.DS_Store

# written by setuptools_scm
**/_version.py

# Nextflow related folders and files
.nextflow*
work/
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
exclude: (examples/|demo/|dev/|input/|output/)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-yaml
- id: check-toml
- id: check-json
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: debug-statements
- id: trailing-whitespace
- id: mixed-line-ending
- id: end-of-file-fixer
- id: requirements-txt-fixer

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.8
hooks:
- id: ruff
types_or: [ python, pyi, jupyter ]
args: [--fix]
- id: ruff-format
types_or: [ python, pyi, jupyter ]
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": ["charliermarsh.ruff"]
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Arcadia Science

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.PHONY: lint
lint:
ruff check --exit-zero .

.PHONY: format
format:
ruff check --fix .
ruff format .

.PHONY: pre-commit
pre-commit:
pre-commit run --all-files
87 changes: 87 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# TODO: Replace with the name of the repo

[![run with conda](https://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/projects/miniconda/en/latest/)

Note: Analysis repo names should be prefixed with the year (ie `2024-noveltree-analysis`)

## Purpose

TODO: Briefly describe the core analyses performed in the repository and the motivation behind them.

## Installation and Setup

This repository uses conda to manage software environments and installations. You can find operating system-specific instructions for installing miniconda [here](https://docs.conda.io/projects/miniconda/en/latest/). After installing conda and [mamba](https://mamba.readthedocs.io/en/latest/), run the following command to create the pipeline run environment.

```{bash}
TODO: Replace <NAME> with the name of your environment
mamba env create -n <NAME> --file envs/dev.yml
conda activate <NAME>
```

<details><summary>Developer Notes (click to expand/collapse)</summary>

1. Install your pre-commit hooks:

```{bash}
pre-commit install
```

This installs the pre-commit hooks defined in your config (`./.pre-commit-config.yaml`).

2. Export your conda environment before sharing:

As your project develops, the number of dependencies in your environment may increase. Whenever you install new dependencies (using either `pip install` or `mamba install`), you should update the environment file using the following command.

```{bash}
conda env export --from-history --no-builds > envs/dev.yml
```

`--from-history` only exports packages that were explicitly added by you (e.g., the packages you installed with `pip` or `mamba`) and `--no-builds` removes build specification from the exported packages to increase portability between different platforms.
</details>

## Data

TODO: Add details about the description of input / output data and links to Zenodo depositions, if applicable.

## Overview

### Description of the folder structure

### Methods

TODO: Include a brief, step-wise overview of analyses performed.

> Example:
>
> 1. Download scripts using `download.ipynb`.
> 2. Preprocess using `./preprocessing.sh -a data/`
> 3. Run Snakemake pipeline `snakemake --snakefile Snakefile`
> 4. Generate figures using `pub/make_figures.ipynb`.
### Compute Specifications

TODO: Describe what compute resources were used to run the analysis. For example, you could list the operating system, number of cores, RAM, and storage space.

## Contributing

See how we recognize [feedback and contributions to our code](https://github.com/Arcadia-Science/arcadia-software-handbook/blob/main/guides-and-standards/guide-credit-for-contributions.md).

---
## For Developers

This section contains information for developers who are working off of this template. Please adjust or edit this section as appropriate when you're ready to share your repo.

### GitHub templates
This template uses GitHub templates to provide checklists when making new pull requests. These templates are stored in the [.github/](./.github/) directory.

### VSCode
This template includes recommendations to VSCode users for extensions, particularly the `ruff` linter. These recommendations are stored in `.vscode/extensions.json`. When you open the repository in VSCode, you should see a prompt to install the recommended extensions.

### `.gitignore`
This template uses a `.gitignore` file to prevent certain files from being committed to the repository.

### `pyproject.toml`
`pyproject.toml` is a configuration file to specify your project's metadata and to set the behavior of other tools such as linters, type checkers etc. You can learn more [here](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/)

### Linting
This template automates linting and formatting using GitHub Actions and the `ruff` linter. When you push changes to your repository, GitHub will automatically run the linter and report any errors, blocking merges until they are resolved.
10 changes: 10 additions & 0 deletions envs/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- jupyter=1.0.0
- pip=23.2.1
- pre-commit=3.5.0
- python=3.12.0
- ruff=0.4.8
56 changes: 56 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[project]
name = "TODO: Tool name"
description = "TODO: Tool description"
version = "0.0.0"
readme = "README.md"
requires-python = ">=3.12"
license = { file = "LICENSE" }


[tool.ruff]
# The directories to consider when resolving first- vs. third-party imports
src = ["."]

line-length = 100
indent-width = 4

# run ruff on jupyter notebooks (this is not enabled by default)
extend-include = ["*.ipynb"]

[tool.ruff.lint.per-file-ignores]
# ignore star and unused imports
"__init__.py" = ["F403", "F405"]

[tool.ruff.lint]
select = [
# flake8-bugbear
"B",
# pycodestyle error
"E",
# pyflakes
"F",
# isort
"I",
# pyupgrade
"UP",
# pycodestyle warning
"W",
]

# rule codes to ignore
ignore = []

# Allows fix for all enabled rules when `--fix` is provided
fixable = ["ALL"]
unfixable = []

[tool.ruff.format]
# Like Black, use double quotes, indent with spaces, and respect trailing commas
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"

[tool.ruff.lint.isort]
order-by-type = true
no-lines-before = ["future", "standard-library"]

0 comments on commit 138a3fb

Please sign in to comment.