Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- name: Checkout repository
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "rasters"
version = "1.8.0"
version = "1.9.0"
description = "raster processing toolkit"
readme = "README.md"
authors = [
Expand Down Expand Up @@ -47,8 +47,8 @@ dev = [
"twine"
]

[tool.setuptools.package-data]
rasters = ["*.txt"]
[tool.setuptools.packages.find]
exclude = ["notebooks*", "examples*"]

[project.urls]
"Homepage" = "https://github.com/python-rasters/rasters"
Expand Down
7 changes: 1 addition & 6 deletions rasters/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
from .rasters import *
from .version import __version__

from os.path import join, abspath, dirname

with open(join(abspath(dirname(__file__)), "version.txt")) as f:
version = f.read()

__version__ = version
__author__ = "Gregory H. Halverson"
2 changes: 1 addition & 1 deletion rasters/raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def __array_prepare__(self, other: Union[np.ndarray, Raster], *args, **kwargs) -

return array

def __array_wrap__(self, other: Union[np.ndarray, Raster], **kwargs) -> Raster:
def __array_wrap__(self, other: Union[np.ndarray, 'Raster'], context=None, return_scalar=None, **kwargs) -> 'Raster':
if isinstance(other, Raster):
other = other.array
elif isinstance(other, np.ndarray):
Expand Down
3 changes: 3 additions & 0 deletions rasters/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from importlib.metadata import version

__version__ = version("rasters")
1 change: 0 additions & 1 deletion rasters/version.txt

This file was deleted.

29 changes: 29 additions & 0 deletions tests/test_import_dependencies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import pytest

# List of dependencies
dependencies = [
"affine",
"astropy",
"geopandas",
"h5py",
"matplotlib",
"msgpack",
"msgpack_numpy",
"numpy",
"pandas",
"PIL",
"pykdtree",
"pyproj",
"pyresample",
"pytest",
"rasterio",
"scipy",
"shapely",
"six",
"skimage",
]

# Generate individual test functions for each dependency
@pytest.mark.parametrize("dependency", dependencies)
def test_dependency_import(dependency):
__import__(dependency)
Binary file added tests/test_input.tif
Binary file not shown.
9 changes: 9 additions & 0 deletions tests/test_open_geotiff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import os

def test_open_geotiff():
"""Test opening a GeoTIFF file using rasterio."""
geotiff_path = os.path.join(os.path.dirname(__file__), "test_input.tif")
from rasters.raster import Raster
raster = Raster.open(geotiff_path)
assert raster.count > 0, "GeoTIFF should have at least one band"
assert raster.width > 0 and raster.height > 0, "GeoTIFF should have valid dimensions"