Skip to content

Commit

Permalink
remove unnecessary return docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ikkoham committed Dec 7, 2021
1 parent fa03581 commit 8beeb63
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
from itertools import product
from math import pi
from typing import Dict, List, Optional, Tuple, Union

import numpy as np
from retworkx import PyGraph

from .lattice import LatticeDrawStyle, Lattice
from .boundary_condition import BoundaryCondition
from .lattice import Lattice, LatticeDrawStyle


class HyperCubicLattice(Lattice):
Expand Down Expand Up @@ -274,10 +275,6 @@ def draw_without_boundary(
Please see
https://qiskit.org/documentation/retworkx/stubs/retworkx.visualization.mpl_draw.html#retworkx.visualization.mpl_draw
for details.
Returns:
A matplotlib figure for the visualization if not running with an
interactive backend (like in jupyter) or if ``ax`` is not set.
"""
graph = self.graph

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def weighted_edge_list(self) -> WeightedEdgeList:

def copy(self) -> "Lattice":
"""Return a copy of the lattice."""
return Lattice(self.graph.copy())
return self.__class__(self.graph)

@classmethod
def from_nodes_and_edges(
Expand Down Expand Up @@ -200,13 +200,8 @@ def _mpl(graph: PyGraph, self_loop: bool, **kwargs):
self_loop : Draw self-loops, which are edges connecting a node to itself.
**kwargs : Kwargs for drawing the lattice.
Returns:
A matplotlib figure for the visualization if not running with an
interactive backend (like in jupyter) or if ``ax`` is not set.
Raises:
MissingOptionalLibraryError: Requires matplotlib.
"""
if not HAS_MATPLOTLIB:
raise MissingOptionalLibraryError(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# that they have been altered from the originals.

"""The line lattice"""
from .hyper_cubic_lattice import HyperCubicLattice
from .boundary_condition import BoundaryCondition
from .hyper_cubic_lattice import HyperCubicLattice


class LineLattice(HyperCubicLattice):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,6 @@ def draw_without_boundary(
Please see
https://qiskit.org/documentation/retworkx/stubs/retworkx.visualization.mpl_draw.html#retworkx.visualization.mpl_draw
for details.
Returns:
A matplotlib figure for the visualization if not running with an
interactive backend (like in jupyter) or if ``ax`` is not set.
"""
graph = self.graph

Expand Down

0 comments on commit 8beeb63

Please sign in to comment.