Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

legacy code to port #48

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
cb4ddf6
add io test
giovp Aug 17, 2022
0981821
io for transforms, fixed bugs when testing on the merfish dataset
LucaMarconato Aug 17, 2022
707f047
merged with main
LucaMarconato Aug 17, 2022
b7cb647
bugfix
LucaMarconato Aug 17, 2022
561d252
fixed tests
LucaMarconato Aug 17, 2022
b10419c
Merge branch 'tests/io' into feature/transform
LucaMarconato Aug 17, 2022
31525d0
add io test (#21)
giovp Aug 18, 2022
140198f
workaround against bug with backed dask arrays
LucaMarconato Aug 22, 2022
5764882
Merge branch 'feature/transform' of https://github.com/scverse/spatia…
LucaMarconato Aug 22, 2022
7ece121
woring on a bug with io; fixed repr for points
LucaMarconato Sep 1, 2022
ce23cb7
quick code changes for to_zarr bug report
LucaMarconato Sep 5, 2022
67c1d7a
patched tests after discussion on the to_zarr bug
LucaMarconato Sep 5, 2022
6221fa2
more io tests, fixed related bugs
LucaMarconato Sep 28, 2022
f36ed27
first io support for polygons
LucaMarconato Sep 29, 2022
087600d
fix precommits
giovp Sep 30, 2022
14c4cd0
fix flake8
giovp Sep 30, 2022
98cd743
wip implementation of the ngff transform
LucaMarconato Sep 30, 2022
f8517d7
Merge branch 'feature/transform' of https://github.com/scverse/spatia…
LucaMarconato Sep 30, 2022
ba85569
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 30, 2022
3db58b7
wip transformations, tests pass but io not compatible
LucaMarconato Oct 2, 2022
b694423
Merge branch 'feature/transform' of https://github.com/scverse/spatia…
LucaMarconato Oct 2, 2022
db61de8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 2, 2022
3a83b21
wip write for new transforms specs
LucaMarconato Oct 3, 2022
569abdd
Merge branch 'feature/transform' of https://github.com/scverse/spatia…
LucaMarconato Oct 3, 2022
018f290
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 3, 2022
833bb5c
fstring in format.py
LucaMarconato Oct 3, 2022
ccfe5e9
Merge branch 'feature/transform' of https://github.com/scverse/spatia…
LucaMarconato Oct 3, 2022
8460500
fix in format.py
LucaMarconato Oct 3, 2022
f00f7fd
io working for the new transform specs (no coord spaces yet)
LucaMarconato Oct 3, 2022
983b638
fix in affine
LucaMarconato Oct 3, 2022
670b104
new constructor accepting base elements
LucaMarconato Oct 3, 2022
aaeea79
Merge branch 'feature/coordspaces' into feature/transform_and_coord_s…
LucaMarconato Oct 3, 2022
1bcff01
wip support for coordinate systems and multiple transformations
LucaMarconato Oct 3, 2022
0271f19
wip coordinate spaces
LucaMarconato Oct 4, 2022
22f249e
io with multiple trans and coord systems working for points and polygons
LucaMarconato Oct 5, 2022
d321be4
io with multiple trans and coord systems for images
LucaMarconato Oct 5, 2022
d0a91cb
io with multiple trans and coord sys fully working
LucaMarconato Oct 6, 2022
1ee47fe
napari viz working
LucaMarconato Oct 6, 2022
bb9a862
filtering by coordinate spaces
LucaMarconato Oct 6, 2022
054c5cd
bidirectional communication with napari
LucaMarconato Oct 6, 2022
4f2bb0c
bugfixes; bug in axes order still present
LucaMarconato Oct 10, 2022
80ec3a7
run some precommits
LucaMarconato Oct 10, 2022
2756e4a
fixed axes bug, simplified constructor
LucaMarconato Oct 11, 2022
176f909
moved geojson parser in spatialdata-io
LucaMarconato Oct 11, 2022
e78a168
added cli for peeking .zarr files
LucaMarconato Oct 11, 2022
22c6e9a
support for multiscale images and labels
LucaMarconato Oct 12, 2022
4e80b0e
fix with multiscales
LucaMarconato Oct 18, 2022
1990172
fix bug polygon; workaround dask .chunks
LucaMarconato Oct 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ __pycache__/

# data
spatialdata-sandbox
*.zarr
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ default_stages:
minimum_pre_commit_version: 2.16.0
repos:
- repo: https://github.com/psf/black
rev: 22.6.0
rev: 22.8.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
rev: v3.0.0-alpha.0
hooks:
- id: prettier
- repo: https://github.com/asottile/blacken-docs
Expand All @@ -23,7 +23,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
rev: v0.981
hooks:
- id: mypy
additional_dependencies: [numpy==1.22.0, types-requests]
Expand All @@ -50,7 +50,7 @@ repos:
- id: trailing-whitespace
- id: check-case-conflict
- repo: https://github.com/myint/autoflake
rev: v1.4
rev: v1.6.1
hooks:
- id: autoflake
args:
Expand All @@ -70,7 +70,7 @@ repos:
- flake8-bugbear
- flake8-blind-except
- repo: https://github.com/asottile/pyupgrade
rev: v2.37.3
rev: v2.38.2
hooks:
- id: pyupgrade
args: [--py3-plus, --py38-plus, --keep-runtime-typing]
41 changes: 39 additions & 2 deletions spatialdata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,42 @@

__version__ = version("spatialdata")

from spatialdata._core.spatialdata import SpatialData
from spatialdata._core.transform import Transform
__all__ = [
"SpatialData",
"Identity",
"MapIndex",
"MapAxis",
"Translation",
"Scale",
"Affine",
"Rotation",
"Sequence",
"Displacements",
"Coordinates",
"VectorField",
"InverseOf",
"Bijection",
"ByDimension",
"compose_transformations",
"CoordinateSystem",
]

from spatialdata._core._spatialdata import SpatialData
from spatialdata._core.coordinate_system import CoordinateSystem
from spatialdata._core.transform import (
Affine,
Bijection,
ByDimension,
Coordinates,
Displacements,
Identity,
InverseOf,
MapAxis,
MapIndex,
Rotation,
Scale,
Sequence,
Translation,
VectorField,
compose_transformations,
)
36 changes: 36 additions & 0 deletions spatialdata/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import os

import click


@click.command(help="Peek inside the SpatialData .zarr file")
@click.argument("path", default=False, type=str)
def peek(path):
if not os.path.isdir(path):
print(
f"Error: .zarr storage not found at {path}. Please specify a valid OME-NGFF spatial data (.zarr) file. "
"Example "
'"python -m '
'spatialdata peek data.zarr"'
)
else:
import spatialdata as sd

sdata = sd.SpatialData.read(path, filter_table=True)
print(sdata)


@click.group()
def cli():
pass


cli.add_command(peek)


def main():
cli()


if __name__ == "__main__":
main()
3 changes: 2 additions & 1 deletion spatialdata/_core/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from spatialdata._core.spatialdata import SpatialData
from spatialdata._core._spatialdata import SpatialData
from spatialdata._core.elements import Image, Labels, Points, Polygons
Loading