Skip to content

Commit

Permalink
Fix signature
Browse files Browse the repository at this point in the history
  • Loading branch information
lan496 committed Mar 11, 2024
1 parent 94edadd commit 73dd44c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
1 change: 1 addition & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions moyopy/python/moyopy/_moyopy.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from __future__ import annotations

from typing import Literal

###############################################################################
# base
###############################################################################
Expand Down Expand Up @@ -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,
Expand All @@ -63,15 +61,15 @@ 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
def std_origin_shift(self) -> list[float]: ...
@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
Expand Down
11 changes: 3 additions & 8 deletions moyopy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<f64>,
setting: Option<PySetting>,
Expand All @@ -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))
}

Expand Down

0 comments on commit 73dd44c

Please sign in to comment.