Skip to content

Commit 7374e87

Browse files
authored
Merge pull request #6 from alextsfox/dev
updated version, added xarray export test
2 parents 24dba10 + f71a00e commit 7374e87

5 files changed

Lines changed: 24 additions & 4 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Install dependencies
2222
run: |
2323
python -m pip install --upgrade pip
24-
pip install -e .
24+
pip install -e .[raster]
2525
2626
- name: Build C extensions
2727
run: |

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@
1313
- fixed history tracking bug
1414
- fixed a bug in the rng algorithm that impacted reproducibility in some cases
1515
- odd-sized grids are now supported
16-
- fixed a bug preventing early exit in some situations during optimization when the convergence criterion is met
16+
- fixed a bug preventing early exit in some situations during optimization when the convergence criterion is met
17+
18+
# 1.3.20251010
19+
- fixed critical bug preventing export to xarray datasets

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
project = 'PyOCN'
1515
copyright = '2025, Alexander S. Fox'
1616
author = 'Alexander S. Fox'
17-
release = '1.2.20251010'
17+
release = '1.3.20251010'
1818

1919
# -- General configuration ---------------------------------------------------
2020
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "PyOCN"
7-
version = "1.2.20251010"
7+
version = "1.3.20251010"
88
description = "Optimal Channel Networks (OCN) in Python with a C core"
99
readme = "readme.md"
1010
requires-python = ">=3.10"

tests/test_basic.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,23 @@
1111
class TestBasicOCN(unittest.TestCase):
1212
"""Basic tests for OCN creation and energy computation."""
1313

14+
def test_ocn_to_xarray(self):
15+
"""Test that OCN can be converted to xarray and back."""
16+
ocn = po.OCN.from_net_type(
17+
net_type="V",
18+
dims=(32, 32),
19+
random_state=1234,
20+
)
21+
ocn.to_xarray()
22+
23+
ocn = po.OCN.from_net_type(
24+
net_type="V",
25+
dims=(32, 32),
26+
random_state=1234,
27+
wrap=True,
28+
)
29+
ocn.to_xarray()
30+
1431
def test_ocn_energy(self):
1532
"""Test that OCN creation produces expected energy value."""
1633
ocn = po.OCN.from_net_type(

0 commit comments

Comments
 (0)