qruise kb commit
Commit schema changes to a branch.
Syntax¶
Description¶
The qruise kb commit
command commits schema changes to a branch. Schema changes must be comitted before any of the experiments can use them.
Options¶
Option | Description |
---|---|
-m, --message |
Commit message. Required. |
-r, --replace |
Replace the schema instead of updating it. |
-p, --profile |
Qruise KB profile name. |
--profiles |
Specify path to the Qruise profiles file. |
--database |
Override database name. |
--organization |
Override organization name. |
--help |
Show a help message and exit. |
Examples¶
Adding a new field to the schema¶
The simplest case of modifying the schema file is adding a new field to an already existing class. Suppose your schema.py
file contains the following class:
This describes the fitting result of a randomised benchmarking experiment, with two fields: epc
and alpha
(the physical significance of these parameters is not relevant here). Now suppose you want to add another field, spam
, so that the RandomisedBenchmarkingFit
class looks like this:
class RandomisedBenchmarkingFit(Fit):
epc: Optional[Quantity]
alpha: Optional[Quantity]
spam: Optional[Quantity]
To commit this change to the knowledge base, simply run:
The argument to the -m
option is the commit message. It will be visible in the commit log, as verified by running the qruise kb log
command (output truncated for brevity):
$ qruise kb log
commit ejlo4ajqmod79axhy5otqawzidf3ans
Author: admin
Date: 2025-03-19, 11:48:43
Added 'spam' field in the 'RandomisedBenchmarkingFit' class
Adding a new class to the schema¶
Extending the schema by adding a new class is just as easy as adding a new field to a schema - simply enter a new class in the schema.py
file and run the same command as in the previous example, whilst remembering to update the commit message: