nhp-prep


Namenhp-prep JSON
Version 0.3.2 PyPI version JSON
download
home_pagehttps://caoslab.psy.cmu.edu:32443/monkeylab/preprocessing-scripts
SummaryPre-processing data tool for NHP Lab @ CMU
upload_time2023-03-31 19:24:29
maintainer
docs_urlNone
authorHugo Angulo, Zijun Zhao
requires_python>=3.8
licenseMIT
keywords nhp-prep caoslab cmu pre-processing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # nhp-prep

This is a CLI Tool that has been created to pre-process historical data that has been collected
in multiple instances. This includes data collected at Seneca Zoo and Mellon Institute.

### Requirements

This package ***requires Python 3.***

### Installing

To install this CLI tool you can run the below command

```
pip3 install nhp-prep
```

### Updating

If you already have this tool installed, you can update it to the latest stable release by using the following command:

```
pip3 install -U nhp-prep
```

Alternatively, you clone this repo and then run this command from **_within_** the repository folder

```
python3 setup.py install
```

Another way to install this solution is by running the following command from **_within_** the repository folder:

```
pip install -e .
```

Both the above commands would install the package globally and `nhp-prep` will be available on your system.

### How to use

There are multiple instances in which you can use this tool.

```
nhp-prep COMMAND [OPTIONS]
```

There are four use-cases (commands) in which you can use this tool:

1. Mapping columns from prior to current format (`reorder-columns`)

```
nhp-prep reorder-columns -i <directory_with_files_to_reorder_columns_OR_unique_CSV_file> -o <output_directory> -r <file_with_reference_columns>
```

2. Rename the files to follow current standard (`rename`)

```
nhp-prep rename -i <directory_files_to_rename_OR_uniques_CSV_file> -o <output_directory>
```

The current format for the file is: `YYYY-MM-DD_HHmmh_<experiment_name>_<Subject_name>_<Researcher_name_or_initials>_data.csv`

3. Timestamp estimation trials from historical data files based on column <X> (`timestamp-estimate`)

```
nhp-prep --timestamp-estimate -i <input_file>
```

Alternatively, you can pass the directory of the files to estimate the timestamp of each trial:

```
nhp-prep timestamp-estimate -i <directory_with_files_OR_unique_CSV_file>
```

##### **Since v0.3.0**

Since the previous 3 steps are common across the different datasets collected, the dev team decided to merge them into one single command (`preparation-steps`):

```
nhp-prep preparation-steps -i <input_directory> -o <output_directory>
```

***The previous command will run sequentially the steps 1 to 3. The only command left outside of the bundle is the #4 since that is only applicable for the Baboons' data and requires the additional reference file.***

4. Renaming of Subject according to logs file (needs the file) (`sub-rename`)

```
nhp-prep sub-rename -r <file_with_columns_and_reference_subject_names> -i <directory_with_files_OR_unique_CSV_file> -o <output_directory>
```

You could also run `nhp-prep --help` to see the available commands and their corresponding usage.

If you want to know all the options available for an specific command, run the following:

```
nhp-prep COMMAND --help
```

Example:

```
nhp-prep sub-rename --help
```

### Feedback

Please feel free to leave feedback in issues/PRs.

            

