-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
76 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Python Tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.10, 3.11, 3.12] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install UV | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
version: "0.5.0" | ||
enable-cache: true | ||
cache-dependency-glob: | | ||
pyproject.toml | ||
- name: Install python deps | ||
run: | | ||
uv pip install --system -e ".[test]" | ||
- name: Python Tests | ||
run: pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[build-system] | ||
build-backend = "hatchling.build" | ||
requires = ["hatchling", "hatch-vcs"] | ||
|
||
[project] | ||
name = "generate-tiff-offsets" | ||
description = "A package to generate TIFF offsets" | ||
authors = [ | ||
{ name = "Ilan Gold", email = "[email protected]" } | ||
] | ||
readme = "README.md" | ||
requires-python = ">=3.10" | ||
classifiers = [ | ||
"Environment :: Console", | ||
"Framework :: Jupyter", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Science/Research", | ||
"Natural Language :: English", | ||
"Operating System :: MacOS :: MacOS X", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: POSIX :: Linux", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Topic :: Scientific/Engineering :: Bio-Informatics", | ||
"Topic :: Scientific/Engineering :: Visualization", | ||
] | ||
license = { text = "MIT" } | ||
dependencies = ["tifffile>=2023.9.26"] | ||
dynamic = ["version"] | ||
[project.optional-dependencies] | ||
test = ["pytest"] | ||
|
||
[tool.hatch.version] | ||
source = "vcs" | ||
[tool.hatch.build.hooks.vcs] | ||
version-file = "generate_tiff_offsets/_version.py" | ||
[tool.hatch.build.targets.wheel] | ||
packages = ["src/anndata", "src/testing"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,14 @@ | ||
#!/usr/bin/env python | ||
|
||
"""Tests for `generate_tiff_offsets` package.""" | ||
|
||
|
||
import unittest | ||
import json | ||
|
||
from generate_tiff_offsets.generate_tiff_offsets import generate_tiff_offsets | ||
|
||
|
||
class TestGenerate_tiff_offsets(unittest.TestCase): | ||
"""Tests for `generate_tiff_offsets` package.""" | ||
|
||
def test_offsets(self): | ||
generate_tiff_offsets('./tests/test-input/multi-channel.ome.tif') | ||
with open('./tests/test-output-expected/multi-channel.offsets.json', 'r') as f: | ||
expected = json.loads(f.read()) | ||
with open('./tests/test-input/multi-channel.offsets.json', 'r') as f: | ||
actual = json.loads(f.read()) | ||
assert(actual == expected) | ||
def test_offsets(): | ||
generate_tiff_offsets('./tests/test-input/multi-channel.ome.tif') | ||
with open('./tests/test-output-expected/multi-channel.offsets.json', 'r') as f: | ||
expected = json.loads(f.read()) | ||
with open('./tests/test-input/multi-channel.offsets.json', 'r') as f: | ||
actual = json.loads(f.read()) | ||
assert(actual == expected) |