Command

class zgoubidoo.commands.commands.Command(label1: str = '', label2: str = '', *params, **kwargs)[source]

Bases: object

Test test test.

More info on this wonderful class. TODO

Command attributes

LABEL1=''

Primary label for the Zgoubi command (default: auto-generated hash).

Type

str

LABEL2=''

Secondary label for the Zgoubi command.

Type

str

TODO :param label1: :param label2: :param *params: :param **kwargs:

Attributes Summary

KEYWORD

Keyword of the command used for the Zgoubi input data.

PARAMETERS

Parameters of the command, with their default value, their description and optinally an index used by other commands (e.g.

attributes

All attributes.

defaults

Default attributes.

nondefaults

Non default attributes.

output

Provides the outputs associated with a command after each successive Zgoubi run.

results

Provides the results of a Zgoubi command in the form of a Pandas DataFrame.

Methods Summary

attach_output(outputs, parameters, zgoubi_input)

Attach the ouput that an command has generated during a Zgoubi run.

build(stream[, debug])

param stream

clean_output_and_results()

Clears the output attached to the command.

generate_label([prefix])

param prefix

parse(stream)

param stream

post_init(**kwargs)

TODO :param **kwargs: all arguments from the initializer (constructor) are passed to post_init as keyword arguments.

process_output(output, parameters, zgoubi_input)

param output

the output from a Zgoubi run to be processed by the command.

Attributes Documentation

KEYWORD: str = ''

Keyword of the command used for the Zgoubi input data.

PARAMETERS: dict = {'LABEL1': ('', 'Primary label for the Zgoubi command (default: auto-generated hash).'), 'LABEL2': ('', 'Secondary label for the Zgoubi command.')}

Parameters of the command, with their default value, their description and optinally an index used by other commands (e.g. fit).

attributes

All attributes.

Provides a dictionary with all attributes for the command.

Returns: dictionnary with all attributes.

defaults

Default attributes.

Provides a dictionary with all attributes that have been assigned a default value.

Returns: dictionary with all default attributes.

nondefaults

Non default attributes.

Provides a dictionary with all attributes that have been assigned a non default value.

Returns: dictionary with all non default attributes.

output

Provides the outputs associated with a command after each successive Zgoubi run.

Returns

the output, None if no output has been previously attached.

results

Provides the results of a Zgoubi command in the form of a Pandas DataFrame.

Returns

the results, None if not available, a DataFrame otherwise.

Methods Documentation

attach_output(outputs: List[str], parameters: Mapping[str, Union[pint.quantity.build_quantity_class.<locals>.Quantity, float]], zgoubi_input: zgoubidoo.input.Input)[source]

Attach the ouput that an command has generated during a Zgoubi run.

Parameters
  • outputs – the outputs from a Zgoubi run to be attached to the command.

  • parameters – TODO

  • zgoubi_input – the Input sequence (required for output processing).

classmethod build(stream: str, debug: bool = False)zgoubidoo.commands.commands.Command[source]
Parameters
  • stream

  • debug

Returns:

clean_output_and_results()[source]

Clears the output attached to the command.

Returns

the command itself (for method chaining, etc.)

generate_label(prefix: str = '')[source]
Parameters

prefix

Returns:

classmethod parse(stream: str)[source]
Parameters

stream

Returns:

post_init(**kwargs)[source]

TODO :param **kwargs: all arguments from the initializer (constructor) are passed to post_init as keyword arguments.

process_output(output: List[str], parameters: Mapping[str, Union[pint.quantity.build_quantity_class.<locals>.Quantity, float]], zgoubi_input: zgoubidoo.input.Input) → bool[source]
Parameters
  • output – the output from a Zgoubi run to be processed by the command.

  • parameters – TODO

  • zgoubi_input – the Input sequence (required and some cases by the command output processor).

Returns

a flag indicating if the processing is valid.