class
JSONDataFilesMakerProvides generation tools for VT Data using phase specification input. It internally use - the `populate_from_specification` method from the Phase class for building the phase instance - the VTDataWriter to write data files
Methods
- def _JSONDataFilesMaker__parse_args(self)
- Parse arguments.
- def ask_object(self, objects: typing.Union[dict, list], object_type_name: str, can_add: bool = False, can_go_back = False, question: str = None, validate: typing.Optional[typing.Callable] = None, default = None)
- Request user to select a choice in a list of dict keys or list indices
- def build(self)
- Build the data set
- def load_sample(self, use_explicit_keys: bool = False)
- Create a new sample specification as represented by diagram specified in issue #506 This method implementation indicates also how to create a specification from Python code
- def load_spec_from_file(self, file_path) -> typing.Optional[Execution.lbsPhaseSpecification.PhaseSpecificationNormalizer]
- Load a specification from a file (Yaml or Json)
- def make_communication(self)
- Creates or updates a communication in interactive mode
- def make_object(self, parent: typing.Union[list, dict], object_type_name: str, default, update: typing.Callable)
- Create or update an object in a list (id is the index) or in a dict (id is the key) for interactive input of tasks, communications and shared blocks
- def make_rank(self)
- Creates or updates a rank in interactive mode
- Creates or updates a communication in interactive mode
- def make_task(self)
- Creates or updates a task in interactive mode
- def print(self, output_format: str = 'json')
- print a specification to the console
- def process_args(self) -> Execution.lbsPhaseSpecification.PhaseSpecification
- Process input arguments and initialize a working PhaseSpecification instance
- def remove_communication(self)
- Remove a communication in interactive mode
- def remove_element(self)
- Remove element (task, rank, shared block or communication) in interactive mode
- def remove_rank(self)
- Remove a shared block in interactive mode
- Remove a shared block in interactive mode
- def remove_task(self)
- Remove a task in interactive mode
- def run(self)
- Run the JSONDatasetMaker
- def run_action(self, action: str)
- Run an action
- def run_extra_action(self, action: str)
- Run an extra action
- def update_communication(self, comm)
- Ask for communication size, from and to in interactive mode
- def update_rank(self, rank: Execution.lbsPhaseSpecification.RankSpecification, rank_id: typing.Optional[int])
- Ask for rank id (if new) and tasks in interactive mode
- Ask for shared block size, and tasks in interactive mode
- def update_task(self, task: Execution.lbsPhaseSpecification.TaskSpecification)
- Ask for task time, collection_id in interactive mode
Special methods
- def __init__(self, logger: typing.Optional[logging.Logger] = None)
- Initializes an instance of the JSONDatasetMaker utility class
Method documentation
def lbaf. Utils. lbsJSONDataFilesMaker. JSONDataFilesMaker. load_spec_from_file(self, file_path) -> typing.Optional[Execution.lbsPhaseSpecification.PhaseSpecificationNormalizer]
Load a specification from a file (Yaml or Json)
Return a PhaseSpecificationNormalizer instance on success or None on failure. Exit the program if specification file is invalid in non-interactive mode