Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 11 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,16 @@ jobs:
python-version: [ '3.10' ]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
- name: Install uv and set Python version
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -e .[linters] --no-cache-dir
- name: Run interrogate
run: interrogate parallax tests
run: uv sync --extra linters
- name: Run Ruff Check
run: ruff check .
run: uv run ruff check .
- name: Run Ruff Format Check
run: ruff format --check .
run: uv run ruff format --check .
Comment thread
hannalee2 marked this conversation as resolved.

# Job 2: Build Documentation for PR to Main and Dev Branches
build-docs:
Expand All @@ -37,21 +34,18 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v3

# Step 2: Set up Python
- name: Set up Python
uses: actions/setup-python@v4
# Step 2: Install uv and set Python version
- name: Install uv and set Python version
uses: astral-sh/setup-uv@v5
with:
python-version: '3.10'

# Step 3: Install dependencies (including Sphinx)
# Step 3: Install Dependencies
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
run: uv sync --extra docs

Comment thread
hannalee2 marked this conversation as resolved.
# Step 4: Build the documentation
- name: Build Documentation
run: |
sphinx-build -b html docs/source docs/_build
run: uv run sphinx-build -b html docs/source docs/_build
# Fail the workflow if documentation build fails
continue-on-error: false
16 changes: 4 additions & 12 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,13 @@ jobs:
sudo apt-get update
sudo apt-get install -y libegl1 libxkbcommon-x11-0

- name: Set up Python
uses: actions/setup-python@v5
- name: Install uv and set Python version
uses: astral-sh/setup-uv@v5
with:
python-version: '3.10'

- name: Upgrade pip
run: python -m pip install --upgrade pip

- name: Install package + test deps
run: |
pip install -e ".[test]"
# optional: linters too
pip install -e ".[linters]"
run: uv sync --extra test --extra linters

- name: Run tests with coverage
run: |
pytest --cov=parallax --cov-report=term-missing
continue-on-error: true
run: uv run pytest --cov=parallax --cov-report=term-missing --cov-fail-under=30
34 changes: 11 additions & 23 deletions .github/workflows/tag_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
workflow_call:

jobs:
build-and-release:
Expand All @@ -14,16 +15,16 @@ jobs:
with:
fetch-depth: '0'

- name: Set up Python
uses: actions/setup-python@v2
- name: Install uv and set Python version
uses: astral-sh/setup-uv@v5
with:
python-version: '3.10'

- name: Extract version from the package
id: get_version
shell: bash
run: |
RELEASE_VERSION=$(python -c 'import parallax; print(parallax.__version__)')
RELEASE_VERSION=$(uv run python -c 'import parallax; print(parallax.__version__)')
Comment thread
hannalee2 marked this conversation as resolved.
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
echo "Extracted RELEASE_VERSION: $RELEASE_VERSION"

Expand All @@ -47,18 +48,8 @@ jobs:
draft: false
prerelease: true

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build

- name: Install project
run: pip install -e .

