|
| 1 | +# coding: utf-8 |
| 2 | +"""Command-line interface module. |
| 3 | +
|
| 4 | +The subcommands are defined in dedicated modules. Note that all subcommands |
| 5 | +share a subset of options defined in the "common.py" module. The "main" |
| 6 | +function defined here is a group for attaching all the subcommands, and it |
| 7 | +establishes the program's entry point. |
| 8 | +
|
| 9 | +Author: Leonard Seydoux Date: June, 2021 Email: |
| 10 | +leonard.seydoux@univ-grenoble-alpes.fr |
| 11 | +""" |
| 12 | + |
| 13 | +import click |
| 14 | + |
| 15 | +from .inventory import inventory |
| 16 | +from .linkage import linkage |
| 17 | +from .features import features |
| 18 | +from .transform import transform |
| 19 | +from .waveforms import waveforms |
| 20 | + |
| 21 | + |
| 22 | +@click.group() |
| 23 | +def main(): |
| 24 | + """Deep scattering transform on segmented time series. |
| 25 | +
|
| 26 | + This program contains a series of command-line tools for clustering |
| 27 | + continuous time series with a deep scattering network. The following |
| 28 | + sub-commands must be run in a specific order from the continuous data to |
| 29 | + the cluster results. |
| 30 | +
|
| 31 | + 1. The inventorize command lists and selects the data based on usual meta |
| 32 | + parameters (sampling rate, duration, channels) and stores the relevant |
| 33 | + datapaths into an inventory file. This first command helps explore the data |
| 34 | + coverage in time, selecting appropriate time segments, and running the |
| 35 | + remaining steps on the actual data. |
| 36 | +
|
| 37 | + 2. The transform command runs the deep scattering transform on the |
| 38 | + segmented time series and stores the scattering coefficients for later |
| 39 | + feature extraction. |
| 40 | +
|
| 41 | + 3. With the features command, the large-dimensional scattering coefficients |
| 42 | + are reduced to a low-dimensional space which dimensions are considered |
| 43 | + features here. These features are used in the clustering step next. |
| 44 | +
|
| 45 | + 4. The command calculates the linkage matrix that helps cluster the data |
| 46 | + based on some criteria of similarity (a metric and a method). Once this |
| 47 | + matrix is calculated, the clusters are extracted for further analyses. |
| 48 | +
|
| 49 | + Created in May, 2021 by Leonard Seydoux |
| 50 | + (leonard.seydoux@univ-grenoble-alpes.fr) and Randall Balestriero. |
| 51 | +
|
| 52 | + """ |
| 53 | + pass |
| 54 | + |
| 55 | + |
| 56 | +# Add subcommands |
| 57 | +main.add_command(inventory) |
| 58 | +main.add_command(transform) |
| 59 | +main.add_command(features) |
| 60 | +main.add_command(linkage) |
| 61 | +main.add_command(waveforms) |
0 commit comments