Skip to content

Commit

Permalink
#52 Merge pull request from deshima-dev/astropenguin/issue51
Browse files Browse the repository at this point in the history
Update specifications for MS
  • Loading branch information
astropenguin authored Dec 4, 2023
2 parents aa22772 + b0b65f8 commit 40197a4
Show file tree
Hide file tree
Showing 9 changed files with 155 additions and 152 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dems",
"image":"python:3.11",
"onCreateCommand": "pip install poetry==1.6.1",
"onCreateCommand": "pip install poetry==1.7.1",
"postCreateCommand": "poetry install",
"containerEnv": {
"POETRY_VIRTUALENVS_CREATE": "false"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
with:
python-version: "3.12"
- name: Publish package to PyPI
run: pip install poetry && poetry publish --build
run: pip install poetry==1.7.1 && poetry publish --build
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
python-version: ${{ matrix.python }}
- name: Install project dependencies
run: pip install poetry && poetry install
run: pip install poetry==1.7.1 && poetry install
- name: Test code's formatting (Black)
run: black --check dems tests
- name: Test code's typing (Pyright)
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ message: "If you use this software, please cite it as below."

title: "dems"
abstract: "DESHIMA measurement set by DataArray"
version: 0.8.0
date-released: 2023-11-07
version: 0.9.0
date-released: 2023-12-04
license: "MIT"
doi: "10.5281/zenodo.8151950"
url: "https://github.com/deshima-dev/dems"
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,7 @@ da = MS.new(
| | d2_mkid_frequency | Coordinate | [DESHIMA 2.0] MKID center frequency | Hz | 0.0 | numpy.ndarray | (chan,) | float64 |
| | d2_roomchopper_isblocking | Coordinate | [DESHIMA 2.0] Whether room chopper is blocking sensor | - | False | numpy.ndarray | (time,) | bool |
| | d2_skychopper_isblocking | Coordinate | [DESHIMA 2.0] Whether sky chopper is blocking sensor | - | False | numpy.ndarray | (time,) | bool |
| | d2_dems_version | Attribute | [DESHIMA 2.0] DEMS version | - | "0.8.0" | str | - | - |
| | d2_demerge_version | Attribute | [DESHIMA 2.0] demerge version | - | "2.0.0" | str | - | - |
| | d2_ddb_version | Attribute | [DESHIMA 2.0] DDB version | - | "" | str | - | - |
| | d2_demerge_version | Attribute | [DESHIMA 2.0] demerge version | - | "" | str | - | - |
| | d2_dems_version | Attribute | [DESHIMA 2.0] DEMS version | - | - | str | - | - |
| | d2_merge_datetime | Attribute | [DESHIMA 2.0] Date and time of the data merge | - | - | str | - | - |
2 changes: 1 addition & 1 deletion dems/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__all__ = ["d1", "d2"]
__version__ = "0.8.0"
__version__ = "0.9.0"


# submodules
Expand Down
26 changes: 17 additions & 9 deletions dems/d2.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@


# standard library
from dataclasses import dataclass
from dataclasses import dataclass, field
from datetime import datetime, timezone
from typing import Any, Literal, Tuple


Expand All @@ -30,8 +31,6 @@
-2475718.801708271,
)
CUBE_DIMS = "chan", "lat", "lon"
DEMS_VERSION = __version__
DEMERGE_VERSION = "2.0.0"
MS_DIMS = "time", "chan"


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


@dataclass(frozen=True)
@dataclass
class MS(AsDataArray):
"""Measurement set of DESHIMA 2.0."""

Expand Down Expand Up @@ -382,11 +381,18 @@ class MS(AsDataArray):
d2_mkid_frequency: Coordof[D2MkidFrequency] = 0.0
d2_roomchopper_isblocking: Coordof[D2RoomchopperIsblocking] = False
d2_skychopper_isblocking: Coordof[D2SkychopperIsblocking] = False
d2_dems_version: Attr[str] = DEMS_VERSION
d2_demerge_version: Attr[str] = DEMERGE_VERSION
d2_ddb_version: Attr[str] = ""
d2_demerge_version: Attr[str] = ""
d2_dems_version: Attr[str] = field(init=False)
d2_merge_datetime: Attr[str] = field(init=False)

def __post_init__(self) -> None:
"""Set dynamic attributes."""
self.d2_dems_version = __version__
self.d2_merge_datetime = datetime.now(timezone.utc).isoformat()


@dataclass(frozen=True)
@dataclass
class Cube(AsDataArray):
"""Spectral cube of DESHIMA 2.0."""

Expand Down Expand Up @@ -415,5 +421,7 @@ class Cube(AsDataArray):
d2_mkid_id: Coordof[D2MkidID] = 0
d2_mkid_type: Coordof[D2MkidType] = ""
d2_mkid_frequency: Coordof[D2MkidFrequency] = 0.0
d2_dems_version: Attr[str] = DEMS_VERSION
d2_demerge_version: Attr[str] = DEMERGE_VERSION
d2_ddb_version: Attr[str] = ""
d2_demerge_version: Attr[str] = ""
d2_dems_version: Attr[str] = ""
d2_merge_datetime: Attr[str] = ""
257 changes: 125 additions & 132 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dems"
version = "0.8.0"
version = "0.9.0"
description = "DESHIMA measurement set by DataArray"
authors = ["Akio Taniguchi <taniguchi@a.phys.nagoya-u.ac.jp>"]
license = "MIT"
Expand All @@ -11,8 +11,8 @@ python = ">=3.9, <3.13"
xarray-dataclasses = "^1.7"

[tool.poetry.group.dev.dependencies]
black = "^23.10"
ipython = "^8.16"
black = "^23.11"
ipython = "^8.18"
pyright = "^1.1"
pytest = "^7.4"

Expand Down

0 comments on commit 40197a4

Please sign in to comment.