int-brain-lab / ONE

Open Neurophysiology Environment
MIT License
17 stars 5 forks source link

no_cache context manager #25

Closed k1o0 closed 3 years ago

k1o0 commented 3 years ago

no_cache function for temporarily deactivating the cache in a one-liner. This allows you to make a query without using the cache and without leaving the user's AlyxClient instance modified.

For example:

with no_cache(self.one.alyx):
            session_id, session = self.one.search(subject=details['subject'],
                                                  date_range=details['date'],
                                                  number=details['number'],
                                                  details=True, query_type='remote')