Skip to content

Commit

Permalink
fixed copybutton to remove prefixed notation
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Papior <[email protected]>
  • Loading branch information
zerothi committed Jan 6, 2025
1 parent 6330cdb commit 1126424
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
5 changes: 5 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/sisl/_core/_ufuncs_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -858,6 +859,7 @@ def untile(
True
In functional form:
>>> untile(geom, 2, axis=0)
See Also
Expand Down
14 changes: 7 additions & 7 deletions src/sisl/_core/_ufuncs_lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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()
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/sisl/_core/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 1126424

Please sign in to comment.