diff --git a/docs/conf.py b/docs/conf.py index 698970e65..2a6a096d4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -114,6 +114,11 @@ ] +# Define the prefix block that should not be copied in code-blocks +copybutton_prompt_text = r"\$ |\$> |>>> |\.\.\. " +copybutton_prompt_is_regexp = True +copybutton_line_continuation_character = "\\" + napoleon_preprocess_types = True # If numpydoc is available, then let sphinx report warnings diff --git a/src/sisl/_core/_ufuncs_geometry.py b/src/sisl/_core/_ufuncs_geometry.py index 3bb6ddc11..83571a5f7 100644 --- a/src/sisl/_core/_ufuncs_geometry.py +++ b/src/sisl/_core/_ufuncs_geometry.py @@ -779,6 +779,7 @@ def tile(geometry: Geometry, reps: int, axis: CellAxis) -> Geometry: [1.5 1. 0. ]] In functional form: + >>> tile(geom, 2, axis=0) See Also @@ -858,6 +859,7 @@ def untile( True In functional form: + >>> untile(geom, 2, axis=0) See Also diff --git a/src/sisl/_core/_ufuncs_lattice.py b/src/sisl/_core/_ufuncs_lattice.py index a4f120295..4fc077687 100644 --- a/src/sisl/_core/_ufuncs_lattice.py +++ b/src/sisl/_core/_ufuncs_lattice.py @@ -6,7 +6,7 @@ import math from functools import reduce from numbers import Integral -from typing import Union +from typing import Optional, Union import numpy as np @@ -26,12 +26,12 @@ @register_sisl_dispatch(Lattice, module="sisl") -def copy(lattice: Lattice, cell=None, **kwargs) -> Lattice: - """A deepcopy of the object +def copy(lattice: Lattice, cell: Optional[np.ndarray] = None, **kwargs) -> Lattice: + """A deep copy of the object Parameters ---------- - cell : array_like + cell : the new cell parameters """ d = dict() @@ -256,16 +256,16 @@ def rotate( @register_sisl_dispatch(Lattice, module="sisl") -def add(lattice: Lattice, other) -> Lattice: +def add(lattice: Lattice, other: LatticeLike) -> Lattice: """Add two supercell lattice vectors to each other Parameters ---------- - other : Lattice, array_like + other : the lattice vectors of the other supercell to add """ if not isinstance(other, Lattice): - other = Lattice(other) + other = Lattice.new(other) cell = lattice.cell + other.cell origin = lattice.origin + other.origin nsc = np.where(lattice.nsc > other.nsc, lattice.nsc, other.nsc) diff --git a/src/sisl/_core/geometry.py b/src/sisl/_core/geometry.py index 6dc423d12..57808e653 100644 --- a/src/sisl/_core/geometry.py +++ b/src/sisl/_core/geometry.py @@ -1473,15 +1473,15 @@ def sub_orbital(self, atoms: AtomsIndex, orbitals: OrbitalsIndex) -> Geometry: Parameters ---------- - atoms : array_like of int or Atom + atoms : indices of atoms or `Atom` that will be reduced in size according to `orbitals` - orbitals : array_like of int or Orbital + orbitals : indices of the orbitals on `atoms` that are retained in the geometry, the list of orbitals will be sorted. Notes ----- - Future implementations may allow one to re-arange orbitals using this method. + Future implementations may allow one to re-arrange orbitals using this method. When using this method the internal species list will be populated by another specie that is named after the orbitals removed. This is to distinguish different atoms.