From 120af0acc5bb7832dc8e4a5b1658eb43d1e49222 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Fri, 10 Oct 2025 16:41:02 -0400 Subject: [PATCH 1/2] api for copy ex function --- src/diffpy/cmi/cli.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/diffpy/cmi/cli.py b/src/diffpy/cmi/cli.py index f25cb78..dbd663c 100644 --- a/src/diffpy/cmi/cli.py +++ b/src/diffpy/cmi/cli.py @@ -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 @@ -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. From a0eea6d3cf0b336e6b4fc96469ec8c95b778fe1c Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Fri, 10 Oct 2025 16:41:42 -0400 Subject: [PATCH 2/2] news --- news/copy-func.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/copy-func.rst diff --git a/news/copy-func.rst b/news/copy-func.rst new file mode 100644 index 0000000..d5d23f4 --- /dev/null +++ b/news/copy-func.rst @@ -0,0 +1,23 @@ +**Added:** + +* Add functionality for copying examples. + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +*