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
12 changes: 0 additions & 12 deletions docs/apis/common.md
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
# `common`

<!-- prettier-ignore-start -->
::: t4_devkit.common.converter

::: t4_devkit.common.geometry

::: t4_devkit.common.io

::: t4_devkit.common.serialize

::: t4_devkit.common.timestamp
<!-- prettier-ignore-end -->
4 changes: 2 additions & 2 deletions docs/tutorials/customize.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ You can crate a schema containing the specified table data with a new token usin

```python
>>> from t4_devkit.schema import Attribute
>>> from t4_devkit.common.serialize import serialize_dataclass
>>> from t4_devkit.common import serialize_dataclass
>>>
>>> # schema data except of the unique identifier token
>>> data = {
Expand Down Expand Up @@ -58,7 +58,7 @@ from __future__ import annotations
from attrs import define, field

from t4_devkit.schema import SCHEMAS, SchemaName, SchemaBase
from t4_devkit.common.io import load_json
from t4_devkit.common import load_json

__all__ = ["CustomAttribute"]

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/initialize.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ An `attribute` is a property of an instance that may change throughout different
```

<!-- prettier-ignore-start -->
??? WARNING
!!! WARNING
Expected `level` values in `visibility` are as below:

<!-- markdownlint-disable MD046 -->
Expand Down
7 changes: 3 additions & 4 deletions docs/tutorials/sanity.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

About the defined rules, please refer to [requirement.md](../schema/requirement.md).

```python
from t4_devkit.common.io import save_json
from t4_devkit.common.serialize import serialize_dataclass
```python title="main.py"
from t4_devkit.common import save_json, serialize_dataclass
from t4_devkit.sanity import sanity_check, print_sanity_result


Expand All @@ -30,7 +29,7 @@ All checkers must follow:
- Override the `check() -> list[Reason] | None` method to perform the specific check.
- Register the checker using `CHECKERS.register()` decorator.

```python
```python title="str000.py"
from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
7 changes: 7 additions & 0 deletions t4_devkit/common/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from __future__ import annotations

from .converter import * # noqa
from .geometry import * # noqa
from .io import * # noqa
from .serialize import * # noqa
from .timestamp import * # noqa
Comment thread
ktro2828 marked this conversation as resolved.
3 changes: 3 additions & 0 deletions t4_devkit/common/serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
from pyquaternion import Quaternion


__all__ = ["serialize_dataclasses", "serialize_dataclass"]
Comment thread
ktro2828 marked this conversation as resolved.


def serialize_dataclasses(data: list[Any]) -> list[dict]:
"""Serialize list of attrs' dataclasses into list of dict.

Expand Down
3 changes: 3 additions & 0 deletions t4_devkit/common/timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
from t4_devkit.typing import ScalarLike


__all__ = ["microseconds2seconds", "seconds2microseconds"]


@deprecated("Please use `microseconds2seconds(...)` instead.")
def us2sec(timestamp: ScalarLike) -> float:
"""Convert timestamp from micro seconds [us] to seconds [s].
Expand Down
Loading