podio_schema_evolution module

Provides infrastructure for analyzing schema definitions for schema evolution

class podio_schema_evolution.AddedComponent(component, name)

Bases: SchemaChange

Class representing an added component

class podio_schema_evolution.AddedDatatype(datatype, name)

Bases: SchemaChange

Class representing an added datatype

class podio_schema_evolution.AddedMember(member, definition_name)

Bases: SchemaChange

Class representing an added member

class podio_schema_evolution.AddedMultiRelation(member, datatype)

Bases: SchemaChange

Class representing an added OneToManyRelation

class podio_schema_evolution.AddedSingleRelation(member, datatype)

Bases: SchemaChange

Class representing an added OneToOneRelation

class podio_schema_evolution.AddedVectorMember(member, datatype)

Bases: SchemaChange

Class representing an added VectorMember

class podio_schema_evolution.ChangedMemberType(name, old_member, new_member)

Bases: SchemaChange

Class representing a type change in a member

class podio_schema_evolution.ComparisonResults(old_datamodel: DataModel, warnings: List[str], errors: List[str], schema_changes: List[SchemaChange] = None)

Bases: object

Class grouping the results of a datamodel comparison

errors: List[str]
old_datamodel: DataModel
schema_changes: List[SchemaChange] = None
warnings: List[str]
class podio_schema_evolution.DataModelComparator(new_datamodel: DataModel)

Bases: object

Compares two datamodels and detects schema changes

compare(old_datamodel: DataModel) → List[SchemaChange]

execute the comparison between the new datamodel and the old one

get_changed_schemata(results, schema_filter=None)

return the schemata which actually changed

print_comparison(results)

print the result of the datamodel comparison

class podio_schema_evolution.DroppedComponent(component, name)

Bases: SchemaChange

Class representing a dropped component

class podio_schema_evolution.DroppedDatatype(datatype, name)

Bases: SchemaChange

Class representing a dropped datatype

class podio_schema_evolution.DroppedMember(member, definition_name)

Bases: SchemaChange

Class representing a dropped member

class podio_schema_evolution.DroppedMultiRelation(member, datatype)

Bases: SchemaChange

Class representing a dropped OneToManyRelation

class podio_schema_evolution.DroppedSingleRelation(member, datatype)

Bases: SchemaChange

Class representing a dropped OneToOneRelation

class podio_schema_evolution.DroppedVectorMember(member, datatype)

Bases: SchemaChange

Class representing a dropped VectorMember

class podio_schema_evolution.RenamedDataType(name_old, name_new)

Bases: SchemaChange

Class representing a renamed datatype

class podio_schema_evolution.RenamedMember(name, member_name_old, member_name_new)

Bases: SchemaChange

Class representing a renamed member

class podio_schema_evolution.RootIoRule(sourceClass: str, targetClass: str, version: int, code: str, target: str, source: str = '')

Bases: object

Class collecting all necessary information to create an I/O rule for ROOT

code: str
source: str = ''
sourceClass: str
target: str
targetClass: str
version: int
class podio_schema_evolution.SchemaChange(description)

Bases: object

The base class for all schema changes providing a brief description as representation

class podio_schema_evolution.SchemaEvolutionJudge(new_datamodel, evolution_file=None)

Bases: object

Analyzes detected schema changes and applies heuristics to determine what changes are supported, need user input, or are forbidden

class RenameResult(*values)

Bases: IntEnum

Possible results for checking member variable renaming

HANDLED = 1
NO_RENAME = 0
UNHANDLED = 2
check_rename(added_member, dropped_member, schema_changes, read_schema_changes)

Check whether this pair of addition / removal could be a rename and return True if it is found in the renamings and false otherwise

filter_types_with_adds_and_drops(added_members, dropped_members)

Filter all additions and removals and return pairs of additions / removals that happen on the same datatype

heuristics_members(added_members, dropped_members, schema_changes, read_schema_changes, warnings)

make analysis of member changes in a given data type

judge(old_datamodel, detected_schema_changes) → ComparisonResults

Apply heuristics to detected schema changes and return analysis results

unsupported_changes = (<class 'podio_schema_evolution.AddedVectorMember'>, <class 'podio_schema_evolution.DroppedVectorMember'>, <class 'podio_schema_evolution.AddedSingleRelation'>, <class 'podio_schema_evolution.DroppedSingleRelation'>, <class 'podio_schema_evolution.DroppedMultiRelation'>)
podio_schema_evolution.root_filter(schema_changes)

Checks what is required/supported for the ROOT backend

At this point in time we are only interested in renames. Everything else will be done by ROOT automatically

podio_schema_evolution.sio_filter(schema_changes)

Checks what is required/supported for the SIO backend

At this point in time all schema changes have to be handled on PODIO side