Skip to content

Commit

Permalink
Added warning when using nambu spin + changelog
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Papior <nickpapior@gmail.com>
  • Loading branch information
zerothi committed Nov 29, 2024
1 parent 846bb07 commit 09ab984
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ we hit release version 1.0.0.
import sisl
sisl.geom.graphene

- added Nambu spin configuration, this is still experimental

### Fixed
- `projection` arguments of several functions has been streamlined

Expand Down
6 changes: 6 additions & 0 deletions src/sisl/physics/spin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import numpy as np

from sisl._internal import set_module
from sisl.messages import warn

__all__ = ["Spin"]

Expand Down Expand Up @@ -100,6 +101,11 @@ def __init__(self, kind: Union[str, int] = "unpolarized"):
f"{self.__class__.__name__} initialization went wrong because of wrong "
"kind specification. Could not determine the kind of spin!"
)
if kind == Spin.NAMBU:
warn(
"Using untested Nambu spin-configuration, please be aware "
"that this is largely untested code!"
)

# Now assert the checks
self._kind = kind
Expand Down

0 comments on commit 09ab984

Please sign in to comment.