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.25.tar.gz
(11.5 kB
view details)
Built Distribution
File details
Details for the file np_config-0.4.25.tar.gz
.
File metadata
- Download URL: np_config-0.4.25.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 | a9466f80357b5887d48e37b3493365b07bf2bd523de39442aae3d75012280da8 |
|
MD5 | d8efdf27bcf4ef3f762be0474b80b292 |
|
BLAKE2b-256 | aa5be8ba66e1d695f0db149ecde503008400eb89293d80c1a702860704757510 |
Provenance
File details
Details for the file np_config-0.4.25-py3-none-any.whl
.
File metadata
- Download URL: np_config-0.4.25-py3-none-any.whl
- Upload date:
- Size: 11.6 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 | bb8c1f8ac0aed82b5907de08e26ccff2a3dfe3e9ad4b4f3b5bbccab59d477c01 |
|
MD5 | d38c62802320c8dc78088ce0dab0c779 |
|
BLAKE2b-256 | 3a645d529736c71b98c091b4c9321654ddb29049e41b24d7260fdedef635806e |