Skip to content

Commit 40197a4

Browse files
authored
#52 Merge pull request from deshima-dev/astropenguin/issue51
Update specifications for MS
2 parents aa22772 + b0b65f8 commit 40197a4

9 files changed

Lines changed: 155 additions & 152 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "dems",
33
"image":"python:3.11",
4-
"onCreateCommand": "pip install poetry==1.6.1",
4+
"onCreateCommand": "pip install poetry==1.7.1",
55
"postCreateCommand": "poetry install",
66
"containerEnv": {
77
"POETRY_VIRTUALENVS_CREATE": "false"

.github/workflows/pypi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ jobs:
1717
with:
1818
python-version: "3.12"
1919
- name: Publish package to PyPI
20-
run: pip install poetry && poetry publish --build
20+
run: pip install poetry==1.7.1 && poetry publish --build

.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
with:
2525
python-version: ${{ matrix.python }}
2626
- name: Install project dependencies
27-
run: pip install poetry && poetry install
27+
run: pip install poetry==1.7.1 && poetry install
2828
- name: Test code's formatting (Black)
2929
run: black --check dems tests
3030
- name: Test code's typing (Pyright)

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ message: "If you use this software, please cite it as below."
33

44
title: "dems"
55
abstract: "DESHIMA measurement set by DataArray"
6-
version: 0.8.0
7-
date-released: 2023-11-07
6+
version: 0.9.0
7+
date-released: 2023-12-04
88
license: "MIT"
99
doi: "10.5281/zenodo.8151950"
1010
url: "https://github.com/deshima-dev/dems"

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,7 @@ da = MS.new(
8383
| | d2_mkid_frequency | Coordinate | [DESHIMA 2.0] MKID center frequency | Hz | 0.0 | numpy.ndarray | (chan,) | float64 |
8484
| | d2_roomchopper_isblocking | Coordinate | [DESHIMA 2.0] Whether room chopper is blocking sensor | - | False | numpy.ndarray | (time,) | bool |
8585
| | d2_skychopper_isblocking | Coordinate | [DESHIMA 2.0] Whether sky chopper is blocking sensor | - | False | numpy.ndarray | (time,) | bool |
86-
| | d2_dems_version | Attribute | [DESHIMA 2.0] DEMS version | - | "0.8.0" | str | - | - |
87-
| | d2_demerge_version | Attribute | [DESHIMA 2.0] demerge version | - | "2.0.0" | str | - | - |
86+
| | d2_ddb_version | Attribute | [DESHIMA 2.0] DDB version | - | "" | str | - | - |
87+
| | d2_demerge_version | Attribute | [DESHIMA 2.0] demerge version | - | "" | str | - | - |
88+
| | d2_dems_version | Attribute | [DESHIMA 2.0] DEMS version | - | - | str | - | - |
89+
| | d2_merge_datetime | Attribute | [DESHIMA 2.0] Date and time of the data merge | - | - | str | - | - |

dems/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__all__ = ["d1", "d2"]
2-
__version__ = "0.8.0"
2+
__version__ = "0.9.0"
33

44

55
# submodules

dems/d2.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88

99
# standard library
10-
from dataclasses import dataclass
10+
from dataclasses import dataclass, field
11+
from datetime import datetime, timezone
1112
from typing import Any, Literal, Tuple
1213

1314

@@ -30,8 +31,6 @@
3031
-2475718.801708271,
3132
)
3233
CUBE_DIMS = "chan", "lat", "lon"
33-
DEMS_VERSION = __version__
34-
DEMERGE_VERSION = "2.0.0"
3534
MS_DIMS = "time", "chan"
3635

3736

@@ -318,7 +317,7 @@ class D2SkychopperIsblocking:
318317
long_name: Attr[str] = "[DESHIMA 2.0] Whether sky chopper is blocking sensor"
319318

320319

321-
@dataclass(frozen=True)
320+
@dataclass
322321
class MS(AsDataArray):
323322
"""Measurement set of DESHIMA 2.0."""
324323

@@ -382,11 +381,18 @@ class MS(AsDataArray):
382381
d2_mkid_frequency: Coordof[D2MkidFrequency] = 0.0
383382
d2_roomchopper_isblocking: Coordof[D2RoomchopperIsblocking] = False
384383
d2_skychopper_isblocking: Coordof[D2SkychopperIsblocking] = False
385-
d2_dems_version: Attr[str] = DEMS_VERSION
386-
d2_demerge_version: Attr[str] = DEMERGE_VERSION
384+
d2_ddb_version: Attr[str] = ""
385+
d2_demerge_version: Attr[str] = ""
386+
d2_dems_version: Attr[str] = field(init=False)
387+
d2_merge_datetime: Attr[str] = field(init=False)
388+
389+
def __post_init__(self) -> None:
390+
"""Set dynamic attributes."""
391+
self.d2_dems_version = __version__
392+
self.d2_merge_datetime = datetime.now(timezone.utc).isoformat()
387393

388394

389-
@dataclass(frozen=True)
395+
@dataclass
390396
class Cube(AsDataArray):
391397
"""Spectral cube of DESHIMA 2.0."""
392398

@@ -415,5 +421,7 @@ class Cube(AsDataArray):
415421
d2_mkid_id: Coordof[D2MkidID] = 0
416422
d2_mkid_type: Coordof[D2MkidType] = ""
417423
d2_mkid_frequency: Coordof[D2MkidFrequency] = 0.0
418-
d2_dems_version: Attr[str] = DEMS_VERSION
419-
d2_demerge_version: Attr[str] = DEMERGE_VERSION
424+
d2_ddb_version: Attr[str] = ""
425+
d2_demerge_version: Attr[str] = ""
426+
d2_dems_version: Attr[str] = ""
427+
d2_merge_datetime: Attr[str] = ""

poetry.lock

Lines changed: 125 additions & 132 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "dems"
3-
version = "0.8.0"
3+
version = "0.9.0"
44
description = "DESHIMA measurement set by DataArray"
55
authors = ["Akio Taniguchi <taniguchi@a.phys.nagoya-u.ac.jp>"]
66
license = "MIT"
@@ -11,8 +11,8 @@ python = ">=3.9, <3.13"
1111
xarray-dataclasses = "^1.7"
1212

1313
[tool.poetry.group.dev.dependencies]
14-
black = "^23.10"
15-
ipython = "^8.16"
14+
black = "^23.11"
15+
ipython = "^8.18"
1616
pyright = "^1.1"
1717
pytest = "^7.4"
1818

0 commit comments

Comments
 (0)