Package: aind-ephys-utils
aind-ephys-utilsHelpful methods for exploringin vivoelectrophysiology data.InstallationFor userspipinstallaind-ephys-utilsFor developersFirst, clone the repository. Then, from theaind-ephys-utilsdirectory, run:pipinstall-e.[dev]Note:On recent versions of macOS, you'll need to put the last argument in quotation marks:".[dev]"ContributingLinters and testingThere are several libraries used to run linters, check documentation, and run tests.Please test your changes using thecoveragelibrary, which will run the tests and log a coverage report:coveragerun-munittestdiscover&&coveragereportUseinterrogateto check that modules, methods, etc. have been documented thoroughly:interrogate.Useblackto automatically format the code into PEP standards:black.Useflake8to check that code is up to standards (no unused imports, etc.):flake8.Useisortto automatically sort import statements:isort.Pull requestsFor internal members, please create a branch. For external members, please fork the repository and open a pull request from the fork. We'll primarily useAngularstyle for commit messages. Roughly, they should follow the pattern:<type>(<scope>): <short summary>where scope (optional) describes the packages affected by the code changes and type (mandatory) is one of:build: Changes that affect build tools or external dependencies (example scopes: pyproject.toml, setup.py)ci: Changes to our CI configuration files and scripts (examples: .github/workflows/ci.yml)docs: Documentation only changesfeat: A new featurefix: A bugfixperf: A code change that improves performancerefactor: A code change that neither fixes a bug nor adds a featuretest: Adding missing tests or correcting existing testsDocumentationTo generate the rst files source files for documentation, runsphinx-apidoc-odoc_template/source/src/aind_ephys_utilsThen to create the documentation HTML files, runsphinx-build-bhtmldoc_template/source/doc_template/build/htmlMore info on sphinx installation can be foundhere.Developing in Code OceanMembers of the Allen Institute for Neural Dynamics can follow these steps to create a Code Ocean capsule from this repository:Click the⨁ New Capsulebutton and select "Clone from AllenNeuralDynamics"Type inaind-ephys-utilsand click "Clone" (this step requires that your GitHub credentials are configured properly)Select a Python base image, and optionally change the compute resourcesAttach data to the capsule and any dependencies needed to load it (e.g.pynwb,hdmf-zarr)Add plotting dependencies (e.g.ipympl,plotly)Launch a Visual Studio Code cloud workstationInside Visual Studio Code, select "New Terminal" from the "Terminal" menu and run the following commands:$pipinstall-e.[dev]$gitcheckout-b<nameoffeaturebranch>Now, you can create Jupyter notebooks in the "code" directory that can be used to test out new functions before updating the library. When prompted, install the "Python" extensions to be able to execute notebook cells.Once you've finished writing your code and tests, run the following commands:$coveragerun-munittestdiscover&&coveragereport
$interrogate.$black.
$flake8.
$isort.Assuming all of these pass, you're ready to push your changes:$gitadd<filestoadd>
$gitcommit-m"Commit message"$gitpush-uorigin<nameoffeaturebranch>After doing this, you can open a pull request on GitHub.Note thatgitwill only track files inside theaind-ephys-utilsdirectory, and will ignore everything else in the capsule. You will no longer be able to commit changes to the capsule itself, which is why this workflow should only be used for developing a library, and not for performing any type of data analysis.When you're done working, it's recommended to put the workstation on hold rather than shutting it down, in order to keep Visual Studio Code in the same state.