Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions news/copy-func.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* Add functionality for copying examples.

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
18 changes: 17 additions & 1 deletion src/diffpy/cmi/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import argparse
from pathlib import Path
from shutil import copytree
from typing import List, Optional, Tuple
from typing import Dict, List, Optional, Tuple

from diffpy.cmi import __version__, get_package_dir
from diffpy.cmi.conda import env_info
Expand All @@ -25,6 +25,22 @@
from diffpy.cmi.profilesmanager import ProfilesManager


def copy_examples(
examples_dict: Dict[str, List[Tuple[str, Path]]], target_dir: Path = None
) -> None:
"""Copy an example into the the target or current working directory.

Parameters
----------
examples_dict : dict
Dictionary mapping pack name -> list of (example, path) tuples.
target_dir : pathlib.Path, optional
Target directory to copy examples into. Defaults to current
working directory.
"""
return


# Examples
def _get_examples_dir() -> Path:
"""Return the absolute path to the installed examples directory.
Expand Down
Loading