Skip to content

Commit

Permalink
remove __
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiosantoscode committed Feb 3, 2020
1 parent a7bad88 commit 11ad0a9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions dvc/command/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def _show(self, target, commands, outs, locked):
else:
logger.info(stage.path_in_repo)

def __build_graph(self, target, commands, outs):
def _build_graph(self, target, commands, outs):
import networkx
from dvc.stage import Stage
from dvc.repo.graph import get_pipeline
Expand Down Expand Up @@ -74,7 +74,7 @@ def __build_graph(self, target, commands, outs):
def _show_ascii(self, target, commands, outs):
from dvc.dagascii import draw

nodes, edges, _ = self.__build_graph(target, commands, outs)
nodes, edges, _ = self._build_graph(target, commands, outs)

if not nodes:
return
Expand All @@ -84,7 +84,7 @@ def _show_ascii(self, target, commands, outs):
def _show_dependencies_tree(self, target, commands, outs):
from treelib import Tree

nodes, edges, is_tree = self.__build_graph(target, commands, outs)
nodes, edges, is_tree = self._build_graph(target, commands, outs)
if not nodes:
return
if not is_tree:
Expand All @@ -105,12 +105,12 @@ def _show_dependencies_tree(self, target, commands, outs):
observe_list.pop(0)
tree.show()

def __write_dot(self, target, commands, outs):
def _write_dot(self, target, commands, outs):
import io
import networkx
from networkx.drawing.nx_pydot import write_dot

_, edges, _ = self.__build_graph(target, commands, outs)
_, edges, _ = self._build_graph(target, commands, outs)
edges = [edge[::-1] for edge in edges]

simple_g = networkx.DiGraph()
Expand All @@ -131,9 +131,7 @@ def run(self):
target, self.args.commands, self.args.outs
)
elif self.args.dot:
self.__write_dot(
target, self.args.commands, self.args.outs
)
self._write_dot(target, self.args.commands, self.args.outs)
elif self.args.tree:
self._show_dependencies_tree(
target, self.args.commands, self.args.outs
Expand Down
2 changes: 1 addition & 1 deletion tests/func/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def test_disconnected_stage(tmp_dir, dvc, caplog):
args = ["pipeline", "show", "--outs", "--dot", final_stage.path]
command = CmdPipelineShow(args)
# Need to test __build_graph directly
nodes, edges, is_tree = command._CmdPipelineShow__build_graph(
nodes, edges, is_tree = command._build_graph(
final_stage.path, commands=False, outs=True
)

Expand Down

0 comments on commit 11ad0a9

Please sign in to comment.