Skip to content

The standard cookiecutter template for all lab-specific NWB conversions.

License

Notifications You must be signed in to change notification settings

catalystneuro/cookiecutter-my-lab-to-nwb-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cookiecutter template for CatalystNeuro projects

This repo serves as a generic template generator for all conversion projects undertaken by the CatalystNeuro team. The project is based and shares the structure of our generic template and extends it further by means of cookiecutter to auto-generate the rest of the configuration.

How to use it

1) Install cookiecutter:

Install the latest cookiecutter version if you haven't installed it yet:

pip install -U cookiecutter

2) Run cookiecutter with this repo and answer some prompts

Then, use the following cookiecutter command to generate a CatalystNeuro conversion project structure:

cookiecutter https://github.com/catalystneuro/cookiecutter-my-lab-to-nwb-template

This will ask some questions that determine the project structure as in the following example:

lab [Lab Name]: Eric Kandel
repo_name [eric-kandel-lab-to-nwb]:
conversion_name [embargo2002a]: brenda_milner_2022

Where the lab usually corresponds to the principal investigator name, repo_name is the name of the github repositry and conversion_name is the name of the specific conversion to be carried out.

Leave the prompt unanswered (blank) to accept the default suggestion in square brackets (e.g. repo name will be assigned the value of eric-kandel-lab-to-nwb as the space is left blank). We suggest to use the name of the author plus the year for the conversion name (as it is done for conversion_name agove.)

For conversions concerning data under embargo we suggest a name following the pattern described in the brackets (i.e. embargo22a). The general form is embargo{year}{letter} where year is the year of the conversion and letter can be a, b, c, etc. in case there is more than one conversion that year.

3) Copy the generated content to a repo as you need it

After the questions in the prompt are answered as above, cookiecutter generates a directory with the following structure:

eric-kandel-lab-to-nwb/
├── LICENSE
├── make_env.yml
├── pyproject.toml
├── README.md
├── requirements.txt
├── setup.py
└── src
    ├── eric_kandel_lab_to_nwb
    │   └── brenda_milner_2022
    │       ├── brenda_milner_2022behaviorinterface.py
    │       ├── brenda_milner_2022_convert_session.py
    │       ├── brenda_milner_2022_metadata.yml
    │       ├── brenda_milner_2022nwbconverter.py
    │       ├── brenda_milner_2022_requirements.txt
    │       └── __init__.py
    └── __init__.py

You can then modify this to suit the particular needs of the ongoing conversion.

The last step is to create an empty repo with the same name as the generated directory from our team github account and just fill the contents with the ones in the directory generated by cookiecuter.

4) Configure the repo

Pre-commit

For new repos, an extra step of allowing the black auto-commit CI bot may have to be enabled at: https://results.pre-commit.ci/

To enable the pre-commit hook locally use the two following steps:

pip install pre-commit
pre-commit install

The .pre-commit-config.yaml is already included in the repository.

About

The standard cookiecutter template for all lab-specific NWB conversions.

Resources

License

Stars

Watchers

Forks

Languages