np_config
For use on internal Allen Institute network
Usage
Fetch configs from ZooKeeper nodes or .yaml/.json files:
import np_config
zk_config: dict[str, str | int] = np_config.from_zk('/rigs/NP.1')
file_config: dict[str, Any] = np_config.from_file('local_config.yaml')
If running on a machine attached to a Mindscope Neuropixels rig (NP.0, ..., NP.3), get rig-specific config info with:
rig = np_config.Rig()
name: str = rig.id # "NP.1"
index: int = rig.idx # 1
acquisition_pc_hostname: str = rig.acq # "W10DT713843"
config: dict[str, str | int] = rig.config # specific to NP.1
paths: dict[str, pathlib.Path] = rig.paths # using values from rig.config
If not running on a rig-attached machine, get the config for a particular rig by supplying rig-index as an int to Rig:
np1 = np_config.Rig(1)
np1_mvr_data_root: pathlib.Path = np.paths['MVR']
- the Mindscope ZooKeeper server is at
eng-mindscope:2181 - configs can be added via ZooNavigator webview: http://eng-mindscope:8081
- or more conveniently, via an extension for VSCode such as gaoliang.visual-zookeeper
Development
Initialize for local development
poetry install --with dev
Run the tests
poetry run pytest
Metadata
Release files for np-config 0.4.37
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 | |
|---|---|---|---|---|
| np_config-0.4.37.tar.gz | 13.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| np_config-0.4.37-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.3 kB
Release files / np_config-0.4.37.tar.gz
| Download URL | np_config-0.4.37.tar.gz |
|---|---|
| Size | 13.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
300b322094d4e5824c31e4851f802869c324c3b4f960136bb719f1137be48b5e
|
|
BLAKE2b-256 checksum How to use checksums |
560306e2830a54f4df23860dd0d7ed915f58d38aa5c89a2c3552df0551d90951
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.22.4 CPython/3.11.5 Windows/10
|
Release files / np_config-0.4.37-py3-none-any.whl
| Download URL | np_config-0.4.37-py3-none-any.whl |
|---|---|
| Size | 12.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5106f385a538079602c5a5fde176f20ac1f185f81b5c3545e6baa0b98b946d46
|
|
BLAKE2b-256 checksum How to use checksums |
37619528a7fa83a7e8b3e5673498468db0249178c0b9e228c23bfb70c7e90910
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.22.4 CPython/3.11.5 Windows/10
|
Security for np-config 0.4.37
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.