import dascore as dc
from dascore.utils.patch import get_patch_names
# Get a series of names from a patch or spool
patch = dc.get_example_patch()
spool = dc.get_example_spool()
patch_name = get_patch_names(patch)
spool_name = get_patch_names(patch)
# Use the Patch/Spool methods
spool_series = spool.get_patch_names()
patch_name = patch.get_patch_name() # a str w/ name.get_patch_names
Generates the default name of patch data.
Parameters
| Parameter | Description |
|---|---|
| patch_data | A container with patch data. |
| prefix | A string to prefix the names. |
| attrs | The Patch attrs to include in the name. |
| coords | The coordinate ranges to use in the names. |
| sep | The separator for each value. |
| strip_extension |
If True, remove extensions when getting name from a file path. See the notes section for more details. |
Note
There are two special cases where the default logic is overwritten. The first one, is when a column called “name” already exists. This will simply be returned.
The second is when a column called “path” exists. In this case, the output will be the file name with the extension removed (if strip_extension). The path must use ‘/’ as a delinater.