Skip to content

Commit b16c90b

Browse files
committed
have one function for copying examples
1 parent a1ee907 commit b16c90b

File tree

1 file changed

+3
-40
lines changed

1 file changed

+3
-40
lines changed

src/diffpy/cmi/cli.py

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,18 @@ def map_pack_to_examples() -> dict[str, List[str]]:
7373

7474

7575
def copy_examples(
76-
examples: str | List[str],
76+
examples: List[str],
7777
target_dir: Optional[Path] = None,
7878
) -> List[Path]:
7979
"""Copy one or more examples to a target directory.
8080
8181
Parameters
8282
----------
83-
examples : str or list of str
84-
Example name(s): 'example1' or ['example1', 'example2']
83+
examples : list of str
84+
Example name(s): ['example1'], ['pack1']
8585
target_dir : Path, optional
8686
Target directory where examples should be copied.
8787
Defaults to current working directory if not specified.
88-
overwrite : bool, default False
89-
If True, overwrite existing directories. If False, raise
90-
FileExistsError when destination exists.
9188
9289
Returns
9390
-------
@@ -106,40 +103,6 @@ def copy_examples(
106103
return
107104

108105

109-
def copy_packs(
110-
packs: str | List[str],
111-
target_dir: Optional[Path] = None,
112-
) -> List[Path]:
113-
"""Copy all examples from one or more packs to a target directory.
114-
115-
Parameters
116-
----------
117-
packs : str or list of str
118-
Pack name(s). Can be:
119-
- Single pack name: 'pack1'
120-
- List of pack names: ['pack1', 'pack2']
121-
- Special keyword: 'all' (copies all packs)
122-
target_dir : Path, optional
123-
Target directory where examples should be copied.
124-
Defaults to current working directory if not specified.
125-
126-
Returns
127-
-------
128-
list of Path
129-
List of destination paths created (all examples from the pack(s)).
130-
131-
Raises
132-
------
133-
ValueError
134-
If pack name is invalid.
135-
FileNotFoundError
136-
If pack does not exist.
137-
FileExistsError
138-
If any destination exists.
139-
"""
140-
return
141-
142-
143106
def copy_example(pack_example: str) -> Path:
144107
"""Copy an example into the current working directory.
145108

0 commit comments

Comments
 (0)