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/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -e .[raster]

- name: Build C extensions
run: |
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@
- fixed history tracking bug
- fixed a bug in the rng algorithm that impacted reproducibility in some cases
- odd-sized grids are now supported
- fixed a bug preventing early exit in some situations during optimization when the convergence criterion is met
- fixed a bug preventing early exit in some situations during optimization when the convergence criterion is met

# 1.3.20251010
- fixed critical bug preventing export to xarray datasets
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
project = 'PyOCN'
copyright = '2025, Alexander S. Fox'
author = 'Alexander S. Fox'
release = '1.2.20251010'
release = '1.3.20251010'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
2 changes: 1 addition & 1 deletion 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 = "PyOCN"
version = "1.2.20251010"
version = "1.3.20251010"
description = "Optimal Channel Networks (OCN) in Python with a C core"
readme = "readme.md"
requires-python = ">=3.10"
Expand Down
17 changes: 17 additions & 0 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@
class TestBasicOCN(unittest.TestCase):
"""Basic tests for OCN creation and energy computation."""

def test_ocn_to_xarray(self):
"""Test that OCN can be converted to xarray and back."""
ocn = po.OCN.from_net_type(
net_type="V",
dims=(32, 32),
random_state=1234,
)
ocn.to_xarray()

ocn = po.OCN.from_net_type(
net_type="V",
dims=(32, 32),
random_state=1234,
wrap=True,
)
ocn.to_xarray()

def test_ocn_energy(self):
"""Test that OCN creation produces expected energy value."""
ocn = po.OCN.from_net_type(
Expand Down