Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.
/ imajin Public archive

Tools to simulate optics and microscopy experiments.

Notifications You must be signed in to change notification settings

LEB-EPFL/imajin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Imajin

build

Tools to simulate optics and microscopy experiments.

Getting started

See the integration tests for examples.

Performance Tuning

The simulation's performance may be tuned by setting various environment variables:

  • IMAJIN_CACHE_SIZE_SM_RATES -- The size of the cache storing the state machine rate computations. The recommended value is equal to the number of fluorophores in the simulation.
  • IMAJIN_CACHE_SIZE_SM_STOPPED_STATES - The size of the cache holding the state machines' stopped states. The recommended value is equal to the number of distinct fluorophore types in the simulation. Usually this is just 1.

Installation

Choose one of the following methods. It is recommended to install into a virtual environment.

# With SSH:
pip install git+ssh://[email protected]/LEB-EPFL/imajin.git

# With a GitHub access token:
pip install git+https://"$GITHUB_TOKEN"@github.com/LEB-EPFL/imajin.git

See https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token for how to generate an access token. The token requires repo privileges.

Development

Setup the development environment

  1. Install pyenv: curl https://pyenv.run | bash
  2. Install Python interpreter(s): pyenv install 3.10.6
  3. Install poetry: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
  4. Set the virtual environment Python version to 3.10: poetry env use 3.10
  5. Activate the virtual environment: poetry shell
  6. Install the dependencies: poetry install

Testing

Run all tests and linters (except for benchmarks)

poetry run tox

Run specific tests and linters

# Black, isort, mypy, pylint
poetry run tox -e black
# etc. ...

# Python 3.X tests
poetry run tox -e py310

Run the benchmarks

poetry run tox -e benchmark

Format the code

poetry run tox -e format

Lock dependencies

poetry lock

Profiling

Profiling will tell you how long the code spends in each function call. A few benchmarks are already setup for profiling.

poetry run tox -e profile

To view the results of, for example, test_benchmark_simulator_0_result.json:

poetry run vizviewer test_benchmark_simulator_0_result.json

Troubleshooting

Poetry is using the wrong Python version

Check the version of Python used by Poetry to create the virtual environment:

poetry env info

Set the Python version to 3.10 (for example):

poetry env use 3.10

About

Tools to simulate optics and microscopy experiments.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages