Skip to content
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.

Commit

Permalink
conditional import of caiman
Browse files Browse the repository at this point in the history
  • Loading branch information
kushalkolar committed Sep 16, 2021
1 parent 47d1c53 commit 2e77eab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mesmerize/analysis/batch_manager_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@

import pandas as pd
import pathlib
import caiman as cm
from ..common import configuration
from typing import *
from uuid import UUID
import pickle
if configuration.HAS_CAIMAN:
import caiman as cm

CURRENT_BATCH: pathlib.Path = None # only one batch at a time for now

Expand All @@ -34,6 +36,9 @@ class CaimanExtensions:
Extensions for caiman related functions
"""
def __init__(self, series: pd.Series):
if not configuration.HAS_CAIMAN:
raise ImportError("Caiman not found in the environment")

self._series = series

def get_params(self) -> dict:
Expand Down

0 comments on commit 2e77eab

Please sign in to comment.