Skip to content

Commit

Permalink
additional mamba subprocess call removals
Browse files Browse the repository at this point in the history
  • Loading branch information
Michele Fabbri committed Aug 24, 2022
1 parent aeffc3f commit 6617b80
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 42 deletions.
50 changes: 19 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,18 @@ Please review these conventions to more easily contribute to the project.
---
## Installation of this software suite on Windows
### Prerequisite Software:
In order to install iblrig on a Windows machine please ensure that the following prerequisite is first installed:
- [Git](https://git-scm.com)
In order to install iblrig on a Windows machine please ensure that the following prerequisite software is first installed:
- [Anaconda](https://anaconda.com)

### Instructions for automated installation from scratch:
- Ensure Git, Anaconda, and your favorite text editor are already installed
- Please also ensure a stable internet connection is present as the installer pulls from various servers throughout the installation process
- Clone the latest version of this repository to the root of the `C:\` drive
- Open your Anaconda Prompt and navigate `C:\iblrig`
- At the prompt, run: `python .\install.py`
- The installer will take over for a while and ensure the rest of the requisite software is present
- The installer will prompt you to install ONE (yes/no)
- If you decide to install ONE, various prompts will assist you in the default configuration
- The installer will prompt you to install Bonsai (yes/no)
- Installation complete

### Running pybpod
- Navigate your Anaconda Prompt to the iblrig folder: `cd C:\iblrig`
- Ensure the `iblrig` anaconda environment is activated: `conda activate iblrig`
- At the prompt, run: `.\pybpod.bat`

### Instructions for manual installation from scratch:
The following commands to be run from the Windows command prompt (not tested in powershell). Please ensure that your git and
anaconda environment are up-to-date.
```commandline
cd C:\
### Instructions for installation from scratch:
The following commands should be run in the Anaconda Powershell Prompt:
```powershell
conda create --name iblrig python==3.7.13 --yes
conda activate iblrig
conda install git --yes
cd \
git clone https://github.com/int-brain-lab/iblrig
cd C:\iblrig
conda create --name iblrig python=3.7.13 --yes
conda activate iblrig
pip install --editable .
mkdir C:\iblrig_params
python setup_pybpod.py C:\iblrig_params
Expand All @@ -71,12 +53,18 @@ conda activate iblrig
pybpod.bat
```

### Instructions for manual update from 6.6.2 to 6.6.3:
The following commands to be run from the Windows command prompt (not tested in powershell). Please ensure that your git and
anaconda environment are up-to-date. **Backup any custom tasks or modifications before performing the following**
```commandline
### Instructions for manual update from 6.6.x to 6.6.4:
The following commands to be run from the Anaconda Powershell Prompt. Please ensure that your git and
anaconda environment are up-to-date. **Backup any custom tasks or modifications before performing the following**
```powershell
conda activate iblrig
cd C:\iblrig
git reset —-hard
git fetch
git pull
```
```

### Running pybpod
- Navigate your Anaconda Prompt to the iblrig folder: `cd C:\iblrig`
- Ensure the `iblrig` anaconda environment is activated: `conda activate iblrig`
- At the prompt, run: `.\pybpod.bat`
2 changes: 1 addition & 1 deletion iblrig/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "6.6.3"
__version__ = "6.6.4"
import logging

import colorlog
Expand Down
13 changes: 3 additions & 10 deletions iblrig/envs.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @File: iblrig/envs.py
# @Author: Niccolo' Bonacchi (@nbonacchi)
# @Date: Tuesday, September 28th 2021, 11:51:11 am
import json
import os
import re
import subprocess
import sys
from pathlib import Path

MC = "mamba"


def get_env_folder(env_name: str = "iblrig") -> str:
"""get_env_folder Return conda folder of [env_name] environment
Expand All @@ -22,14 +15,14 @@ def get_env_folder(env_name: str = "iblrig") -> str:
:rtype: str
"""
try:
all_envs = subprocess.check_output([f"{MC}", "env", "list", "--json"])
all_envs = subprocess.check_output(["conda", "env", "list", "--json"])
all_envs = json.loads(all_envs.decode("utf-8"))
except BaseException:
try:
all_envs = subprocess.check_output([f"{MC}", "env", "list", "--json"], shell=True)
all_envs = subprocess.check_output(["conda", "env", "list", "--json"], shell=True)
all_envs = json.loads(all_envs.decode("utf-8"))
except BaseException:
raise ValueError(f"Could not run subprocess {MC} list environments")
raise ValueError("Could not run subprocess conda list environments")
pat = re.compile(f"^.+{env_name}$")
env = [x for x in all_envs["envs"] if pat.match(x)]
env = env[0] if env else None
Expand Down
4 changes: 4 additions & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# **Release notes**

## **Release Notes 6.6.4**

- additional mamba subprocess call removals

## **Release Notes 6.6.3**

- additional f2ttl error catching and messaging
Expand Down

0 comments on commit 6617b80

Please sign in to comment.