Skip to main content

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:

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']

Project details


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.13.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

np_config-0.4.13-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file np_config-0.4.13.tar.gz.

File metadata

  • Download URL: np_config-0.4.13.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

Hashes for np_config-0.4.13.tar.gz
Algorithm Hash digest
SHA256 68d2428982a7be613ee4a413e740141cc66d951362c1f22de072fc726044a67a
MD5 a6a3ff8bbb3b66b5de9261eea14708fd
BLAKE2b-256 719004e845c055f6c00855636407a863883f91c9dcec31d0cae334908eab4052

See more details on using hashes here.

Provenance

File details

Details for the file np_config-0.4.13-py3-none-any.whl.

File metadata

  • Download URL: np_config-0.4.13-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

Hashes for np_config-0.4.13-py3-none-any.whl
Algorithm Hash digest
SHA256 c03b9dacdb386accdcd9a85c40f623ddaf1b9103cd9731048954051e1c002767
MD5 6cd7ac40c813960fa982304b3209fca6
BLAKE2b-256 4547623e54086c9d1ba20aae3fc8fc4aa338caca8474c4f163f64a57e7f1d031

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page