simple_dvc.demo module

simple_dvc.demo.init_randomized_dvc_repo(demo_root, with_git=False, reset=False)[source]
Builds a medium complexity dvc repo, todo:

implement some tests

simple_dvc.demo.random_nested_paths(num=30, rng=None)[source]

Use networkx to make a random complex directory structure.

Parameters:
  • num (int) – number of nodes in the random file system

  • rng (None | int) – random state / seed

Returns:

A list of “paths”, which are represented as list of “names”.

Return type:

List[List[int]]

CommandLine

xdoctest -m simple_dvc.demo random_nested_paths

Example

>>> from simple_dvc.demo import *  # NOQA
>>> import ubelt as ub
>>> node_paths = random_nested_paths(num=10, rng=123)
>>> print(f'node_paths = {ub.urepr(node_paths, nl=1)}')
node_paths = [
    [2, 7, 0, 1],
    [2, 7, 0, 6, 8, 3],
    [2, 4],
    [2, 5],
    [2, 7, 0, 6, 8, 9],
]
simple_dvc.demo.simple_demo_repo(dvc_root)[source]

Build a simple repo using only standard dvc commands for upstream MWEs

simple_dvc.demo.mwe()[source]