Skip to content

Commit

Permalink
Merge branch 'main' into fix/sponsor
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaMarconato authored Aug 15, 2023
2 parents 2e0866e + 573a5d6 commit 9372a98
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ ci:
skip: []
repos:
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0
rev: v3.0.1
hooks:
- id: prettier
- repo: https://github.com/asottile/blacken-docs
Expand All @@ -27,7 +27,7 @@ repos:
additional_dependencies: [numpy, types-requests]
exclude: tests/|docs/
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.277
rev: v0.0.282
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM condaforge/mambaforge

RUN mamba install python=3.10

# complex dependencies that needs to be solved with conda
RUN mamba install -c conda-forge gcc libgdal gxx imagecodecs -y

# satellite spatialdata projects
RUN pip install --no-cache-dir \
spatialdata \
spatialdata-io \
spatialdata-plot
5 changes: 1 addition & 4 deletions src/spatialdata/_core/operations/rasterize.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,7 @@ def _get_corrected_affine_matrix(
if "z" in target_axes_unordered:
target_axes = ("c", "z", "y", "x") if "c" in target_axes_unordered else ("z", "y", "x")
else:
if "c" in target_axes_unordered:
target_axes = ("c", "y", "x")
else:
target_axes = ("y", "x")
target_axes = ("c", "y", "x") if "c" in target_axes_unordered else ("y", "x")
target_spatial_axes = get_spatial_axes(target_axes)
assert len(target_spatial_axes) == len(axes)
assert len(target_spatial_axes) == len(axes)
Expand Down
10 changes: 5 additions & 5 deletions src/spatialdata/transformations/ngff/ngff_coordinate_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ def __repr__(self) -> str:

@staticmethod
def from_dict(coord_sys: CoordSystem_t) -> NgffCoordinateSystem:
if "name" not in coord_sys.keys():
if "name" not in coord_sys:
raise ValueError("`coordinate_system` MUST have a name.")
if "axes" not in coord_sys.keys():
if "axes" not in coord_sys:
raise ValueError("`coordinate_system` MUST have axes.")

if TYPE_CHECKING:
Expand All @@ -87,11 +87,11 @@ def from_dict(coord_sys: CoordSystem_t) -> NgffCoordinateSystem:
axes = []
for axis in coord_sys["axes"]:
# for axis in sorted_axes:
if "name" not in axis.keys():
if "name" not in axis:
raise ValueError("Each axis MUST have a name.")
if "type" not in axis.keys():
if "type" not in axis:
raise ValueError("Each axis MUST have a type.")
if "unit" not in axis.keys() and axis["type"] not in ["channel", "array"]:
if "unit" not in axis and axis["type"] not in ["channel", "array"]:
raise ValueError("Each axis is either of type channel either MUST have a unit.")
kw = {}
if "unit" in axis:
Expand Down
1 change: 0 additions & 1 deletion src/spatialdata/transformations/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from typing import TYPE_CHECKING, Optional, Union

import networkx as nx
import numpy
import numpy as np
from dask.dataframe import DataFrame as DaskDataFrame
from geopandas import GeoDataFrame
Expand Down

0 comments on commit 9372a98

Please sign in to comment.