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
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ keywords:
- spectroscopy
- submillimeter
license: MIT
version: 2025.6.1
date-released: '2025-06-23'
version: 2025.8.0
date-released: '2025-08-18'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ DESHIMA code for data analysis
## Installation

```shell
pip install decode==2025.6.1
pip install decode==2025.8.0
```

## Quick look
Expand Down
2 changes: 1 addition & 1 deletion decode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"stats",
"utils",
]
__version__ = "2025.6.1"
__version__ = "2025.8.0"


# submodules
Expand Down
11 changes: 10 additions & 1 deletion decode/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def phaseof(
*,
keep_attrs: bool = False,
keep_coords: bool = False,
keep_name: bool = False,
) -> xr.DataArray:
"""Assign a phase to each value in a 1D DataArray.

Expand All @@ -57,6 +58,7 @@ def phaseof(
da: Input 1D DataArray.
keep_attrs: Whether to keep attributes of the input.
keep_coords: Whether to keep coordinates of the input.
keep_name: Whether to keep name of the input.

Returns:
1D int64 DataArray of phases.
Expand All @@ -69,4 +71,11 @@ def phaseof(
is_transision.data[1:] = da.data[1:] != da.data[:-1]

phase = is_transision.cumsum(keep_attrs=keep_attrs)
return phase if keep_coords else phase.reset_coords(drop=True)

if not keep_coords:
phase = phase.reset_coords(drop=True)

if not keep_name:
phase = phase.rename(None)

return phase
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "decode"
version = "2025.6.1"
version = "2025.8.0"
description = "DESHIMA code for data analysis"
readme = "README.md"
keywords = [
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.