Name | happi JSON |
Version |
2.6.0
JSON |
| download |
home_page | None |
Summary | Happi Database Access for LCLS Beamline Devices |
upload_time | 2024-12-20 19:42:30 |
maintainer | None |
docs_url | None |
author | SLAC National Accelerator Laboratory |
requires_python | >=3.9 |
license | Copyright (c) 2023, The Board of Trustees of the Leland Stanford Junior University, through SLAC National Accelerator Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: (1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. (2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. (3) Neither the name of the Leland Stanford Junior University, SLAC National Accelerator Laboratory, U.S. Dept. of Energy nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER, THE UNITED STATES GOVERNMENT, OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. You are under no obligation whatsoever to provide any bug fixes, patches, or upgrades to the features, functionality or performance of the source code ("Enhancements") to anyone; however, if you choose to make your Enhancements available either publicly, or directly to SLAC National Accelerator Laboratory, without imposing a separate written license agreement for such Enhancements, then you hereby grant the following license: a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, distribute, and sublicense such Enhancements or derivative works thereof, in binary and source code form. |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<h1 align="center">HAPPI</h1>
<div align="center">
<strong>Heuristic Access to Positioning of Photon Instrumentation</strong>
</div>
<p align="center">
<a href="#motivation">Motivation</a> •
<a href="#features">Features</a> •
<a href="#installation">Installation</a> •
<a href="#contributing">Contributing/a> •
<a href="#basic-usage">Basic Usage</a> •
<a href="https://pcdshub.github.io/happi/">Documentation</a>
</p>
## Motivation
LCLS endstations deal with dynamic sets of instrumentation. Information like
ports, triggers and aliases are all important for operation, but hard to manage
when spread across a multitude of applications. **Happi** solves this problem
by creating a single access point for all the metadata required to interface
with LCLS instrumentation. Using a flexible `container` based system Happi
allows the enforcement of specific conventions while still permitting flexible
data entry where required.
## Features
* Manage information for specific device types using containers
* Input arbitrary metadata associated with a specific device
* Flexible backend support for multiple types of databases; MongoDB, JSON e.t.c
* Easily search database entries for device/s that match a set of keys
## Installation
Install the most recent tagged build: `conda install happi -c pcds-tag -c conda-forge`
Install the most recent development build: `conda install happi -c pcds-dev -c conda-forge`
## Contributing
Developers should check out the [contributing docs](https://github.com/pcdshub/happi/blob/master/CONTRIBUTING.rst).
## Basic Usage
The `happi.Client` is your main interface to the underlying device database.
You have the choice of either creating your database backend by hand or using
the environment variable `$HAPPI_BACKEND` to create a persistent reference to
your database type. By default, the `Client` assumes a `JSON` file database:
```python
import happi
client = happi.Client(path='path/to/my_db.json')
```
If your database has entries, you should either be able to search by key
variables for individual or multiple devices.
```python
client.find_device(name="My Device")
client.search(stand='DG2')
```
Once you have the device you want, you can edit the information just as you
would any other Python object. View the device information in a
convenient table using `.show_info`:
```python
dev = client.find_device(name="My Device")
dev.z = 432.1
dev.show_info()
```
#### Output
```text
+--------------+----------------------+
| EntryInfo | Value |
+--------------+----------------------+
| active | True |
| beamline | LCLS |
| name | My Device |
| parent | None |
| prefix | MY:DEV:01 |
| stand | None |
| system | None |
| z | 432.10000 |
+--------------+----------------------+
```
After you are satisfied with your changes, push the information back to the
database using the `.save` method. If this is a new device, you will have to
call `Client.add_device`. Before the entry is modified in the database, the
`happi.Client` confirms that the new changes meet all the requirements
specified by the container.
```python
dev.save()
```
#### Command Line Interface
You can also view and manipulate device databases using the happi cli:
```
happi [OPTIONS] COMMAND [ARGS]...
```
You can try out happi commands on a simple test database as follows _(this assumes you are running from the happi project root dir)_:
```
happi --path examples/example.cfg COMMAND [ARGS]
```
The simple test database is located at `happi/examples/db.json`, which is specified in `example./cfg`.
Please refer to the documentation for a list of possible commands and their arguments.
Raw data
{
"_id": null,
"home_page": null,
"name": "happi",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "SLAC National Accelerator Laboratory",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/ae/3e/3fa4c7b801692e10a8a692df2a551b5c44f4a1343b6d0891d088a90161fb/happi-2.6.0.tar.gz",
"platform": null,
"description": "<h1 align=\"center\">HAPPI</h1>\n\n<div align=\"center\">\n <strong>Heuristic Access to Positioning of Photon Instrumentation</strong>\n</div>\n\n<p align=\"center\">\n <a href=\"#motivation\">Motivation</a> \u2022\n <a href=\"#features\">Features</a> \u2022\n <a href=\"#installation\">Installation</a> \u2022\n <a href=\"#contributing\">Contributing/a> \u2022\n <a href=\"#basic-usage\">Basic Usage</a> \u2022\n <a href=\"https://pcdshub.github.io/happi/\">Documentation</a>\n</p>\n\n## Motivation\nLCLS endstations deal with dynamic sets of instrumentation. Information like\nports, triggers and aliases are all important for operation, but hard to manage\nwhen spread across a multitude of applications. **Happi** solves this problem\nby creating a single access point for all the metadata required to interface\nwith LCLS instrumentation. Using a flexible `container` based system Happi\nallows the enforcement of specific conventions while still permitting flexible\ndata entry where required.\n\n\n## Features\n* Manage information for specific device types using containers\n* Input arbitrary metadata associated with a specific device\n* Flexible backend support for multiple types of databases; MongoDB, JSON e.t.c\n* Easily search database entries for device/s that match a set of keys\n\n## Installation\n\nInstall the most recent tagged build: `conda install happi -c pcds-tag -c conda-forge`\n\nInstall the most recent development build: `conda install happi -c pcds-dev -c conda-forge`\n\n## Contributing\n\nDevelopers should check out the [contributing docs](https://github.com/pcdshub/happi/blob/master/CONTRIBUTING.rst).\n\n## Basic Usage\n\nThe `happi.Client` is your main interface to the underlying device database.\nYou have the choice of either creating your database backend by hand or using\nthe environment variable `$HAPPI_BACKEND` to create a persistent reference to\nyour database type. By default, the `Client` assumes a `JSON` file database:\n\n```python\n\n import happi\n\n client = happi.Client(path='path/to/my_db.json')\n```\n\nIf your database has entries, you should either be able to search by key\nvariables for individual or multiple devices.\n\n```python\n\n client.find_device(name=\"My Device\")\n\n client.search(stand='DG2')\n```\n\nOnce you have the device you want, you can edit the information just as you\nwould any other Python object. View the device information in a\nconvenient table using `.show_info`:\n\n```python\n\n dev = client.find_device(name=\"My Device\")\n\n dev.z = 432.1\n\n dev.show_info()\n```\n#### Output\n\n```text\n+--------------+----------------------+\n| EntryInfo | Value |\n+--------------+----------------------+\n| active | True |\n| beamline | LCLS |\n| name | My Device |\n| parent | None |\n| prefix | MY:DEV:01 |\n| stand | None |\n| system | None |\n| z | 432.10000 |\n+--------------+----------------------+\n```\n\nAfter you are satisfied with your changes, push the information back to the\ndatabase using the `.save` method. If this is a new device, you will have to\ncall `Client.add_device`. Before the entry is modified in the database, the\n`happi.Client` confirms that the new changes meet all the requirements\nspecified by the container.\n\n```python\n\n dev.save()\n```\n\n#### Command Line Interface\n\nYou can also view and manipulate device databases using the happi cli:\n\n```\nhappi [OPTIONS] COMMAND [ARGS]...\n```\n\nYou can try out happi commands on a simple test database as follows _(this assumes you are running from the happi project root dir)_:\n\n```\nhappi --path examples/example.cfg COMMAND [ARGS]\n```\n\nThe simple test database is located at `happi/examples/db.json`, which is specified in `example./cfg`.\nPlease refer to the documentation for a list of possible commands and their arguments.\n",
"bugtrack_url": null,
"license": "Copyright (c) 2023, The Board of Trustees of the Leland Stanford Junior University, through SLAC National Accelerator Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: (1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. (2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. (3) Neither the name of the Leland Stanford Junior University, SLAC National Accelerator Laboratory, U.S. Dept. of Energy nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER, THE UNITED STATES GOVERNMENT, OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. You are under no obligation whatsoever to provide any bug fixes, patches, or upgrades to the features, functionality or performance of the source code (\"Enhancements\") to anyone; however, if you choose to make your Enhancements available either publicly, or directly to SLAC National Accelerator Laboratory, without imposing a separate written license agreement for such Enhancements, then you hereby grant the following license: a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, distribute, and sublicense such Enhancements or derivative works thereof, in binary and source code form. ",
"summary": "Happi Database Access for LCLS Beamline Devices",
"version": "2.6.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5162be82066c8cb2bf07a8fde56911a8eda110d146d75f9c8607d67f4b16d67b",
"md5": "489e7f7d9637480548a7a97253472371",
"sha256": "b65d18588b697fe5fae51c6b678266551a89b63fefd7527dc46f72332db3032a"
},
"downloads": -1,
"filename": "happi-2.6.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "489e7f7d9637480548a7a97253472371",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 92182,
"upload_time": "2024-12-20T19:42:29",
"upload_time_iso_8601": "2024-12-20T19:42:29.495245Z",
"url": "https://files.pythonhosted.org/packages/51/62/be82066c8cb2bf07a8fde56911a8eda110d146d75f9c8607d67f4b16d67b/happi-2.6.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ae3e3fa4c7b801692e10a8a692df2a551b5c44f4a1343b6d0891d088a90161fb",
"md5": "d691939557eac107a918b066b427f1ca",
"sha256": "7808cc7ce4eb2757aefcf08eede43590d4df885ab0dd708f2cab8c059fd25a39"
},
"downloads": -1,
"filename": "happi-2.6.0.tar.gz",
"has_sig": false,
"md5_digest": "d691939557eac107a918b066b427f1ca",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 109615,
"upload_time": "2024-12-20T19:42:30",
"upload_time_iso_8601": "2024-12-20T19:42:30.673830Z",
"url": "https://files.pythonhosted.org/packages/ae/3e/3fa4c7b801692e10a8a692df2a551b5c44f4a1343b6d0891d088a90161fb/happi-2.6.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-20 19:42:30",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "happi"
}