Skip to main content

Python API for NeuronBridge

Project description

NeuronBridge Python API

DOI

A Python API for the NeuronBridge neuron similarity search service.

Data Model Diagram

Installation

This library is available on PyPI, so you can install it like this:

pip install neuronbridge-python

Usage

The client will automatically select the latest version of the data and fetch it from S3. Here's a simple example of how to get an EM image by id:

from neuronbridge import client
client = client.Client()
em_image = client.get_em_image(636798093) 

See this notebook for complete usage examples.

Development Notes

To build this code you will need to install UV.

Create a new UV virtual environment and install the dependencies:

uv venv --python 3.11
source .venv/bin/activate
uv pip sync requirements-universal.txt
uv pip install -e .

Running data validation using Ray

You can run validation multithreaded on a single machine like this:

./neuronbridge/validate_ray.py --dashboard --cores 60

To run the validation script in a distributed manner on the Janelia cluster, you must first install ray-janelia in a sister directory to where this code base is cloned. Then run a script to bsub the Ray cluster:

./scripts/launch_validation.sh

Updating requirements

After updating the requirements.txt file, you can sync the requirements-universal.txt file like this:

uv pip compile requirements.txt --universal --output-file  requirements-universal.txt

Regenerate the JSON schemas:

python neuronbridge/generate_schemas.py

Run the unit tests:

pixi run test

Publishing a new release

  1. Update the version in setup.py
  2. Push all changes and tag a release in GitHub
  3. Build PyPI distribution:
pixi run pypi-build
  1. Upload to PyPI:
pixi run pypi-upload

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neuronbridge_python-3.3.0.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neuronbridge_python-3.3.0-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file neuronbridge_python-3.3.0.tar.gz.

File metadata

  • Download URL: neuronbridge_python-3.3.0.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for neuronbridge_python-3.3.0.tar.gz
Algorithm Hash digest
SHA256 97a1ccb32a5e29cdb64234694d6a311510630341e45a19d002fa48266624f892
MD5 4e9b0d5b8fb65fdee9728f7c8cbd6d86
BLAKE2b-256 58614d2025ef7d4f9c0c41900e6008a904df67af53fc1036c773af710a933354

See more details on using hashes here.

File details

Details for the file neuronbridge_python-3.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for neuronbridge_python-3.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eecca87809c1c744078d2b388dda40491cf1957651fbe513e0d6d7fe4bca38b1
MD5 d8a9b6b25003d481a764856d62ecdd3f
BLAKE2b-256 2532688cdba3d5176b50c6c365951f442bd04e68bf43904fcf91120dd942636a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page