Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
299c4e1
change genes in blobs points
melonora Jan 26, 2024
2604a72
force instance_id of int dtype
melonora Jan 26, 2024
f8c082c
Change error
melonora Jan 27, 2024
dc647cf
Check unique instance_key values per region
melonora Jan 27, 2024
e1f456c
silence warning
melonora Jan 28, 2024
50b4b7c
add left inner join
melonora Jan 28, 2024
3732fa5
change to left join
melonora Jan 29, 2024
52fc812
add left_exclusive join
melonora Jan 29, 2024
4c00050
add to Enum
melonora Jan 29, 2024
7ef8424
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 29, 2024
b97e455
add inner join
melonora Jan 29, 2024
42abfc9
add inner join
melonora Jan 29, 2024
18373a4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 29, 2024
01c2cde
Add right join
melonora Jan 30, 2024
739664f
add ugly right exclusive join
melonora Jan 30, 2024
562d83b
return none instead of empty df
melonora Jan 30, 2024
a38fbb7
add left join tests
melonora Jan 31, 2024
12a34ab
test left_exclusive_join
melonora Jan 31, 2024
c26c571
test inner join
melonora Jan 31, 2024
853260d
refactor get_table_keys
melonora Jan 31, 2024
f9f8f2f
assert valid element in elements_dict
melonora Jan 31, 2024
51a569e
test warnings
melonora Jan 31, 2024
41d7530
add fail join tests
melonora Jan 31, 2024
2dddfc4
merge
melonora Jan 31, 2024
0b3886b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 31, 2024
315b833
silence warning
melonora Jan 28, 2024
fe625a5
add left inner join
melonora Jan 28, 2024
9b7c35d
change to left join
melonora Jan 29, 2024
74c94eb
add left_exclusive join
melonora Jan 29, 2024
07b5669
add to Enum
melonora Jan 29, 2024
e6f7f9b
add inner join
melonora Jan 29, 2024
f24d9ff
fix merge conflict
melonora Jan 31, 2024
008ddae
Add right join
melonora Jan 30, 2024
5792dda
add ugly right exclusive join
melonora Jan 30, 2024
653c061
return none instead of empty df
melonora Jan 30, 2024
fff409b
add left join tests
melonora Jan 31, 2024
c17b9c8
test left_exclusive_join
melonora Jan 31, 2024
e23de5b
test inner join
melonora Jan 31, 2024
928fad7
refactor get_table_keys
melonora Jan 31, 2024
dbba089
assert valid element in elements_dict
melonora Jan 31, 2024
b8dbede
test warnings
melonora Jan 31, 2024
e2a92b6
add fail join tests
melonora Jan 31, 2024
f6b818b
Merge branch 'join_elements_table' of https://github.com/melonora/spa…
melonora Jan 31, 2024
3b3bcd6
fix comments
LucaMarconato Feb 5, 2024
7d59df7
lowercase + docstring
melonora Feb 6, 2024
6f00c83
complete docstring
melonora Feb 6, 2024
eb063e2
lowercase enum
melonora Feb 6, 2024
81e4fce
explicit instance_id column in test
melonora Feb 6, 2024
b8888a2
test instance_id and region column
melonora Feb 6, 2024
e2a48a2
change error
melonora Feb 6, 2024
8aca333
add get method
melonora Feb 9, 2024
8298e82
add contain
melonora Feb 9, 2024
05251b0
get rid of create_element_dict
melonora Feb 9, 2024
f2c06e7
add todo
melonora Feb 9, 2024
f4c259a
adjust enums
melonora Feb 9, 2024
a4f1748
add ability for matching rows
melonora Feb 9, 2024
ec8f318
some cleanup
melonora Feb 9, 2024
0d9ed24
make any element none in right exclusive join
melonora Feb 9, 2024
e7f36f2
add check of table order conservation
melonora Feb 9, 2024
c219263
fix tests
melonora Feb 9, 2024
ca92960
add match_element_to_table
melonora Feb 9, 2024
4da138f
change docstring
melonora Feb 9, 2024
5353c25
revert to old match_table_to_element
melonora Feb 11, 2024
d902872
readd match_element_to_table
melonora Feb 11, 2024
fb3e578
added tests for label joins
melonora Feb 11, 2024
db55d22
add points tests
melonora Feb 11, 2024
fdbd0b7
fixed type and docstring
LucaMarconato Feb 11, 2024
8973eca
fixed comments and docstrings
LucaMarconato Feb 11, 2024
9d73af9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 11, 2024
c8a387d
change typehint
melonora Feb 11, 2024
8ff2f32
Merge branch 'join_elements_table' of https://github.com/melonora/spa…
melonora Feb 11, 2024
5a7f41c
update changelog with joins
melonora Feb 12, 2024
24038db
include join functions
melonora Feb 12, 2024
8db6f02
docs for joins
melonora Feb 12, 2024
8e14cff
added test for right match rows
melonora Feb 12, 2024
93f85d5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 12, 2024
b7a3d76
add validation of match rows
melonora Feb 12, 2024
b7fec37
Merge branch 'join_elements_table' of https://github.com/melonora/spa…
melonora Feb 12, 2024
b8cf51e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 12, 2024
703b227
fix docstring
melonora Feb 12, 2024
e3afce3
Merge branch 'join_elements_table' of https://github.com/melonora/spa…
melonora Feb 12, 2024
8bf0c6b
fix docs
LucaMarconato Feb 13, 2024
c965484
fix typo in changelog
LucaMarconato Feb 13, 2024
5a4e8f5
attempt fix docs
LucaMarconato Feb 13, 2024
0129f2e
Merge branch 'join_elements_table' of https://github.com/melonora/spa…
LucaMarconato Feb 13, 2024
e7d0635
fix docs
LucaMarconato Feb 13, 2024
1bf8c23
fix docs
LucaMarconato Feb 13, 2024
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ and this project adheres to [Semantic Versioning][].

