diff --git a/justfile b/justfile index 8e38f0b..88d4442 100644 --- a/justfile +++ b/justfile @@ -10,6 +10,7 @@ build-python: install-python: maturin develop --release --manifest-path moyopy/Cargo.toml pip install -e "moyopy[dev]" + pre-commit install test-python: pytest -v moyopy/python/tests diff --git a/moyopy/python/moyopy/_moyopy.pyi b/moyopy/python/moyopy/_moyopy.pyi index 996aaca..00fd680 100644 --- a/moyopy/python/moyopy/_moyopy.pyi +++ b/moyopy/python/moyopy/_moyopy.pyi @@ -1,7 +1,5 @@ from __future__ import annotations -from typing import Literal - ############################################################################### # base ############################################################################### @@ -45,7 +43,7 @@ class Setting: class MoyoDataset: def __init__( self, - structure: Structure, + cell: Cell, symprec: float = 1e-4, angle_tolerance: float | None = None, setting: Setting | None = None, @@ -63,7 +61,7 @@ class MoyoDataset: @property def site_symmetry_symbols(self) -> list[str]: ... @property - def std_cell(self) -> Structure: ... + def std_cell(self) -> Cell: ... @property def std_linear(self) -> list[list[float]]: ... @property @@ -71,7 +69,7 @@ class MoyoDataset: @property def std_rotation_matrix(self) -> list[list[float]]: ... @property - def prim_std_cell(self) -> Structure: ... + def prim_std_cell(self) -> Cell: ... @property def prim_std_linear(self) -> list[list[float]]: ... @property diff --git a/moyopy/src/lib.rs b/moyopy/src/lib.rs index 13aa2a7..1d791ae 100644 --- a/moyopy/src/lib.rs +++ b/moyopy/src/lib.rs @@ -20,9 +20,9 @@ pub struct PyMoyoDataset(MoyoDataset); #[pymethods] impl PyMoyoDataset { #[new] - #[pyo3(signature = (structure, *, symprec=1e-4, angle_tolerance=None, setting=None))] + #[pyo3(signature = (cell, *, symprec=1e-4, angle_tolerance=None, setting=None))] pub fn new( - structure: &PyStructure, + cell: &PyStructure, symprec: f64, angle_tolerance: Option, setting: Option, @@ -39,12 +39,7 @@ impl PyMoyoDataset { Setting::Spglib }; - let dataset = MoyoDataset::new( - &structure.to_owned().into(), - symprec, - angle_tolerance, - setting, - )?; + let dataset = MoyoDataset::new(&cell.to_owned().into(), symprec, angle_tolerance, setting)?; Ok(PyMoyoDataset(dataset)) }