Skip to content

Commit c42b4ee

Browse files
authored
#72 Merge pull request from deshima-dev/astropenguin/issue71
Add PWV coordinate
2 parents ad83776 + 83dfe28 commit c42b4ee

8 files changed

Lines changed: 905 additions & 737 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
11
{
22
"name": "dems",
3-
"image":"python:3.11",
4-
"features": {
5-
"ghcr.io/devcontainers-contrib/features/poetry:2": {
6-
"version": "1.8.3"
7-
}
8-
},
9-
"containerEnv": {
10-
"POETRY_VIRTUALENVS_CREATE": "false"
11-
},
3+
"image": "ghcr.io/astral-sh/uv:python3.12-bookworm",
124
"runArgs": [
135
"--name=dems"
146
],
15-
"postCreateCommand": "poetry install",
7+
"containerEnv": {
8+
"UV_PROJECT_ENVIRONMENT": "/usr/local"
9+
},
10+
"postCreateCommand": "uv sync --frozen",
1611
"customizations": {
1712
"vscode": {
1813
"extensions": [
19-
"github.vscode-pull-request-github",
20-
"mhutchie.git-graph",
2114
"ms-python.black-formatter",
2215
"ms-python.python",
2316
"streetsidesoftware.code-spell-checker",
@@ -26,12 +19,11 @@
2619
"settings": {
2720
"files.insertFinalNewline": true,
2821
"files.trimTrailingWhitespace": true,
22+
"python.analysis.autoImportCompletions": true,
23+
"python.languageServer": "Pylance",
2924
"[python]": {
3025
"editor.defaultFormatter": "ms-python.black-formatter",
31-
"editor.formatOnSave": true,
32-
"editor.insertSpaces": true,
33-
"editor.tabSize": 4,
34-
"python.languageServer": "Pylance"
26+
"editor.formatOnSave": true
3527
}
3628
}
3729
}

.github/workflows/pypi.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@ jobs:
99
job:
1010
name: PyPI
1111
runs-on: ubuntu-latest
12+
container: ghcr.io/astral-sh/uv:python3.12-bookworm
1213
env:
13-
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
14+
UV_PROJECT_ENVIRONMENT: /usr/local
15+
permissions:
16+
id-token: write
1417
steps:
1518
- uses: actions/checkout@v4
16-
- uses: actions/setup-python@v5
17-
with:
18-
python-version: "3.11"
19-
- uses: abatilo/actions-poetry@v3
20-
with:
21-
poetry-version: "1.8.3"
22-
- run: poetry publish --build
19+
- run: uv build && uv publish

.github/workflows/tests.yaml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,24 @@ on:
1010

1111
jobs:
1212
job:
13-
name: Test (Python ${{ matrix.python }})
13+
name: Test (${{ matrix.env }})
1414
runs-on: ubuntu-latest
15+
container: ghcr.io/astral-sh/uv:${{ matrix.env }}
1516
env:
16-
POETRY_VIRTUALENVS_CREATE: false
1717
PYTHON_DIRS: dems tests
18+
UV_PROJECT_ENVIRONMENT: /usr/local
1819
strategy:
1920
fail-fast: false
2021
matrix:
21-
python: ["3.9", "3.10", "3.11", "3.12"]
22+
env:
23+
- python3.9-bookworm
24+
- python3.10-bookworm
25+
- python3.11-bookworm
26+
- python3.12-bookworm
27+
- python3.13-bookworm
2228
steps:
2329
- uses: actions/checkout@v4
24-
with:
25-
submodules: true
26-
- uses: actions/setup-python@v5
27-
with:
28-
python-version: ${{ matrix.python }}
29-
- uses: abatilo/actions-poetry@v3
30-
with:
31-
poetry-version: "1.8.3"
32-
- run: poetry install
30+
- run: uv sync --frozen
3331
- run: black --check ${PYTHON_DIRS}
3432
- run: pyright ${PYTHON_DIRS}
35-
- run: pytest -v tests
33+
- run: pytest -v

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ da = MS.new(
5252
| Weather information | temperature | Coordinate | Ground atmospheric temperature | K | 0.0 | numpy.ndarray | (time,) | float64 |
5353
| | pressure | Coordinate | Ground atmospheric pressure | hPa | 0.0 | numpy.ndarray | (time,) | float64 |
5454
| | humidity | Coordinate | Ground relative humidity | % | 0.0 | numpy.ndarray | (time,) | float64 |
55+
| | pwv | Coordinate | Precipitable water vapor | mm | 0.0 | numpy.ndarray | (time,) | float64 |
5556
| | wind_speed | Coordinate | Ground wind speed | m s^-1 | 0.0 | numpy.ndarray | (time,) | float64 |
5657
| | wind_direction | Coordinate | Ground wind direction | deg | 0.0 | numpy.ndarray | (time,) | float64 |
5758
| Data information | bandwidth | Coordinate | Effective channel bandwidth | Hz | 0.0 | numpy.ndarray | (chan,) | float64 |

dems/d2.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ class Humidity:
148148
units: Attr[str] = "%"
149149

150150

151+
@dataclass
152+
class PWV:
153+
data: Data[Ti, float]
154+
long_name: Attr[str] = "Precipitable water vapor"
155+
units: Attr[str] = "mm"
156+
157+
151158
@dataclass
152159
class WindSpeed:
153160
data: Data[Ti, float]
@@ -373,6 +380,7 @@ class MS(AsDataArray):
373380
temperature: Coordof[Temperature] = 0.0
374381
pressure: Coordof[Pressure] = 0.0
375382
humidity: Coordof[Humidity] = 0.0
383+
pwv: Coordof[PWV] = 0.0
376384
wind_speed: Coordof[WindSpeed] = 0.0
377385
wind_direction: Coordof[WindDirection] = 0.0
378386
# data information

poetry.lock

Lines changed: 0 additions & 684 deletions
This file was deleted.

pyproject.toml

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,45 @@
1-
[tool.poetry]
1+
[project]
22
name = "dems"
33
version = "2024.7.2"
4-
description = "DESHIMA measurement set by DataArray"
5-
authors = ["Akio Taniguchi <taniguchi@a.phys.nagoya-u.ac.jp>"]
6-
license = "MIT"
4+
description = "DESHIMA Measurement Set"
75
readme = "README.md"
6+
keywords = [
7+
"astronomy",
8+
"data-format",
9+
"deshima",
10+
"measurement-set",
11+
"spectroscopy",
12+
"submillimeter",
13+
]
14+
requires-python = ">=3.9,<3.14"
15+
dependencies = ["xarray-dataclasses>=1.8,<2.0"]
16+
classifiers = [
17+
"License :: OSI Approved :: MIT License",
18+
"Programming Language :: Python :: 3",
19+
"Programming Language :: Python :: 3.9",
20+
"Programming Language :: Python :: 3.10",
21+
"Programming Language :: Python :: 3.11",
22+
"Programming Language :: Python :: 3.12",
23+
"Programming Language :: Python :: 3.13",
24+
]
825

9-
[tool.poetry.dependencies]
10-
python = ">=3.9, <3.13"
11-
xarray-dataclasses = "^1.8"
26+
[[project.authors]]
27+
name = "Akio Taniguchi"
28+
email = "taniguchi.akio@gmail.com"
1229

13-
[tool.poetry.group.dev.dependencies]
14-
black = "^24.4"
15-
ipython = "^8.18"
16-
pyright = "^1.1"
17-
pytest = "^8.2"
30+
[project.license]
31+
file = "LICENSE"
1832

19-
[tool.pyright]
20-
typeCheckingMode = "basic"
33+
[project.urls]
34+
homepage = "https://github.com/deshima-dev/dems"
35+
repository = "https://github.com/deshima-dev/dems"
36+
37+
[dependency-groups]
38+
dev = ["black>=24.4", "ipython>=8.18", "pyright>=1.1", "pytest>=8.2"]
2139

2240
[build-system]
23-
requires = ["poetry-core"]
24-
build-backend = "poetry.core.masonry.api"
41+
requires = ["hatchling"]
42+
build-backend = "hatchling.build"
43+
44+
[tool.pyright]
45+
typeCheckingMode = "basic"

0 commit comments

Comments
 (0)