diff --git a/CITATION.cff b/CITATION.cff index 93ebb4a..8e43a96 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -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' diff --git a/README.md b/README.md index ee362ad..36bea73 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/decode/__init__.py b/decode/__init__.py index b4f556c..778e381 100644 --- a/decode/__init__.py +++ b/decode/__init__.py @@ -11,7 +11,7 @@ "stats", "utils", ] -__version__ = "2025.6.1" +__version__ = "2025.8.0" # submodules diff --git a/decode/utils.py b/decode/utils.py index 606ddf7..00d1d9e 100644 --- a/decode/utils.py +++ b/decode/utils.py @@ -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. @@ -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. @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 096d58a..e908458 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [ diff --git a/uv.lock b/uv.lock index 78d5b23..407cac0 100644 --- a/uv.lock +++ b/uv.lock @@ -535,7 +535,7 @@ wheels = [ [[package]] name = "decode" -version = "2025.6.1" +version = "2025.8.0" source = { editable = "." } dependencies = [ { name = "astropy", version = "6.0.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" },