Skip to content

Commit 614335a

Browse files
authored
Merge pull request #56 from cadenmyers13/copy-func
feat: Copy function and test
2 parents c6f5fbf + a0eea6d commit 614335a

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

news/copy-func.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* Add functionality for copying examples.
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* <news item>
20+
21+
**Security:**
22+
23+
* <news item>

src/diffpy/cmi/cli.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import argparse
1717
from pathlib import Path
1818
from shutil import copytree
19-
from typing import List, Optional, Tuple
19+
from typing import Dict, List, Optional, Tuple
2020

2121
from diffpy.cmi import __version__, get_package_dir
2222
from diffpy.cmi.conda import env_info
@@ -25,6 +25,22 @@
2525
from diffpy.cmi.profilesmanager import ProfilesManager
2626

2727

28+
def copy_examples(
29+
examples_dict: Dict[str, List[Tuple[str, Path]]], target_dir: Path = None
30+
) -> None:
31+
"""Copy an example into the the target or current working directory.
32+
33+
Parameters
34+
----------
35+
examples_dict : dict
36+
Dictionary mapping pack name -> list of (example, path) tuples.
37+
target_dir : pathlib.Path, optional
38+
Target directory to copy examples into. Defaults to current
39+
working directory.
40+
"""
41+
return
42+
43+
2844
# Examples
2945
def _get_examples_dir() -> Path:
3046
"""Return the absolute path to the installed examples directory.

0 commit comments

Comments
 (0)