jejjohnson / jejjohnson/xrtoolz

V5.4: object_properties + contingency_table plumbing

Open
#67 0 comments 0 reactions 0 assignees View on GitHub
area:code enhancement validation-framework
Dominant language
Python
Stars
1
Forks
0
Avg merge
13d 21h
Merged PRs (30d)
3

Description

## Summary
The two utilities that bridge V5.1 (objects) and V5.3 (metrics): `object_properties` (compute per-object summary stats from the source Dataset) and `contingency_table` (Hits / Misses / FalseAlarms / CorrectNegatives from matches).

## API target
```python
def object_properties(
objects: xr.Dataset, ds: xr.Dataset | None = None, *, variables: list[str] | None = None
) -> xr.Dataset: ...

def contingency_table(matches: xr.Dataset) -> xr.Dataset: ...

class ObjectProperties(Operator): ...
class ContingencyTable(Operator): ...
```

## Behaviour
- `object_properties`: enrich a labelled-objects Dataset with mean / max / area-weighted statistics for each variable in `variables`. If `ds` is None, only geometric properties are computed.
- `contingency_table`: produce the 2×2 table per time step + a summary across time. Output schema is what V5.3 metrics consume.

## Acceptance criteria
- [ ] Both implemented in `phenomena/_src/properties.py`.
- [ ] `object_properties` on a synthetic blob recovers the imposed mean / max within tolerance.
- [ ] `contingency_table` on identical pred/ref matches produces all-Hits, zero FAs / Misses.
- [ ] Output Datasets conform to the schemas documented in V5.1 / V5.3.

Contributor guide

Open the contributing guide

Research direction

Start with the V5.1 and V5.3 schema documentation and inspect the existing interfaces in phenomena/_src/properties.py. Implement the two functions and Operator classes there, then validate the synthetic-blob mean/max case, the identical prediction/reference all-Hits case, and schema conformity for both output Datasets.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.