Skip to content

Commit

Permalink
Merge branch 'theislab:main' into fix/get_df-with-default-args
Browse files Browse the repository at this point in the history
  • Loading branch information
Oisin-M authored Apr 9, 2024
2 parents 2a5ceb6 + b2f31b3 commit cb5e09a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip build
python -m pip install --upgrade build
- name: Build package
run: |
Expand Down
14 changes: 0 additions & 14 deletions debug.py

This file was deleted.

13 changes: 7 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]

requires = ["setuptools>=61", "setuptools-scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[project]
name = "scvelo"
version = "0.3.1"
dynamic = ["version"]
description = "RNA velocity generalized through dynamical modeling"
readme = {file = "README.md", content-type="text/markdown"}
requires-python = ">=3.8"
Expand Down Expand Up @@ -98,8 +97,10 @@ docs = [
"nbsphinx>=0.7,<0.8.7"
]

[tool.hatch.build.targets.wheel]
packages = ["scvelo"]
[tool.setuptools]
include-package-data = true

[tool.setuptools_scm]

[tool.coverage.run]
source = ["scvelo"]
Expand Down
9 changes: 6 additions & 3 deletions scvelo/plotting/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1460,6 +1460,7 @@ def hist(
ax=None,
dpi=None,
show=True,
save=None,
**kwargs,
):
"""Plot a histogram.
Expand Down Expand Up @@ -1530,6 +1531,9 @@ def hist(
Figure dpi.
show: `bool`, optional (default: `None`)
Show the plot, do not return axis.
save: `bool` or `str`, optional (default: `None`)
If `True` or a `str`, save the figure. A string is appended to the default filename.
Infer the filetype if ending on {'.pdf', '.png', '.svg'}.
Returns
-------
Expand Down Expand Up @@ -1658,10 +1662,9 @@ def log_fmt(x, pos):
if rcParams["savefig.transparent"]:
ax.patch.set_alpha(0)

if not show:
savefig_or_show(dpi=dpi, save=save, show=show)
if show is False:
return ax
else:
pl.show()


# TODO: Add docstrings
Expand Down
15 changes: 10 additions & 5 deletions scvelo/tools/_vi_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ def train(
max_epochs: Optional[int] = 500,
lr: float = 1e-2,
weight_decay: float = 1e-2,
use_gpu: Optional[Union[str, int, bool]] = None,
accelerator: str = "auto",
devices: Union[int, List[int], str] = "auto",
train_size: float = 0.9,
Expand All @@ -149,9 +148,14 @@ def train(
Learning rate for optimization
weight_decay
Weight decay for optimization
use_gpu
Use default GPU if available (if None or True), or index of GPU to use (if int),
or name of GPU (if str, e.g., `'cuda:0'`), or use CPU (if False).
accelerator
Supports passing different accelerator types `("cpu", "gpu", "tpu", "ipu", "hpu", "mps, "auto")` as well as
custom accelerator instances.
devices
The devices to use. Can be set to a non-negative index (`int` or `str`), a sequence of device indices
(`list` or comma-separated `str`), the value `-1` to indicate all available devices, or `"auto"` for
automatic selection based on the chosen `accelerator`. If set to `"auto"` and `accelerator` is not
determined to be `"cpu"`, then `devices` will be set to the first available device.
train_size
Size of training set in the range [0.0, 1.0].
validation_size
Expand Down Expand Up @@ -195,7 +199,8 @@ def train(
training_plan=training_plan,
data_splitter=data_splitter,
max_epochs=max_epochs,
use_gpu=use_gpu,
accelerator=accelerator,
devices=devices,
**trainer_kwargs,
)
return runner()
Expand Down

0 comments on commit cb5e09a

Please sign in to comment.