Skip to content

Commit

Permalink
Merge branch 'dev' into ancombc2
Browse files Browse the repository at this point in the history
  • Loading branch information
colinvwood committed Jan 6, 2025
2 parents 8b0a721 + d28ef42 commit a44248b
Show file tree
Hide file tree
Showing 33 changed files with 163 additions and 2,434 deletions.
12 changes: 12 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: dfb0404
_src_path: https://github.com/qiime2/q2-setup-template.git
module_name: composition
plugin_name: q2_composition
plugin_scripts: q2_composition/assets/run_ancombc.R
project_author_email: jamietmorton@gmail.com
project_author_name: Jamie Morton
project_description: Compositional statistics plugin for QIIME2.
project_name: q2-composition
project_urls_homepage: https://qiime2.org
project_urls_repository: https://github.com/qiime2/q2-composition
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
q2_composition/_version.py export-subst
pyproject.toml export-subst
3 changes: 2 additions & 1 deletion .github/workflows/ci-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ jobs:
ci:
uses: qiime2/distributions/.github/workflows/lib-ci-dev.yaml@dev
with:
distro: amplicon
distro: amplicon
recipe-path: 'conda-recipe'
58 changes: 58 additions & 0 deletions .github/workflows/update-copyright-headers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Update Copyright Headers

on:
# Runs at 00:00 UTC on Jan 4th or via manual trigger
schedule:
- cron: '0 0 4 1 *'
workflow_dispatch:
inputs:
newYear:
description: "Desired year to update to (e.g., 2025). If not provided, will auto-detect."
required: false

jobs:
update-headers:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Determine years for update
id: determine-years
run: |
INPUT_YEAR="${{ github.event.inputs.newYear }}"
if [ -z "$INPUT_YEAR" ]; then
CURRENT_YEAR="$(date +'%Y')"
echo "No 'newYear' input. Using current year: ${CURRENT_YEAR}"
else
CURRENT_YEAR="$INPUT_YEAR"
echo "Received user input. Updating to: ${CURRENT_YEAR}"
fi
echo "CURRENT_YEAR=$CURRENT_YEAR" >> $GITHUB_ENV
- name: Bump ending year in QIIME 2 headers
run: |
source $GITHUB_ENV
echo "Will update any QIIME 2 header years in [2015..$((CURRENT_YEAR-1))] to $CURRENT_YEAR"
for OLD_YEAR in $(seq 2015 $((CURRENT_YEAR - 1))); do
find . -type f -exec \
sed -i -E "s/(Copyright \(c\) [0-9]{4})-${OLD_YEAR}, QIIME 2/\1-${CURRENT_YEAR}, QIIME 2/g" {} +
done
- name: Commit and push changes
run: |
git config --global user.name "q2d2"
git config --global user.email "q2d2.noreply@gmail.com"
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "Auto-update copyright year to $CURRENT_YEAR"
git push
else
echo "No changes to commit."
exit 0
fi
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,5 @@ output.summary.txt

.DS_Store

pyproject.toml
# Version file from versioningit
_version.py
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2016-2023, QIIME 2 development team.
Copyright (c) 2016-2025, QIIME 2 development team.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test-cov: all
py.test --cov=q2_composition

install: all
$(PYTHON) setup.py install
$(PYTHON) -m pip install -v .

dev: all
pip install -e .
Expand Down
20 changes: 7 additions & 13 deletions ci/recipe/meta.yaml → conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
{% set data = load_setup_py_data() %}
{% set version = data.get('version') or 'placehold' %}

package:
name: q2-composition
version: {{ version }}

version: { { PLUGIN_VERSION } }
source:
path: ../..

path: ..
build:
script: make install

requirements:
host:
- python {{ python }}
- setuptools

- versioningit
- wheel
run:
- python {{ python }}
- scikit-bio {{ scikit_bio }}
Expand All @@ -33,21 +28,20 @@ requirements:
- q2-types {{ qiime2_epoch }}.*
- altair
- rpy2 {{ rpy2 }}

build:
- setuptools
- versioningit
test:
requires:
- qiime2 >={{ qiime2 }}
- q2templates >={{ q2templates }}
- q2-types >={{ q2_types }}
- pytest

imports:
- q2_composition
- qiime2.plugins.composition

commands:
- py.test --pyargs q2_composition

