Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit 9f4cd9f

Browse files
initial Dimension protocol (#1)
* initial `Dimension` protocol * Apply suggestions from code review Co-authored-by: Joren Hammudoglu <[email protected]> * remove `__eq__` * add is_dimensionless * remove is_dimensionless --------- Co-authored-by: Joren Hammudoglu <[email protected]>
1 parent 0462e58 commit 9f4cd9f

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# SCM syntax highlighting
2+
pixi.lock linguist-language=YAML linguist-generated=true

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
# pixi environments
3+
.pixi
4+
*.egg-info

pyproject.toml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[project]
2+
authors = [{ name = "quantity-dev contributors" }]
3+
dependencies = []
4+
name = "dimension-api"
5+
requires-python = ">= 3.12"
6+
version = "0.0.1.dev0"
7+
8+
[build-system]
9+
build-backend = "hatchling.build"
10+
requires = ["hatchling"]
11+
12+
[tool.pixi.project]
13+
channels = ["https://prefix.dev/conda-forge"]
14+
platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"]
15+
16+
[tool.pixi.pypi-dependencies]
17+
dimension_api = { path = ".", editable = true }

src/dimension_api/__init__.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"""Dimension API."""
2+
3+
from typing import Final, Protocol, Self, runtime_checkable
4+
5+
__version__: Final = "0.0.1.dev0"
6+
__all__ = ["__version__", "Dimension"]
7+
8+
@runtime_checkable
9+
class Dimension(Protocol):
10+
def __mul__(self, other: Self, /) -> Self: ...
11+
def __truediv__(self, other: Self, /) -> Self: ...
12+
def __pow__(self, other: int, /) -> Self: ...

0 commit comments

Comments
 (0)