A tool that checks the form and content of names with respect to the LCLS naming convention.
Project description
A tool that checks the form and content of PV and device names with respect to the LCLS naming convention.
Taxons used are sourced from:
https://docs.google.com/spreadsheets/d/1u5EfR9FIvwyTieWiMkCRqpBfHj-_xm3AygjFlxxWgDc/edit?gid=0#gid=0
https://docs.google.com/spreadsheets/d/1SeQhfwZ6O-wg8tyr_MCQZY1boJC-6j3N6EzexfZB-AU/edit?gid=0#gid=0
Instructions
Use at the command line:
In your current working directory type source /cds/group/pcds/pyps/conda/venvs/lcls_naming_tool/bin/activate
To check if a PV or device name is valid pipe in the name to the tool. For example, $ echo "MR2K4:KBO:PIP:01:PUMPSIZE" | ./lcls_naming_tool.py
To check if a list of names is valid pipe in the file name to the tool. For example, $ cat pvlist.txt | ./lcls_naming_tool.py (names should be separated by newline characters.)
To view the current version add -v or --version. For example, $ echo "MR2K4:KBO:PIP:01:PUMPSIZE" | ./lcls_naming_tool.py --version
Use in a Python script:
In your current working directory set up the environment:
source /cds/group/pcds/pyps/conda/venvs/lcls_naming_tool/bin/activate
git clone git@github.com:pcdshub/lcls_naming_tool.git
export PYTHONPATH=$PWD/lcls_naming_tool/lcls_naming_tool
To call the LCLS Naming Tool module from lcls_naming_tool import load_taxons, validate
In your main function load_taxons() should be called first. It takes no parameters and loads all the approved taxons in JSON format. The function validate() takes a PV or device name in string format as a parameter and returns True for a valid name or False for an invalid name.
To run the web server:
ssh psca@psctlws01
cd /u1/psca/prod/apps/lcls_naming_tool
git pull
supervisorctl
supervisor> stop lcls_naming_tool
supervisor> start lcls_naming_tool
Website is hosted at https://pswww.slac.stanford.edu/lcls_naming_tool/
Requirements
Python 3.9+
Flask 2.2.5 (web only)
Gunicorn 23.0.0 (web only)
Installation
Running the Tests
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
Built Distribution
File details
Details for the file lcls_naming_tool-1.0.1.tar.gz
.
File metadata
- Download URL: lcls_naming_tool-1.0.1.tar.gz
- Upload date:
- Size: 891.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53f6ae25786d5ffe10a2a39c4ba38cdd14de05700222712728d225af53ec496c |
|
MD5 | 6fb895f61e3800fcb209442379c5e889 |
|
BLAKE2b-256 | a75a6862a2ae1d0b27ee3977a11a1999f0a3e6d7d7569ec8b7cfea04b8ef2cee |
File details
Details for the file lcls_naming_tool-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: lcls_naming_tool-1.0.1-py3-none-any.whl
- Upload date:
- Size: 20.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5261a21dec938985fbb97fb3aa0022d0a042b10635a8d3bef1703ee44a90e52 |
|
MD5 | db35082afceb40b4bc27e7b50ea2522d |
|
BLAKE2b-256 | 46e250ad04c9ad73d4b2f92c2299868de377a9ae576c3cc086e1cdf383a3576e |