about:
home: https://qiime2.org
license: BSD-3-Clause
Expand Down
53 changes: 53 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[project]
name = "q2-composition"
authors = [
{ name = "Jamie Morton", email = "jamietmorton@gmail.com" }
]
description = "Compositional statistics plugin for QIIME2."
readme = {file = "README.md", content-type = "text/markdown"}
license = {file = "LICENSE"}
dynamic = ["version"]

[project.urls]
Homepage = "https://qiime2.org"
Repository = "https://github.com/qiime2/q2-composition"

[project.entry-points.'qiime2.plugins']
"q2-composition" = "q2_composition.plugin_setup:plugin"

[build-system]
requires = [
"setuptools",
"versioningit",
"wheel"
]
build-backend = "setuptools.build_meta"

[tool.versioningit.vcs]
method = "git-archive"
describe-subst = "$Format:%(describe)$"
default-tag = "0.0.1"

[tool.versioningit.next-version]
method = "minor"

[tool.versioningit.format]
distance = "{base_version}+{distance}.{vcs}{rev}"
dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
distance-dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"

[tool.versioningit.write]
file = "q2-composition/_version.py"

[tool.setuptools]
include-package-data = true
script-files = [
"q2_composition/assets/run_ancombc.R"
]

[tool.setuptools.packages.find]
where = ["."]
include = ["q2_composition*"]

[tool.setuptools.package-data]
q2_composition = ["**/*"]
9 changes: 5 additions & 4 deletions q2_composition/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2023, QIIME 2 development team.
# Copyright (c) 2016-2025, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ----------------------------------------------------------------------------

from ._version import get_versions

from ._format import (FrictionlessCSVFileFormat,
DataPackageSchemaFileFormat,
Expand All @@ -20,8 +19,10 @@
from ._dataloaf_tabulate import tabulate
from ._diff_abundance_plots import da_barplot

__version__ = get_versions()['version']
del get_versions
try:
from ._version import __version__
except ModuleNotFoundError:
__version__ = '0.0.0+notfound'

__all__ = ['FrictionlessCSVFileFormat', 'DataPackageSchemaFileFormat',
'DataLoafPackageDirFmt', 'DifferentialAbundance', 'add_pseudocount',
Expand Down
2 changes: 1 addition & 1 deletion q2_composition/_ancom.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2023, QIIME 2 development team.
# Copyright (c) 2016-2025, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
Expand Down
2 changes: 1 addition & 1 deletion q2_composition/_ancombc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2023, QIIME 2 development team.
# Copyright (c) 2016-2025, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
Expand Down
2 changes: 1 addition & 1 deletion q2_composition/_dataloaf_tabulate/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2023, QIIME 2 development team.
# Copyright (c) 2016-2025, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
Expand Down
2 changes: 1 addition & 1 deletion q2_composition/_dataloaf_tabulate/_visualizer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2023, QIIME 2 development team.
# Copyright (c) 2016-2025, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
Expand Down
5 changes: 4 additions & 1 deletion q2_composition/_diff_abundance_plots.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2023, QIIME 2 development team.
# Copyright (c) 2016-2025, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
Expand Down Expand Up @@ -110,6 +110,9 @@ def _plot_differentials(
significance_label, error_label,
"error-lower", "error-upper"]),
color=alt.Color('enriched', title="Relative to reference",
scale=alt.Scale(
domain=["enriched", "depleted"],
range=["#4c78a8", "#f58518"]),
sort="descending")
)

Expand Down
2 changes: 1 addition & 1 deletion q2_composition/_examples.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
# Copyright (c) 2022-2023, QIIME 2 development team.
# Copyright (c) 2022-2025, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
Expand Down
2 changes: 1 addition & 1 deletion q2_composition/_format.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
# Copyright (c) 2022-2023, QIIME 2 development team.
# Copyright (c) 2022-2025, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
Expand Down
2 changes: 1 addition & 1 deletion q2_composition/_impute.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2023, QIIME 2 development team.
# Copyright (c) 2016-2025, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
Expand Down
2 changes: 1 addition & 1 deletion q2_composition/_type.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
# Copyright (c) 2022-2023, QIIME 2 development team.
# Copyright (c) 2022-2025, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
Expand Down
Loading

0 comments on commit a44248b

Please sign in to comment.