Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate stub files #53

Merged
merged 3 commits into from
Jan 23, 2025
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
22 changes: 22 additions & 0 deletions .github/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
changelog:
categories:
- title: 🛠 Breaking Changes
labels:
- Semver-Major
- breaking-changes
- title: 🎉 New Features
labels:
- Semver-Minor
- enhancement
- title: ⚠️ Deprecation
labels:
- deprecation
- title: 🐞 Bug fixes
labels:
- bug
- title: 📔 Documentation
labels:
- documentation
- title: Other changes
labels:
- '*'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ lcov.info
!**/assets/*.json
.env
*.png
*.cif

docs/note/

Expand Down
25 changes: 25 additions & 0 deletions moyopy/python/moyopy/_base.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
class Cell:
def __init__(
self,
basis: list[list[float]],
positions: list[list[float]],
numbers: list[int],
): ...
@property
def basis(self) -> list[list[float]]: ...
@property
def positions(self) -> list[list[float]]: ...
@property
def numbers(self) -> list[int]: ...
def serialize_json(self) -> str: ...
@classmethod
def deserialize_json(cls, json_str: str) -> Cell: ...

class Operations:
@property
def rotations(self) -> list[list[list[float]]]: ...
@property
def translations(self) -> list[list[float]]: ...
@property
def num_operations(self) -> int: ...
def __len__(self) -> int: ...
46 changes: 46 additions & 0 deletions moyopy/python/moyopy/_data.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
from moyopy._base import Operations

class Setting:
"""Preference for the setting of the space group."""
@classmethod
def spglib(cls) -> Setting:
"""The setting of the smallest Hall number."""
@classmethod
def standard(cls) -> Setting:
"""Unique axis b, cell choice 1 for monoclinic, hexagonal axes for rhombohedral,
and origin choice 2 for centrosymmetric space groups."""
@classmethod
def hall_number(cls, hall_number: int) -> Setting:
"""Specific Hall number from 1 to 530."""

class Centering: ...

class HallSymbolEntry:
"""An entry containing space-group information for a specified hall_number."""
def __init__(self, hall_number: int): ...
@property
def hall_number(self) -> int:
"""Number for Hall symbols (1 - 530)."""
@property
def number(self) -> int:
"""ITA number for space group types (1 - 230)."""
@property
def arithmetic_number(self) -> int:
"""Number for arithmetic crystal classes (1 - 73)."""
@property
def setting(self) -> Setting:
"""Setting."""
@property
def hall_symbol(self) -> str:
"""Hall symbol."""
@property
def hm_short(self) -> str:
"""Hermann-Mauguin symbol in short notation."""
@property
def hm_full(self) -> str:
"""Hermann-Mauguin symbol in full notation."""
@property
def centering(self) -> Centering:
"""Centering."""

def operations_from_number(number: int, setting: Setting) -> Operations: ...
100 changes: 16 additions & 84 deletions moyopy/python/moyopy/_moyopy.pyi
Original file line number Diff line number Diff line change
@@ -1,90 +1,8 @@
from __future__ import annotations
from moyopy._base import Cell, Operations # noqa: F401
from moyopy._data import Centering, HallSymbolEntry, Setting, operations_from_number # noqa: F401

__version__: str

###############################################################################
# base
###############################################################################

class Cell:
def __init__(
self,
basis: list[list[float]],
positions: list[list[float]],
numbers: list[int],
): ...
@property
def basis(self) -> list[list[float]]: ...
@property
def positions(self) -> list[list[float]]: ...
@property
def numbers(self) -> list[int]: ...
def serialize_json(self) -> str: ...
@classmethod
def deserialize_json(cls, json_str: str) -> Cell: ...

class Operations:
@property
def rotations(self) -> list[list[list[float]]]: ...
@property
def translations(self) -> list[list[float]]: ...
@property
def num_operations(self) -> int: ...
def __len__(self) -> int: ...

###############################################################################
# data
###############################################################################

class Setting:
"""Preference for the setting of the space group."""
@classmethod
def spglib(cls) -> Setting:
"""The setting of the smallest Hall number."""
@classmethod
def standard(cls) -> Setting:
"""Unique axis b, cell choice 1 for monoclinic, hexagonal axes for rhombohedral,
and origin choice 2 for centrosymmetric space groups."""
@classmethod
def hall_number(cls, hall_number: int) -> Setting:
"""Specific Hall number from 1 to 530."""

def operations_from_number(number: int, setting: Setting) -> Operations: ...

class Centering: ...

class HallSymbolEntry:
"""An entry containing space-group information for a specified hall_number."""
def __init__(self, hall_number: int): ...
@property
def hall_number(self) -> int:
"""Number for Hall symbols (1 - 530)."""
@property
def number(self) -> int:
"""ITA number for space group types (1 - 230)."""
@property
def arithmetic_number(self) -> int:
"""Number for arithmetic crystal classes (1 - 73)."""
@property
def setting(self) -> Setting:
"""Setting."""
@property
def hall_symbol(self) -> str:
"""Hall symbol."""
@property
def hm_short(self) -> str:
"""Hermann-Mauguin symbol in short notation."""
@property
def hm_full(self) -> str:
"""Hermann-Mauguin symbol in full notation."""
@property
def centering(self) -> Centering:
"""Centering."""

###############################################################################
# lib
###############################################################################

class MoyoDataset:
"""A dataset containing symmetry information of the input crystal structure."""
def __init__(
Expand Down Expand Up @@ -173,3 +91,17 @@ class MoyoDataset:
@property
def angle_tolerance(self) -> float | None:
"""Actually used `angle_tolerance` in iterative symmetry search."""

__all__ = [
# base
"Cell",
"Operations",
# data
"Setting",
"Centering",
"HallSymbolEntry",
"operations_from_number",
# lib
"__version__",
"MoyoDataset",
]
Loading
Loading