Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
{
"name": "dems",
"image":"python:3.11",
"features": {
"ghcr.io/devcontainers-contrib/features/poetry:2": {
"version": "1.8.3"
}
},
"containerEnv": {
"POETRY_VIRTUALENVS_CREATE": "false"
},
"image": "ghcr.io/astral-sh/uv:python3.12-bookworm",
"runArgs": [
"--name=dems"
],
"postCreateCommand": "poetry install",
"containerEnv": {
"UV_PROJECT_ENVIRONMENT": "/usr/local"
},
"postCreateCommand": "uv sync --frozen",
"customizations": {
"vscode": {
"extensions": [
"github.vscode-pull-request-github",
"mhutchie.git-graph",
"ms-python.black-formatter",
"ms-python.python",
"streetsidesoftware.code-spell-checker",
Expand All @@ -26,12 +19,11 @@
"settings": {
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"python.analysis.autoImportCompletions": true,
"python.languageServer": "Pylance",
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.tabSize": 4,
"python.languageServer": "Pylance"
"editor.formatOnSave": true
}
}
}
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ jobs:
job:
name: PyPI
runs-on: ubuntu-latest
container: ghcr.io/astral-sh/uv:python3.12-bookworm
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
UV_PROJECT_ENVIRONMENT: /usr/local
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: abatilo/actions-poetry@v3
with:
poetry-version: "1.8.3"
- run: poetry publish --build
- run: uv build && uv publish
24 changes: 11 additions & 13 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,24 @@ on:

jobs:
job:
name: Test (Python ${{ matrix.python }})
name: Test (${{ matrix.env }})
runs-on: ubuntu-latest
container: ghcr.io/astral-sh/uv:${{ matrix.env }}
env:
POETRY_VIRTUALENVS_CREATE: false
PYTHON_DIRS: dems tests
UV_PROJECT_ENVIRONMENT: /usr/local
strategy:
fail-fast: false
matrix:
python: ["3.9", "3.10", "3.11", "3.12"]
env:
- python3.9-bookworm
- python3.10-bookworm
- python3.11-bookworm
- python3.12-bookworm
- python3.13-bookworm
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: abatilo/actions-poetry@v3
with:
poetry-version: "1.8.3"
- run: poetry install
- run: uv sync --frozen
- run: black --check ${PYTHON_DIRS}
- run: pyright ${PYTHON_DIRS}
- run: pytest -v tests
- run: pytest -v
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ da = MS.new(
| Weather information | temperature | Coordinate | Ground atmospheric temperature | K | 0.0 | numpy.ndarray | (time,) | float64 |
| | pressure | Coordinate | Ground atmospheric pressure | hPa | 0.0 | numpy.ndarray | (time,) | float64 |
| | humidity | Coordinate | Ground relative humidity | % | 0.0 | numpy.ndarray | (time,) | float64 |
| | pwv | Coordinate | Precipitable water vapor | mm | 0.0 | numpy.ndarray | (time,) | float64 |
| | wind_speed | Coordinate | Ground wind speed | m s^-1 | 0.0 | numpy.ndarray | (time,) | float64 |
| | wind_direction | Coordinate | Ground wind direction | deg | 0.0 | numpy.ndarray | (time,) | float64 |
| Data information | bandwidth | Coordinate | Effective channel bandwidth | Hz | 0.0 | numpy.ndarray | (chan,) | float64 |
Expand Down
8 changes: 8 additions & 0 deletions dems/d2.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ class Humidity:
units: Attr[str] = "%"


@dataclass
class PWV:
data: Data[Ti, float]
long_name: Attr[str] = "Precipitable water vapor"
units: Attr[str] = "mm"


@dataclass
class WindSpeed:
data: Data[Ti, float]
Expand Down Expand Up @@ -373,6 +380,7 @@ class MS(AsDataArray):
temperature: Coordof[Temperature] = 0.0
pressure: Coordof[Pressure] = 0.0
humidity: Coordof[Humidity] = 0.0
pwv: Coordof[PWV] = 0.0
wind_speed: Coordof[WindSpeed] = 0.0
wind_direction: Coordof[WindDirection] = 0.0
# data information
Expand Down
684 changes: 0 additions & 684 deletions poetry.lock

This file was deleted.

53 changes: 37 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,45 @@
[tool.poetry]
[project]
name = "dems"
version = "2024.7.2"
description = "DESHIMA measurement set by DataArray"
authors = ["Akio Taniguchi <taniguchi@a.phys.nagoya-u.ac.jp>"]
license = "MIT"
description = "DESHIMA Measurement Set"
readme = "README.md"
keywords = [
"astronomy",
"data-format",
"deshima",
"measurement-set",
"spectroscopy",
"submillimeter",
]
requires-python = ">=3.9,<3.14"
dependencies = ["xarray-dataclasses>=1.8,<2.0"]
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]

[tool.poetry.dependencies]
python = ">=3.9, <3.13"
xarray-dataclasses = "^1.8"
[[project.authors]]
name = "Akio Taniguchi"
email = "taniguchi.akio@gmail.com"

[tool.poetry.group.dev.dependencies]
black = "^24.4"
ipython = "^8.18"
pyright = "^1.1"
pytest = "^8.2"
[project.license]
file = "LICENSE"

[tool.pyright]
typeCheckingMode = "basic"
[project.urls]
homepage = "https://github.com/deshima-dev/dems"
repository = "https://github.com/deshima-dev/dems"

[dependency-groups]
dev = ["black>=24.4", "ipython>=8.18", "pyright>=1.1", "pytest>=8.2"]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.pyright]
typeCheckingMode = "basic"
Loading