Skip to content

Commit b6baeb7

Browse files
committed
renamed section class names
Now they are exposed Signed-off-by: Nick Papior <[email protected]>
1 parent fb6a47e commit b6baeb7

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/sisl/geom/_composite.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
from sisl.messages import SislError, warn
55

6-
__all__ = ["composite_geometry"]
6+
__all__ = ["composite_geometry", "CompositeGeometrySection"]
77

88

99
@dataclass
10-
class _geom_section:
10+
class CompositeGeometrySection:
1111

1212
@abstractmethod
1313
def build_section(self, geometry):
@@ -30,7 +30,7 @@ def _junction_error(self, prev, msg, what):
3030
warn(msg)
3131

3232

33-
def composite_geometry(sections, section_cls=_geom_section, **kwargs):
33+
def composite_geometry(sections, section_cls, **kwargs):
3434
"""Creates a composite geometry from a list of sections.
3535
3636
The sections are added one after another in the provided order.
@@ -78,4 +78,5 @@ def conv(s):
7878

7979
return geom
8080

81-
composite_geometry.section = _geom_section
81+
82+
composite_geometry.section = CompositeGeometrySection

src/sisl/geom/nanoribbon.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from sisl._internal import set_module
1111

1212
from ._common import geometry_define_nsc
13-
from ._composite import _geom_section, composite_geometry
13+
from ._composite import CompositeGeometrySection, composite_geometry
1414

1515
__all__ = [
1616
'nanoribbon', 'graphene_nanoribbon', 'agnr', 'zgnr',
@@ -168,7 +168,7 @@ def zgnr(width, bond=1.42, atoms=None):
168168

169169
@set_module("sisl.geom")
170170
@dataclass
171-
class _heteroribbon_section(_geom_section):
171+
class _heteroribbon_section(CompositeGeometrySection):
172172
"""
173173
Parameters
174174
----------
@@ -619,7 +619,7 @@ def heteroribbon(sections, section_cls=_heteroribbon_section, **kwargs):
619619
"""
620620
return composite_geometry(sections, section_cls=section_cls, **kwargs)
621621

622-
heteroribbon.section=_heteroribbon_section
622+
heteroribbon.section = _heteroribbon_section
623623

624624

625625
@set_module("sisl.geom")
@@ -629,12 +629,12 @@ def graphene_heteroribbon(sections, section_cls=_heteroribbon_section, bond=1.42
629629
Please see `heteroribbon` for arguments, the only difference is that the `bond` and `atoms`
630630
arguments default to ``bond=1.42`` and ``Atoms(Z=6, R=bond*1.01)``, respectively.
631631
632-
See also
633-
----------
632+
See Also
633+
--------
634634
heteroribbon : for argument details and how it behaves
635635
"""
636636
if atoms is None:
637637
atoms = Atom(Z=6, R=bond * 1.01)
638638
return composite_geometry(sections, section_cls=section_cls, bond=bond, atoms=atoms, **kwargs)
639639

640-
graphene_heteroribbon.section=_heteroribbon_section
640+
graphene_heteroribbon.section = _heteroribbon_section

0 commit comments

Comments
 (0)