- name: Build package
run: |
python -m build
twine check dist/*
run: uv build

- name: Publish on PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand All @@ -74,21 +65,18 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v3

# Step 2: Set up Python
- name: Set up Python
uses: actions/setup-python@v4
# Step 2: Install uv and set Python version
- name: Install uv and set Python version
uses: astral-sh/setup-uv@v5
with:
python-version: '3.10'

# Step 3: Install dependencies (including Sphinx)
# Step 3: Install Dependencies
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
run: uv sync --extra docs

# Step 4: Build the documentation
- name: Build Documentation
run: |
sphinx-build -b html docs/source docs/_build
run: uv run sphinx-build -b html docs/source docs/_build
Comment thread
hannalee2 marked this conversation as resolved.
# Fail the workflow if documentation build fails
continue-on-error: false
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ debug
.coverage

# Environments
venv/
.venv/
75 changes: 46 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,40 @@ setting up and performing acute *in vivo* electrophysiology experiments.

**Documentation**: [parallax.readthedocs.io](https://parallax.readthedocs.io/en/latest/index.html).

### Prerequisites
- **Python==3.10** (Recommended to install via
[Anaconda](https://www.anaconda.com/products/individual) or
[Miniconda](https://docs.conda.io/en/latest/miniconda.html))
- Python 3.10 is required for the Spinnaker library.
- [Spinnaker SDK 4.2](https://www.teledynevisionsolutions.com/products/spinnaker-sdk)
## Prerequisites
- **Python 3.10**: Required for compatibility with the Spinnaker library.
- [Spinnaker SDK 4.2](https://www.teledynevisionsolutions.com/products/spinnaker-sdk) and Teledyne FLIR software for camera support.
- We recommend using [`uv`](https://docs.astral.sh/uv/) for environment management.


### Installation
1. Create a virtual environment with **Python 3.10** and activate it:
2. Install Parallax:
## Installation
#### 1. Install Parallax
Option A, Install from PyPI:
```bash
pip install parallax-app
uv venv --python 3.10
# On macOS/Linux: source .venv/bin/activate
# On Windows: .venv\Scripts\activate
uv pip install parallax-app
```

To upgrade to the latest version, run:
Option B, Install via local repository (Recommended):
```bash
pip install parallax-app --upgrade
git clone https://github.com/AllenNeuralDynamics/parallax.git
cd parallax
uv sync
```

3. Install the camera interface [Spinnaker SDK 4.2](https://www.teledynevisionsolutions.com/products/spinnaker-sdk)
#### 2. Install Spinnaker
Install the camera interface [Spinnaker SDK 4.2](https://www.teledynevisionsolutions.com/products/spinnaker-sdk)
```bash
# Install from the **wheel file** that comes with the Spinnaker SDK ver.4.2.
# Replace **<WHEEL_PATH>** with the *full path* to your `.whl`:
pip install "<WHEEL_PATH>"
uv pip install "<WHEEL_PATH>"
# Example) uv pip install spinnaker_python-4.2.0.88-cp310-cp310-win_amd64.whl
```

### Running Parallax
## Running Parallax
```bash
python -m parallax
uv run parallax
```

### Optional: Enable SuperPoint + SuperGlue Reticle Detection
Expand All @@ -47,16 +51,21 @@ The SuperGluePretrainedNetwork is not included in this repository and is distrib
Please review their [license](https://github.com/magicleap/SuperGluePretrainedNetwork) before use.

Manual Setup Instructions
1. Clone the repository if it hasn't been done already.
Clone the repository if it hasn't been done already.
```bash
git clone https://github.com/AllenNeuralDynamics/parallax.git
cd parallax
```
1. Install the required `sfm` dependency from GitHub:
```bash
uv pip install git+https://github.com/AllenNeuralDynamics/sfm.git@main
```

2. Clone the repository into the external/ folder in your Parallax project root:
```bash
pip install git+https://github.com/AllenNeuralDynamics/sfm.git@main
git clone https://github.com/magicleap/SuperGluePretrainedNetwork.git external/SuperGluePretrainedNetwork
Comment thread
hannalee2 marked this conversation as resolved.
```

3. Verify your folder structure looks like this:
```bash
parallax/
Expand All @@ -70,28 +79,36 @@ parallax/
```

### For developers:
1. Clone the repository:
The following are tools used to ensure code quality in this project.
- Install dependencies:
```bash
git clone https://github.com/AllenNeuralDynamics/parallax.git
uv sync --all-extras
```
2. Install the package along with dev dependencies:

- Unit Testing
```bash
pip install -e .[dev]
uv run pytest tests
```

### Documentation
1. To install the dependencies:
- Linting
```bash
uv run ruff check
```

- Type Check
```bash
pip install -e .[docs]
uv run mypy parallax
```
2. Then to create the documentation html files, run:

### Documentation
Create the documentation html files, run:
```bash
sphinx-build -b html docs/ docs/_build
uv run sphinx-build -b html docs/source docs/_build
```

### Support and Contribution
If you encounter any problems or would like to contribute to the project,
please submit an [Issue](https://github.com/AllenNeuralDynamics/parallax/issues)
please submit an [Issue](https://github.com/AllenNeuralDynamics/parallax/issues)
on GitHub.

### License
Expand Down
2 changes: 1 addition & 1 deletion parallax/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import os

__version__ = "1.16.1"
__version__ = "1.17.0"

# allow multiple OpenMP instances
os.environ["KMP_DUPLICATE_LIB_OK"] = "True"
10 changes: 7 additions & 3 deletions parallax/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
from parallax.model import Model
from parallax.session.session_manager import SessionManager

# Main function to run the Parallax application
if __name__ == "__main__":

def main():
# Print the ASCII art
print(f"Parallax version {__version__}")
print(PARALLAX_ASCII)
Expand Down Expand Up @@ -47,7 +47,11 @@
app.exec()

# Clean up on exit
atexit.register(main_window.update_config_from_ui)
atexit.register(model.save_config)
atexit.register(model.save_session)
atexit.register(model.clean)


# Execute when run directly as a module
if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions parallax/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ def closeEvent(self, event):
Args:
event (QCloseEvent): The close event triggered when the widget is closed.
"""
self.update_config_from_ui()
Comment thread
hannalee2 marked this conversation as resolved.
self.model.close_clac_instance()
self.model.close_reticle_metadata_instance()
self.model.close_stage_ipconfig_instance()
Expand Down
Loading
Loading