Skip to content

Commit

Permalink
Prepare v0.3.0: New features and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JWatter committed Jan 10, 2024
1 parent 00f268b commit c5de5e1
Show file tree
Hide file tree
Showing 22 changed files with 1,622 additions and 242 deletions.
26 changes: 0 additions & 26 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,32 +155,6 @@ 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.

# NMFreg tutorial

**Source**: https://github.com/tudaga/NMFreg_tutorial

MIT License

Copyright (c) 2019 Aleksandrina Goeva

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.

# Sphinx-Autosummary-Recursion

**Source**: https://github.com/JamesALeedham/Sphinx-Autosummary-Recursion
Expand Down
1 change: 1 addition & 0 deletions docsource/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Home <self>
Examples <examples>
API reference <_autosummary/tacco>
Release Notes <release_notes>
References <references>

Welcome to the TACCO documentation!
Expand Down
8 changes: 8 additions & 0 deletions docsource/release_notes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Release Notes
-------------

.. toctree::
:maxdepth: 2
:glob:

release_notes/release_notes_*
56 changes: 56 additions & 0 deletions docsource/release_notes/release_notes_0.3.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
TACCO 0.3.0 (2024-01-10)
========================

Features
--------

- :func:`tacco.plots.subplots`: support for changing the dpi and forwarding kwargs to :func:`matplotlib.pyplot.subplots`

- :func:`tacco.plots.dotplot`: new swap_axes argument

- :func:`tacco.utils.split_spatial_samples`: more flexible and intuitive reimplementation for spatial splitting samples which can account explicitly for spatial correlations; deprecates the :func:`tacco.utils.spatial_split` function

- :func:`tacco.tools.setup_orthology_converter`, :func:`tacco.tools.run_orthology_converter`: orthology conversion between species

- :func:`tacco.get.get_data_from_key`: general getter to retrieve data from an anndata given a data path

- :func:`tacco.get.get_positions`: support for data paths

Fixes
--------

- :func:`tacco.tools.annotate`: reconstruction_key now honors max_annotation. So :func:`tacco.tools.split_observations` works with reconstruction_key as well. This fixes issue `#9 <https://github.com/simonwm/tacco/issues/9>`__ .

- :func:`tacco.tools.split_observations`: fixed map_obsm_keys parameter

- :func:`tacco.plots.significances`: fix using pre-supplied ax, fix not significant annotated but significance colored cells, fix future warning, work for data with enrichment and without depletion

- :func:`tacco.plots.dotplot`: catch edge case with gene-group combinations without a match in "marks"

- :func:`tacco.plots.co_occurrence`: fixed bug for multiple anndatas in the input

- :func:`tacco.plots.co_occurrence_matrix`: fixed bug for restrict_intervals=None

- :func:`tacco.tools.annotate`: multi_center=1 changed so it now behaves the same as multi_center=0/None, fix FutureWarning from kmeans

- :func:`tacco.tools.get_contributions`: fix FutureWarning from groupby

- :func:`tacco.plots.co_occurrence`, :func:`tacco.plots.co_occurrence_matrix`: coocurrence plots now follow the show_only and show_only_center order

Documentation
-------------

- Add release notes

- Add visium example to address `#8 https://github.com/simonwm/tacco/issues/8`__

Miscellaneous
-------------

- Switch from setup.cfg to pyproject.toml

- Generalization of benchmarking to support conda-forge time

- Expanded testing

- Remove duplication in NOTICE.md
35 changes: 35 additions & 0 deletions docsource/release_notes/template_release_notes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.. before release, ensure a correct date and version number here and in the name of the release_notes_a.b.c.rst file!!!
.. and remove all the comments here...
TACCO a.b.c (yyyy-mm-dd)
========================

.. all sections are optional: remove if empty
.. link to issues/PRs/etc on github where applicable
Features
--------
.. include new and enhanced features here, as well as significant performance improvements
- Add :func:`tacco.tools.new_func` to do new things.

- Add :func:`tacco.tools.other_new_func` to implement feature request.

