ndx-pinto-metadata
The NWB extension for storing ViRMEN experimental metadata for the Pinto lab.
Installation
pip install ndx_pinto_metadata
Usage
from uuid import uuid4
from datetime import datetime
from dateutil.tz import tzlocal
import numpy as np
from pynwb import NWBFile, NWBHDF5IO
from hdmf.common.table import DynamicTable
from ndx_pinto_metadata import LabMetaDataExtension, MazeExtension
# Create NWBFile
nwbfile = NWBFile(
session_description="session_description",
identifier=str(uuid4()),
session_start_time=datetime(1970, 1, 1, tzinfo=tzlocal()),
)
# Add MazeExtension
maze_extension = MazeExtension(name="mazes", description="Holds information about the mazes for this task.")
# Add row for each maze
maze_extension.add_row(
antiFraction=0,
cueDensityPerM=3,
cueDuration=np.nan,
cueProbability=np.inf,
cueVisibleAt=10,
hideHintUntil=-15,
lContext=10,
lCue=45,
lMemory=10,
lStart=5,
maxTrialDuration=180,
turnHint=1,
numTrials=80,
numTrialsPerMin=2,
criteriaNTrials=100,
numSessions=1,
performance=np.inf,
maxBias=0.2,
easyBlock=np.nan,
easyBlockNTrials=10,
numBlockTrials=40,
blockPerform=0.55,
geoDistP=np.nan,
geoDistPEasy=np.nan,
)
# Create table for storing stimulus protocol parameters
stimulus_protocol = DynamicTable(name="stimulus_protocol", description="Holds information about the stimulus protocol.")
protocol_dict = dict(
stimulus_code="TowersTaskSwitchStimulusTrain",
numMazesInProtocol=11,
trialDraw="EradeCapped",
stimDraw="LeftOneOnly",
cueMinSeparation=12,
totalRepeatProbability=0.05,
numRepeatTrials=2,
visualcolor=np.array([0, 0, 1]),
memorycolor=np.array([0.5, 0.5, 0.]),
princetonImplementation=1,
)
for protocol_name in protocol_dict:
stimulus_protocol.add_column(
name=protocol_name,
description="stimulus protocol parameter.",
)
stimulus_protocol.add_row(**protocol_dict)
# Create LabMetaData
lab_meta_data = LabMetaDataExtension(
name="LabMetaData",
experiment_name="TowersTaskSwitchEasy",
experiment_code="TowersTaskSwitchEasy",
session_index=49,
total_reward=0.925,
surface_quality=74.22,
rig="VR_Widefield",
num_trials=242,
num_iterations=430233,
session_duration=3838.5730088,
advance=0,
mazes=maze_extension,
stimulus_protocol=stimulus_protocol,
)
# Add to NWBFile
nwbfile.add_lab_meta_data(lab_meta_data=lab_meta_data)
# Write LabMetaData to NWB file
nwbfile_path = "virmen_metadata.nwb"
with NWBHDF5IO(nwbfile_path, mode="w") as io:
io.write(nwbfile)
# Check LabMetaData was added to the NWB file
with NWBHDF5IO(nwbfile_path, mode="r", load_namespaces=True) as io:
read_nwbfile = io.read()
read_nwbfile_lab_metadata = read_nwbfile.lab_meta_data["LabMetaData"]
This extension was created using ndx-template.
Metadata
Release files for ndx-pinto-metadata 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ndx-pinto-metadata-0.1.2.tar.gz | 14.3 kB | Without provenance | Details for ndx-pinto-metadata-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ndx_pinto_metadata-0.1.2-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for ndx_pinto_metadata-0.1.2-py2.py3-none-any.whl |
Total release size: 20.2 kB
Release files / ndx-pinto-metadata-0.1.2.tar.gz
| Download URL | ndx-pinto-metadata-0.1.2.tar.gz |
|---|---|
| Size | 14.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9df7aacc0f53ef3659eba897b26d90ac341fb52b643bd66ce95eed13e4cbe14b
|
|
BLAKE2b-256 checksum How to use checksums |
77d2ae04d92271a1faaaa21010c0268247a0e369f6f8019550013967599e60ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|
Release files / ndx_pinto_metadata-0.1.2-py2.py3-none-any.whl
| Download URL | ndx_pinto_metadata-0.1.2-py2.py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
10a79ccf402b18decc030cb3d1c77c48adb78f2c5697030ee4aa05d526f9b867
|
|
BLAKE2b-256 checksum How to use checksums |
f05c9cc5b82958da37f51faf966a97936f31e64931bed3b92d4ccc61bdb3b3dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|
Security for ndx-pinto-metadata 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.