Config fetching from file or Zookeeper - with local backup - repackaging code from AIBS mpeconfig.
Project description
np_config
For use on internal Allen Institute network
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
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.19.tar.gz
(11.5 kB
view details)
Built Distribution
File details
Details for the file np_config-0.4.19.tar.gz
.
File metadata
- Download URL: np_config-0.4.19.tar.gz
- Upload date:
- Size: 11.5 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 | 350bb88d298613c23bab4c1aaff01cc0ca361df95bbefe02567eac5482e389f2 |
|
MD5 | aa7d9bc59eff71588c2cf69230b0c892 |
|
BLAKE2b-256 | 1195272e84ca0ab6603bd20b3ee15af4ee3d83257059fa1618f34b9d1d4800ec |
Provenance
File details
Details for the file np_config-0.4.19-py3-none-any.whl
.
File metadata
- Download URL: np_config-0.4.19-py3-none-any.whl
- Upload date:
- Size: 11.5 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 | 0b2d7a1b8d347970c8d895d6683f05c6fbf0e7de3cffb96bb9304caf5660a848 |
|
MD5 | 121c2707f22014fe9bcae154131980e9 |
|
BLAKE2b-256 | b8b9cb6d5642287d05565c3ac61bc05d13b64bae8da1cd1309ee23e7df7d5f64 |