Skip to content

Commit cfb8a07

Browse files
authored
#245 Merge pull request from deshima-dev/astropenguin/issue244
Do not keep name in utils.phaseof by default
2 parents c0dc636 + eea92fa commit cfb8a07

6 files changed

Lines changed: 16 additions & 7 deletions

File tree

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ keywords:
3333
- spectroscopy
3434
- submillimeter
3535
license: MIT
36-
version: 2025.6.1
37-
date-released: '2025-06-23'
36+
version: 2025.8.0
37+
date-released: '2025-08-18'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ DESHIMA code for data analysis
1111
## Installation
1212

1313
```shell
14-
pip install decode==2025.6.1
14+
pip install decode==2025.8.0
1515
```
1616

1717
## Quick look

decode/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"stats",
1212
"utils",
1313
]
14-
__version__ = "2025.6.1"
14+
__version__ = "2025.8.0"
1515

1616

1717
# submodules

decode/utils.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def phaseof(
4646
*,
4747
keep_attrs: bool = False,
4848
keep_coords: bool = False,
49+
keep_name: bool = False,
4950
) -> xr.DataArray:
5051
"""Assign a phase to each value in a 1D DataArray.
5152
@@ -57,6 +58,7 @@ def phaseof(
5758
da: Input 1D DataArray.
5859
keep_attrs: Whether to keep attributes of the input.
5960
keep_coords: Whether to keep coordinates of the input.
61+
keep_name: Whether to keep name of the input.
6062
6163
Returns:
6264
1D int64 DataArray of phases.
@@ -69,4 +71,11 @@ def phaseof(
6971
is_transision.data[1:] = da.data[1:] != da.data[:-1]
7072

7173
phase = is_transision.cumsum(keep_attrs=keep_attrs)
72-
return phase if keep_coords else phase.reset_coords(drop=True)
74+
75+
if not keep_coords:
76+
phase = phase.reset_coords(drop=True)
77+
78+
if not keep_name:
79+
phase = phase.rename(None)
80+
81+
return phase

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "decode"
3-
version = "2025.6.1"
3+
version = "2025.8.0"
44
description = "DESHIMA code for data analysis"
55
readme = "README.md"
66
keywords = [

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)