diff --git a/CHANGELOG.md b/CHANGELOG.md index 651ae41cb..bab327679 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ we hit release version 1.0.0. - fixed hpc parameters #403 ### Changed +- order of arguments for `nanoribbon` it was not consistent with the others - removed cell argument in `Geometry.sub` - removed `Sile.exist`, refer to `Sile.file` which always will be a `pathlib.Path` instance - `berry_phase` now uses the gauge=R convention, the code became much simpler diff --git a/sisl/geom/nanoribbon.py b/sisl/geom/nanoribbon.py index 6e8f1d861..d09eab809 100644 --- a/sisl/geom/nanoribbon.py +++ b/sisl/geom/nanoribbon.py @@ -11,19 +11,19 @@ @set_module("sisl.geom") -def nanoribbon(bond, atoms, width, kind='armchair'): +def nanoribbon(width, bond, atoms, kind='armchair'): r""" Construction of a nanoribbon unit cell of type armchair or zigzag. The geometry is oriented along the :math:`x` axis. Parameters ---------- + width : int + number of atoms in the transverse direction bond : float bond length between atoms in the honeycomb lattice atoms : Atom atom (or atoms) in the honeycomb lattice - width : int - number of atoms in the transverse direction kind : {'armchair', 'zigzag'} type of ribbon @@ -105,7 +105,7 @@ def graphene_nanoribbon(width, bond=1.42, atoms=None, kind='armchair'): """ if atoms is None: atoms = Atom(Z=6, R=bond * 1.01) - return nanoribbon(bond, atoms, width, kind=kind) + return nanoribbon(width, bond, atoms, kind=kind) @set_module("sisl.geom") diff --git a/sisl/geom/tests/test_geom.py b/sisl/geom/tests/test_geom.py index e7fb2910a..4442e48cf 100644 --- a/sisl/geom/tests/test_geom.py +++ b/sisl/geom/tests/test_geom.py @@ -64,16 +64,16 @@ def test_bilayer(): def test_nanoribbon(): for w in range(0, 5): - a = nanoribbon(1.42, Atom(6), w, kind='armchair') - a = nanoribbon(1.42, Atom(6), w, kind='zigzag') - a = nanoribbon(1.42, (Atom(5), Atom(7)), w, kind='armchair') - a = nanoribbon(1.42, (Atom(5), Atom(7)), w, kind='zigzag') + a = nanoribbon(w, 1.42, Atom(6), kind='armchair') + a = nanoribbon(w, 1.42, Atom(6), kind='zigzag') + a = nanoribbon(w, 1.42, (Atom(5), Atom(7)), kind='armchair') + a = nanoribbon(w, 1.42, (Atom(5), Atom(7)), kind='zigzag') with pytest.raises(ValueError): - nanoribbon(1.42, (Atom(5), Atom(7)), 6, kind='undefined') + nanoribbon(6, 1.42, (Atom(5), Atom(7)), kind='undefined') with pytest.raises(ValueError): - nanoribbon(1.42, (Atom(5), Atom(7)), 'str', kind='undefined') + nanoribbon('str', 1.42, (Atom(5), Atom(7)), kind='undefined') def test_graphene_nanoribbon():