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

__pycache__ in caiman_data? #1340

Closed pgunn closed 6 months ago

pgunn commented 6 months ago

This is to track a concern I've seen with build-it-yourself caiman installs that these directories all get a pycache subdirectory:

It's probably harmless, and I'm not sure if we need to care, although I'd like to have it not there for conda builds at least.

If we wanted to change it, we're looking at changing caimanmanager.do_install_to() we could probably modify shutil.copytree to use the ignore=ignore_patterns(...) argument, and replace the distutils call with intelligent use of dirs_exist_ok in copytree (which maybe we should do anyhow).

pgunn commented 6 months ago

I think this must be something with newer versions of the package build libraries (pip? distutils? setuputils?); I know it didn't happen before with compiled versions of caiman.

I wonder if having setup.py do an

os.environ['PYTHONDONTWRITEBYTECODE'] = 1

early on would prevent this.

pgunn commented 6 months ago

pip explicitly builds those, so the env var route is no good. Going the caimanmanager route described above

pgunn commented 6 months ago

Fixed in dev