Config fetching from file or Zookeeper - with local backup - repackaging code from AIBS mpeconfig.
Project description
For use on internal Allen Institute network
- fetch configs from ZooKeeper nodes or .yaml/.json files:
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
toRig
:
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
-
configs are cached locally: if the ZooKeeper server is unavailable, the local copy will be used
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
np_config-0.4.12.tar.gz
(10.9 kB
view details)
Built Distribution
File details
Details for the file np_config-0.4.12.tar.gz
.
File metadata
- Download URL: np_config-0.4.12.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.11.1 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0bd3dce5db76c035e02a16a52168088cd9326cf921ac0d00c21687bdf02e5c6 |
|
MD5 | e4bd789e7d97a6f10d6c333819019fc2 |
|
BLAKE2b-256 | 4d7a57de243aa938d976e63d098a94ee10a9c32163b9719a932aa2249b56fda8 |
Provenance
File details
Details for the file np_config-0.4.12-py3-none-any.whl
.
File metadata
- Download URL: np_config-0.4.12-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.11.1 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef4b8421df9a600c472296af94272ce0f04c1f336e399cdf913a0c313e78449e |
|
MD5 | 1fd5660909322e2a7e9e3aec13c66009 |
|
BLAKE2b-256 | e828dc601171deb1e9274aea5d02669cbee80f0f347a8d8014030eefc4df4658 |