flatironinstitute / CaImAn

Computational toolbox for large scale Calcium Imaging Analysis, including movie handling, motion correction, source extraction, spike deconvolution and result visualization.
https://caiman.readthedocs.io
GNU General Public License v2.0
639 stars 370 forks source link

add test workflow #1228

Closed bendichter closed 1 year ago

bendichter commented 1 year ago

Description

Add continuous integration. This is running and working here: https://github.com/bendichter/CaImAn/pull/2

Fixes # (issue)

Type of change

Please delete options that are not relevant.

Branching

Has your PR been tested?

If you're fixing a bug or introducing a new feature it is recommended you run the tests by typing

python caimanmanager.py test

and

python caimanmanager.py demotest

prior to submitting your pull request.

Please describe any additional tests that you ran to verify your changes. If they are fast you can also include them in the folder 'caiman/tests/and name themtest_***.py` so they can be included in our lists of tests.

EricThomson commented 1 year ago

This sounds great. This kind of resuscitation (we turned off CI a couple of years ago I think) is something on my internal roadmap that I've been putting off until next year, so I appreciate this work it's pushing me to learn more about actions etc. :rocket:

For the tests being run, would we also want to include demotest, or is that too heavy? What do you think @pgunn

Also before a merge we'd need to change master to main

pgunn commented 1 year ago

demotest is probably too involved (and adds troublesome dependencies), so let's skip that. Otherwise, this generally looks good; I'm going to need to really be sure this won't cut into any kind of limits we have before we accept (if it does, that's a showstopper), but I'll try to find that out soon.

bendichter commented 1 year ago

Let's commit this minimal CI and build upon it as needed. I also think we should test across platform and across supported Python versions, but I just wanted to get this in first so we have a place to build from.

pgunn commented 1 year ago

Looks like it's not just a forum that says that GA usage is free for public repos; it's documented as such here:

https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions

Given that, I have no reservations with use of GA for CI.

pgunn commented 1 year ago

If it's not too much effort, we should have this make an environment called "caiman" and activate it, rather than update the base environment except to install mamba into it (which is fragile; a caiman install could easily break the base environment). This would also lessen concerns of accidentally changing the python version in the base env or something like that.

bendichter commented 1 year ago

@pgunn I was having issue with that earlier but maybe I can get it to work now

pgunn commented 1 year ago

I don't see where, in the changed file, it specifies that it wants a conda version of python (or where it installs conda), and available documentation seems to suggest that that step installs python from pip.

How does this thing work?

bendichter commented 1 year ago

@pgunn here's a cleaner version with explicit conda installation and environment management

pgunn commented 1 year ago

Looks good; is this ready for merge?

bendichter commented 1 year ago

Yes, this is ready to merge.