molsysmt.basic.get_conversion_report#
- molsysmt.basic.get_conversion_report(molecular_system, to_form='molsysmt.MolSys', selection='all', structure_indices='all', syntax='MolSysMT', skip_digestion=False)[source]#
Getting a conversion preflight report without creating the destination.
- Parameters:
molecular_system (molecular system) – Molecular system in any supported MolSysMT form, or a composition of forms.
to_form (str, pathlib.Path or list, default='molsysmt.MolSys') – Target form name or output filename. Default is ‘molsysmt.MolSys’. A list returns one report per target, in the requested order.
selection (str, list, tuple or numpy.ndarray, default='all') – Selection of atoms to be converted. Default is ‘all’.
structure_indices (int, list, tuple or numpy.ndarray, default='all') – Structure indices (0-based) to be converted. Default is ‘all’.
syntax (str, default='MolSysMT') – Selection syntax. Default is ‘MolSysMT’.
skip_digestion (bool, default=False) – Whether to skip argument digestion. Default is False.
- Returns:
Immutable reports with outcome, detected issues, audited scopes and is_exhaustive. Source files may be read, but the source is not mutated and no destination file is created or overwritten.
- Return type:
ConversionReport or list of ConversionReport
- Raises:
ArgumentError – If arguments or explicit structure indices are invalid.
FormatError – If inspecting a source encounters an unsupported file encoding.
Notes
Uses the same preflight as convert(strict=True) and convert(return_report=True). A report without detected losses is a preservation guarantee only within its audited scopes. Check is_exhaustive before drawing broader conclusions. This is not a test of converter availability, dependency availability or successful writing. It does not accept converter-specific options such as ctfile_version or discard_properties; these remain arguments of convert.
See also
convertConvert a system, optionally rejecting detected losses.
ConversionReportInspect the report contract and serialization.
Examples
>>> import molsysmt as msm >>> from molsysmt.native import Structures >>> molsys = Structures() >>> report = msm.get_conversion_report(molsys, to_form='molsysmt.StructuresDict') >>> report.to_form, report.is_exhaustive, report.is_lossy ('molsysmt.StructuresDict', True, False)
Tutorial with more examples
See Getting conversion reports for preflight limitations.
Added in version 1.0.0.