Fixes
--------
.. include resolution of bugs and very unintuitive behaviour here
- Fix some issue `#9 <https://github.com/simonwm/tacco/issues/9>`__

Documentation
-------------
.. include documentation updates here
- Add example `#8 https://github.com/simonwm/tacco/issues/8`__

Miscellaneous
-------------
.. include all the rest here
- Deprecated old functionality

47 changes: 42 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
[build-system]
requires = ["setuptools<=60", "wheel", "setuptools_scm>=6.2"] #for next release: could be relaxed, maybe to >61
requires = ["setuptools", "wheel", "setuptools_scm"]
build-backend = "setuptools.build_meta"

[project]
name = "tacco"
description = "TACCO: Transfer of Annotations to Cells and their COmbinations"
authors = [
{name = "Simon Mages"},
{name = "Noa Moriel"},
{name = "Jan Watter"},
]
maintainers = [
{name = "Jan Watter", email = "[email protected]"},
{name = "Simon Mages", email = "[email protected]"},
]
readme = "README.md"
license = {file = "LICENCE.txt"}
requires-python = ">=3.7"

classifiers = [
"License :: OSI Approved :: BSD License",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Visualization",
]
dynamic = ["version"]

Expand All @@ -31,14 +48,34 @@ dependencies = [
"mkl_service",
"scikit_learn",
"threadpoolctl",
"pyamg"
"pyamg",
]

[project.urls]
documentation = "https://simonwm.github.io/tacco/index.html"
Source = "https://github.com/simonwm/tacco"
Documentation = "https://simonwm.github.io/tacco/index.html"

[tool.setuptools_scm]
local_scheme = "no-local-version"

[tool.setuptools.dynamic]
version = {attr = "tacco.VERSION"}
[project.optional-dependencies]
doc = [
"sphinx",
"sphinx-rtd-theme",
"pydata-sphinx-theme",
"sphinx-autodoc-typehints",
"nbsphinx",
"ipython",
"jupytext",
"jupyter",
]

benchmark = ["time"]

test = ["pytest"]

[tool.pytest.ini_options]
testpaths = ["tests"]

[tool.setuptools]
packages = ["tacco"]
41 changes: 0 additions & 41 deletions setup.cfg

This file was deleted.

16 changes: 15 additions & 1 deletion tacco/benchmarking/_benchmarking.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@
import numpy as np
import pandas as pd

TIME_PATH = None
BENCHMARKING_AVAILABLE = False

if os.path.exists('/usr/bin/time'):
TIME_PATH = '/usr/bin/time'
BENCHMARKING_AVAILABLE = True
elif os.path.exists(sys.exec_prefix + '/bin/time'):
TIME_PATH = sys.exec_prefix + '/bin/time'
BENCHMARKING_AVAILABLE = True


def _set_up_benchmark_working_directory(
working_directory,
):
Expand Down Expand Up @@ -90,7 +101,7 @@ def benchmark_shell(

# run the command
proc = subprocess.Popen(
['/usr/bin/time','-f','wall_clock_time_seconds %e\nmax_memory_used_kbytes %M\nexit_status %x',command,*command_args,],
[TIME_PATH,'-f','wall_clock_time_seconds %e\nmax_memory_used_kbytes %M\nexit_status %x',command,*command_args,],
cwd=working_directory,
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
Expand Down Expand Up @@ -214,6 +225,9 @@ def benchmark_annotate(
reading data under the key "benchmark_time_s".
"""

if not BENCHMARKING_AVAILABLE:
raise Exception('No /usr/bin/time or conda-forge time executable found. If on macOS or linux install conda-forge time in your current conda env to run benchmarks')

if working_directory is not None and 'annotation_key' not in kw_args:
print('`working_directory` is set, but `annotation_key` is not. This frequently is a mistake.\nIf you are certain that it it not, you can deactivate this message by explicitly setting `annotation_key` to `None`.')
Expand Down
1 change: 1 addition & 0 deletions tacco/get/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"""

# expose the API
from ._data import get_data_from_key as data_from_key
from ._counts import get_counts as counts
from ._positions import get_positions as positions
Loading

0 comments on commit c5de5e1

Please sign in to comment.