Comments (3)
From @k1o0
def query_criterion(subject, status, from_status=None, one=None):
"""
Parameters
----------
subject : str
The subject name.
status : str
The training status to query for.
from_status : str, optional
Count number of sessions and days from reaching `from_status` to `status`.
one : one.api.OneAlyx, optional
An instance of ONE.
Returns
-------
str
The eID of the first session where this training status was reached.
int
The number of sessions it took to reach `status` (optionally from reaching `from_status`).
int
The number of days it tool to reach `status` (optionally from reaching `from_status`).
"""
one = one or ONE()
subject_json = one.alyx.rest('subjects', 'read', id=subject)['json']
if not (criteria := subject_json.get('criteria')) or status not in criteria:
return None, None, None
to_date = criteria[status]
from_date = criteria.get(from_status)
eids, det = one.search(subject=subject, date_range=[from_date, to_date], details=True)
date_range = list(map(datetime.date.fromisoformat, (det[0], det[-1])))
return eids[-1], len(eids), (date_range[1] - date_range[0]).days
from ibllib.
- compute from trial table (although it needs input from the task parameters)
- update the extraction task to update JSON field
- (create the queries if non-obvious)
from ibllib.
Documentation ; query
from ibllib.
Related Issues (20)
- Updates to the way revisions and default datasets are created HOT 1
- Fix NP2 waveforms
- Dataset level QC
- Make patcher work with revisions HOT 1
- Update required ibl-neuropixel version HOT 1
- Look into how many spikesorting have old clusters metrics and make revisions HOT 2
- Read in channel map from datasets for histology trajectory
- Fix assert_expected and EphysPostDLC task to find data in revisions HOT 2
- SessionLoader doesn't work with dynamic pipeline collections
- library does not work with `scipy==0.13.0` HOT 1
- Mesoscope bad frames QC datasets incorrect
- improve phy usability
- Dynamic pipeline / iblrigv8 ephys sessions can't extract trials due to pre-generated events probabilities HOT 1
- Allow namespace filter in SpikeSortingLoader
- Script to extract new datasets from manual curated data in phy
- The QC Viewer can't be run on NP2.4
- Retire old pipeline
- Add support for multi depth FOV sessions HOT 1
- Inconsistent task names make queries obtuse HOT 1
- Improve recording of datasets for release HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ibllib.