Skip to main content

np-aind-metadata

PyPI Python version

Coverage CI/CD GitHub issues

Usage

conda create -n np_aind_metadata python>=3.10
conda activate np_aind_metadata
pip install np_aind_metadata

On-prem usage

If on Allen Institute premises, additional features are available via np-config. To use on-prem features install np-config.

pip install np-config

Python

On-prem

Copies the latest rig.json from storage to a local path.

>>> from datetime import datetime
>>> from pathlib import Path
>>> import datetime
>>> from np_aind_metadata import rigs

>>> rigs.copy_rig("NP3", datetime(2024, 4, 1), output_path=Path("rig.json"))
PosixPath('rig.json')

Off-prem

Updates a rig json and store it at output path.

>>> from pathlib import Path
>>> from np_aind_metadata.update import update_rig
>>> update_rig(
...     Path(".", "examples", "rig.json"),
...     open_ephys_settings_sources=[
...         Path(
...             ".",
...             "examples",
...             "example-session-directory",
...             "settings.xml"
...         ),
...     ],
...     output_path=Path("rig.json"),
... )
PosixPath('rig.json')

Convenience functions

Direct support for common use cases.

np-codeocean

Parses a dynamic routing session directory for a session.json, adds it's corresponding rig.json, and updates session.json to reflect the rig.json it is associated with. If not onprem, rig_storage_dir will need to be supplied.

>>> from pathlib import Path
>>> from np_aind_metadata.integrations import dynamic_routing_task
>>> session_dir = Path("examples") / "example-session-directory"
>>> dynamic_routing_task.add_rig_to_session_dir(session_dir, datetime.datetime(2024, 4, 1))

Model storage

Models are stored locally on disk. To initialize model storage.

Initialize storage for all supported rigs.

np-aind-metadata init-rig-storage "/directory/to/store/rigs"

Initialize storage for a specific rig.

np-aind-metadata init-rig-storage "/directory/to/store/rigs" "NP3" --date 2022/02/07

Update a stored rig.

np-aind-metadata update-rig "/directory/to/store/rigs" "NP3" --date 2022/02/07

Local development

Testing

Testing intended for cloned project from source control.

Unit tests

pdm run pytest

Storage tests

pdm run pytest-storage

On-prem tests

Requires user to likely be on prem with np group dependencies installed.

Install np group dependencies

pdm install -G np

Run tests

pdm run pytest-onprem

All tests

Requires dependencies from onprem.

pdm run pytest-full

Development

See instructions in https://github.com/AllenInstitute/np-aind-metadata/CONTRIBUTING.md and the original template: https://github.com/AllenInstitute/copier-pdm-npc/blob/main/README.md

Metadata

Release files for np-aind-metadata 0.1.18

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for np-aind-metadata 0.1.18
File Size Uploaded Provenance Actions
np_aind_metadata-0.1.18.tar.gz 22.8 kB Without provenance Details for np_aind_metadata-0.1.18.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for np-aind-metadata 0.1.18
File Interpreter ABI Platform Actions
np_aind_metadata-0.1.18-py3-none-any.whl Python 3 none any Details for np_aind_metadata-0.1.18-py3-none-any.whl

Total release size: 48.1 kB

Release files / np_aind_metadata-0.1.18.tar.gz

Download URL np_aind_metadata-0.1.18.tar.gz
Size 22.8 kB
Tags Source
SHA-256 checksum
How to use checksums
522dc45e95562243039a0d143bb93e7b86d85edc01cf75ba441c7071bd4c4814
BLAKE2b-256 checksum
How to use checksums
9f0b21df55cb5637a61c12b3ef7adb718cbbee1ba25ea47ba999712d8b78fc23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.20.0.post1 CPython/3.10.12 Linux/6.5.0-1025-azure

Release files / np_aind_metadata-0.1.18-py3-none-any.whl

Download URL np_aind_metadata-0.1.18-py3-none-any.whl
Size 25.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b830b3b30f4332df68613d6fe5474b56af1bdbe1188380fa4188355b8793d0e
BLAKE2b-256 checksum
How to use checksums
e38d1972fca5c0e6bbc6e645d80936d1b531d05c5abf41427dbee875c44a3a14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.20.0.post1 CPython/3.10.12 Linux/6.5.0-1025-azure

Security for np-aind-metadata 0.1.18

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page