iocontrolΒΆ

The module of IO control. (qurry.qurrium.utils.iocontrol)

class qurry.qurrium.utils.iocontrol.IOComplex(expsName: str, save_location: Path, export_location: Path, tarName: str, tarLocation: Path)[source]ΒΆ

The complex of IO control.

export_location: PathΒΆ

Alias for field number 2

expsName: strΒΆ

Alias for field number 0

save_location: PathΒΆ

Alias for field number 1

tarLocation: PathΒΆ

Alias for field number 4

tarName: strΒΆ

Alias for field number 3

qurry.qurrium.utils.iocontrol.RJUST_LEN = 3ΒΆ

The length of the string to be right-justified for serial number.

qurry.qurrium.utils.iocontrol.naming(is_read: bool = False, exps_name: str = 'exps', save_location: Path | str = PosixPath('.'), without_serial: bool = False, rjust_len: int = 3, index_rename: int = 0) IOComplex[source]ΒΆ

The process of naming.

Parameters:
  • is_read (bool, optional) – Whether to read the experiment data. Defaults to False.

  • exps_name (str, optional) – Naming this experiment to recognize it when the jobs are pending to IBMQ Service. This name is also used for creating a folder to store the exports. Defaults to β€˜exps’.

  • save_location (Union[Path, str], optional) – Where to save the export data. Defaults to Path(β€˜./’)

  • without_serial (bool, optional) – Whether to use the serial number. Defaults to False.

  • rjust_len (int, optional) – The length of the serial number. Defaults to 3.

  • index_rename (int, optional) – The serial number. Defaults to 0.

Raises:
Returns:

Name.

Return type:

dict[str, Union[str, Path]]

qurry.qurrium.utils.iocontrol.serial_naming(name: str, index_rename: int, rjust_len: int = 3) str[source]ΒΆ

Create a serial name with right-justified index.

Parameters:
  • name (str) – The base name.

  • index_rename (int) – The index to be right-justified.

  • rjust_len (int, optional) – The length of the right-justified string. Defaults to 3.

Returns:

The formatted name with right-justified index.

Return type:

str