- Implemented support in SpatialData for storing multiple tables. These tables
can annotate a SpatialElement but not necessarily so.
- Added SQL like joins that can be executed by calling one public function `join_sdata_spatialelement_table`. The following
joins are supported: `left`, `left_exclusive`, `right`, `right_exclusive` and `inner`. The function has an option to
match rows. For `left` only matching `left` is supported and for `right` join only `right` matching of rows is supported.
Not all joins are supported for `Labels` elements.
- Added function `match_element_to_table` which allows the user to perform a right join of `SpatialElement`(s) with a table
with rows matching the row order in the table.
- Increased in-memory vs on-disk control: changes performed in-memory (e.g. adding a new image) are not automatically performed on-disk.

#### Minor
Expand Down
2 changes: 2 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Operations on `SpatialData` objects.
polygon_query
get_values
get_extent
join_sdata_spatialelement_table
match_element_to_table
match_table_to_element
concatenate
transform
Expand Down
1 change: 1 addition & 0 deletions docs/design_doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ with coordinate systems:
with axes: c, y, x
with elements: /images/point8, /labels/point8
"""

sdata0 = sdata.query.coordinate_system("point23", filter_rows=False)
sdata1 = sdata.query.bounding_box((0, 20, 0, 300))
sdata1 = sdata.query.polygon("/polygons/annotations")
Expand Down
9 changes: 8 additions & 1 deletion src/spatialdata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"bounding_box_query",
"polygon_query",
"get_values",
"join_sdata_spatialelement_table",
"match_element_to_table",
"match_table_to_element",
"SpatialData",
"get_extent",
Expand All @@ -38,7 +40,12 @@
from spatialdata._core.operations.rasterize import rasterize
from spatialdata._core.operations.transform import transform
from spatialdata._core.query._utils import circles_to_polygons, get_bounding_box_corners
from spatialdata._core.query.relational_query import get_values, match_table_to_element
from spatialdata._core.query.relational_query import (
get_values,
join_sdata_spatialelement_table,
match_element_to_table,
match_table_to_element,
)
from spatialdata._core.query.spatial_query import bounding_box_query, polygon_query
from spatialdata._core.spatialdata import SpatialData
from spatialdata._io._utils import get_dask_backing_files, save_transformations
Expand Down
Loading