Raw data

            {
    "_id": null,
    "home_page": "https://caoslab.psy.cmu.edu:32443/monkeylab/preprocessing-scripts",
    "name": "nhp-prep",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "nhp-prep,caoslab,cmu,pre-processing",
    "author": "Hugo Angulo, Zijun Zhao",
    "author_email": "hugoanda@andrew.cmu.edu, zijunzha@andrew.cmu.edu",
    "download_url": "https://files.pythonhosted.org/packages/97/a3/532fa0be0bb64633deb9493bc90e12e4c67bc24dabe273fe4bc45684294d/nhp-prep-0.3.2.tar.gz",
    "platform": null,
    "description": "# nhp-prep\n\nThis is a CLI Tool that has been created to pre-process historical data that has been collected\nin multiple instances. This includes data collected at Seneca Zoo and Mellon Institute.\n\n### Requirements\n\nThis package ***requires Python 3.***\n\n### Installing\n\nTo install this CLI tool you can run the below command\n\n```\npip3 install nhp-prep\n```\n\n### Updating\n\nIf you already have this tool installed, you can update it to the latest stable release by using the following command:\n\n```\npip3 install -U nhp-prep\n```\n\nAlternatively, you clone this repo and then run this command from **_within_** the repository folder\n\n```\npython3 setup.py install\n```\n\nAnother way to install this solution is by running the following command from **_within_** the repository folder:\n\n```\npip install -e .\n```\n\nBoth the above commands would install the package globally and `nhp-prep` will be available on your system.\n\n### How to use\n\nThere are multiple instances in which you can use this tool.\n\n```\nnhp-prep COMMAND [OPTIONS]\n```\n\nThere are four use-cases (commands) in which you can use this tool:\n\n1. Mapping columns from prior to current format (`reorder-columns`)\n\n```\nnhp-prep reorder-columns -i <directory_with_files_to_reorder_columns_OR_unique_CSV_file> -o <output_directory> -r <file_with_reference_columns>\n```\n\n2. Rename the files to follow current standard (`rename`)\n\n```\nnhp-prep rename -i <directory_files_to_rename_OR_uniques_CSV_file> -o <output_directory>\n```\n\nThe current format for the file is: `YYYY-MM-DD_HHmmh_<experiment_name>_<Subject_name>_<Researcher_name_or_initials>_data.csv`\n\n3. Timestamp estimation trials from historical data files based on column <X> (`timestamp-estimate`)\n\n```\nnhp-prep --timestamp-estimate -i <input_file>\n```\n\nAlternatively, you can pass the directory of the files to estimate the timestamp of each trial:\n\n```\nnhp-prep timestamp-estimate -i <directory_with_files_OR_unique_CSV_file>\n```\n\n##### **Since v0.3.0**\n\nSince the previous 3 steps are common across the different datasets collected, the dev team decided to merge them into one single command (`preparation-steps`):\n\n```\nnhp-prep preparation-steps -i <input_directory> -o <output_directory>\n```\n\n***The previous command will run sequentially the steps 1 to 3. The only command left outside of the bundle is the #4 since that is only applicable for the Baboons' data and requires the additional reference file.***\n\n4. Renaming of Subject according to logs file (needs the file) (`sub-rename`)\n\n```\nnhp-prep sub-rename -r <file_with_columns_and_reference_subject_names> -i <directory_with_files_OR_unique_CSV_file> -o <output_directory>\n```\n\nYou could also run `nhp-prep --help` to see the available commands and their corresponding usage.\n\nIf you want to know all the options available for an specific command, run the following:\n\n```\nnhp-prep COMMAND --help\n```\n\nExample:\n\n```\nnhp-prep sub-rename --help\n```\n\n### Feedback\n\nPlease feel free to leave feedback in issues/PRs.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Pre-processing data tool for NHP Lab @ CMU",
    "version": "0.3.2",
    "split_keywords": [
        "nhp-prep",
        "caoslab",
        "cmu",
        "pre-processing"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "25a3229b4025af0aeb17b3d002d9fb0a3da7561b5b0452f7e9b3ea63fe97c400",
                "md5": "15aba0964fffdbf63ee65ef53a48a652",
                "sha256": "8b98ea29cc13f9ca843f937c20058720a6813fff3ae3b04732b22d2fd1b7224f"
            },
            "downloads": -1,
            "filename": "nhp_prep-0.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "15aba0964fffdbf63ee65ef53a48a652",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 15804,
            "upload_time": "2023-03-31T19:24:19",
            "upload_time_iso_8601": "2023-03-31T19:24:19.072449Z",
            "url": "https://files.pythonhosted.org/packages/25/a3/229b4025af0aeb17b3d002d9fb0a3da7561b5b0452f7e9b3ea63fe97c400/nhp_prep-0.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "97a3532fa0be0bb64633deb9493bc90e12e4c67bc24dabe273fe4bc45684294d",
                "md5": "5285cc16db71f37114e7af5198df59c2",
                "sha256": "dc9b00faa5f3b671d36bc7fdbcd0771c7cb1ce124b801a6bc9e2cc1e73d51667"
            },
            "downloads": -1,
            "filename": "nhp-prep-0.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "5285cc16db71f37114e7af5198df59c2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 14214,
            "upload_time": "2023-03-31T19:24:29",
            "upload_time_iso_8601": "2023-03-31T19:24:29.425802Z",
            "url": "https://files.pythonhosted.org/packages/97/a3/532fa0be0bb64633deb9493bc90e12e4c67bc24dabe273fe4bc45684294d/nhp-prep-0.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-31 19:24:29",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "nhp-prep"
}
        
Elapsed time: 0.06104s