Skip to main content

DIDIS - Desy ITk Database Interaction Script

DIDIS is a Python script meant to ease interaction with the ATLAS ITk Production Database (DB) for the detector (pre-)production efforts at DESY-HH.

Installation

Pip users can get the package by issuing

pip install didis

On some systems, use pip3 instead of pip.

Requirements

DIDIS is based on python3. You can install all requirements at once by issuing

pip install --user requests argh loguru itkdb

When you install via pip, it will be done for you during the intalltion.

Authentication

The DB required two user specific access codes to authenticate the user. For security reasons, these should not be stored on the disk. They are stored in the environment variables ITKDB_ACCESS_CODE1 and ITKDB_ACCESS_CODE2. In linux, they can be set for the current terminal session like this:

export ITKDB_ACCESS_CODE1=YourFirstPassword
export ITKDB_ACCESS_CODE2=YourSecondPassword

or for Windows

set ITKDB_ACCESS_CODE1=YourFirstPassword
set ITKDB_ACCESS_CODE2=YourSecondPassword

Check whether the authentication is working by calling

didis authenticate

Looking up components in the DB

With DIDIS, the ITk DB can be searched for all sorts of keys, not only for serial numbers. The tool "lookup" does exactly this and outputs the DB codes.

didis lookup -v 20USEBT1098765 --printJSON

looks up a Bus Tape with the ATLAS SN 20USEBT1098765 and prints the component info in human readable JSON. The subproject, component type and lookup key can also be changed using the optional arguments. Call the script with --help for more info. By passing the option --returnResults, the function returns a dictionary that either appears as the CLI output or can be used by the calling function.

Attaching a file to a component

To attach a file from your local file system to a component with ID CID, use

didis attach results.zip CID

The ID can be found using the lookup command. Use --eos to upload to eos instead.

Setting the production stage

Setting the production stage of a component with ATLAS serial number SN to STAGE is done via

didis stage SN -s STAGE

Leaving the -s argument just prints the current production stage without changing anything.

Get all available tests for a component type

Get all available tests for type "BT":

didis tets --componentType BT

Get a test skeleton JSON

Get a bare test JSON for a given test type:

didis skeleton --test BTELECTRICAL --componentType BT

Using --returnResults makes the skeleton available as a dict via the function return.

Upload a test result to the DB

The content field requires to be set to the ATLAS serial number, not to the component ID To upload a JSON test result to the DB, use

didis upload FILE.json

When not using the CLI, the function can also convert a dict directly.

Get all test results associated with a component

To get a dict with all test results for a given component id, use

didis testruns DB_COMPONENT_ID

You can find the component id using the lookup command.

Attaching a file to a test run

To attach a file from your local file system to a test run with ID TID, use

didis testfile results.zip TID

The ID can be found using the testruns command. Use --eos to upload to eos instead.

Usage in another Python script

To use the functions in the didis.py script, use the import

import didis.didis as dd

Registering new Components

Make an Excel file with all the properties and serial numbers and register them all via

didis-batch register YOUREXCELFILE

Start batch identifiers with B_.

Assembling Components

Assemble a child component to a parent using

didis assemble PARENT_SERIAL_NUMBER CHILD_SERIAL_NUMBER

If the component has no ATLAS serial number, use the alternative identifier instead. Specify this using the --parentAID and --childAID flags. Optionally, a .json file or dict can be passed to the properties input.

Changing Component properties

To change a component property, use

didis property COMPONENT_ID PROPERTY_ID VALUE

The component ID can also be a ATLAS serial number.

Adding a comment to a component / test

To add a comment to a component, use

didis comment COMPONENT_SERIAL_OR_ID "COMMENT_STRING"

To add a comment to a test run, use

didis comment TEST_ID "COMMENT_STRING" --isTest

TODO: When only adding one comment, the DB throws an error. An additional empty comment is created as a workaround as of now

Creating a shipment

To add a new shipment, use

didis ship COMPONENT_ID --OPTIONS

Metadata

Release files for didis 0.0.30

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

Source distribution (sdist)

Source distribution for didis 0.0.30
File Size Uploaded Provenance Actions
didis-0.0.30.tar.gz 13.8 kB Without provenance Details for didis-0.0.30.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for didis 0.0.30
File Interpreter ABI Platform Actions
didis-0.0.30-py3-none-any.whl Python 3 none any Details for didis-0.0.30-py3-none-any.whl

Total release size: 26.9 kB

Release files / didis-0.0.30.tar.gz

Download URL didis-0.0.30.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a4cad4fd0c18cbfc9cfad748fea882e5ef12a942d08f09ec8e554947e47dff81
BLAKE2b-256 checksum
How to use checksums
bb382c61be162a82b641741d7b5df65adf9ed6f0ece7e3443ee2b80257e3ee10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / didis-0.0.30-py3-none-any.whl

Download URL didis-0.0.30-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b8a0acf7784fb5e858a62b6add4c0d02077e4b3c041d347ada15acc29f9dd77
BLAKE2b-256 checksum
How to use checksums
ba61da96496e8ce60215b8cf53905b2535f7043bcf3e846ee48104de56fdcdf5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Security for didis 0.0.30

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