Contains the upgradeSkiFile function for upgrading SKIRT parameter files. More...
Functions | |
def | _addMediumSystemOptions (optionsTypeName, oldTypeName, oldPropName=None) |
def | _addScalarProperty (typeName, propName, propStringValue) |
Add a scalar property to a given type. More... | |
def | _adjustDustSelfAbsorptionMode () |
def | _adjustLyaExtinctionMode () |
def | _changeBooleanToEnumeration (typeName, oldPropName, newPropName, newValueForFalse, newValueForTrue) |
Change Boolean property to enumeration property. More... | |
def | _changeCompoundPropertyBaseType (typeName, propName, oldBaseType, newBaseType) |
Change the base type of a compound property for a given type. More... | |
def | _changeCompoundPropertyName (typeName, oldPropName, newPropName) |
Change the name of a compound property for a given type. More... | |
def | _changeScalarPropertyName (typeName, oldPropName, newPropName) |
Change the name of a scalar property for a given type. More... | |
def | _changeScalarPropertyValue (typeName, propName, oldValue, newValue) |
Change the value of a given scalar property for a given type. More... | |
def | _changeToFormProbe (oldProbeName, probeName, formName, probeProps, formProps) |
def | _changeTypeName (oldTypeName, newTypeName) |
Rename a given type. More... | |
def | _copyCompoundProperty (oldTypeName, oldPropName, newTypeName) |
Copy a compound property and its value from one type to another (the target type is assumed to exist) More... | |
def | _getUpgradeDefinitions () |
This private function returns a sequence of 2-tuples, each defining the XPath condition and XSLT template for a single modification to the ski file format. More... | |
def | _moveScalarProperty (oldTypeName, oldPropName, newTypeName, newPropName=None) |
Move a scalar property and its value from one type to another, optionally using a new property name on the target type (the target type is assumed to exist). More... | |
def | _removeCompoundProperty (typeName, oldPropName) |
Remove a compound property from a given type. More... | |
def | _removeScalarProperty (typeName, oldPropName) |
Remove a scalar property from a given type. More... | |
def | _removeScalarPropertyWithValue (typeName, oldPropName, oldValue) |
Remove a scalar property with a value starting with a given string from a given type. More... | |
def | upgradeSkiFile (inpath, *backup=True, replace=True) |
This function upgrades the specified SKIRT 9 parameter file (ski file) so that it becomes appropriate for the latest SKIRT 9 version. More... | |
Contains the upgradeSkiFile function for upgrading SKIRT parameter files.
The upgradeSkiFile function in this module allows upgrading SKIRT parameter files (ski files) between versions of SKIRT 9.
|
private |
Add a scalar property to a given type.
|
private |
Change Boolean property to enumeration property.
|
private |
Change the base type of a compound property for a given type.
|
private |
Change the name of a compound property for a given type.
|
private |
Change the name of a scalar property for a given type.
|
private |
Change the value of a given scalar property for a given type.
|
private |
Rename a given type.
|
private |
Copy a compound property and its value from one type to another (the target type is assumed to exist)
|
private |
This private function returns a sequence of 2-tuples, each defining the XPath condition and XSLT template for a single modification to the ski file format.
Using XSLT is extremely flexible, but unfortunately the XSLT language is fairly obscure an thus has a steep learning curve. To alleviate this problem to some extent, we provide a set of functions that generate upgrade definitions for specific types of changes, such as, for example, changing the name of a property. That way, as soon as the XSLT sheet for a particular type of change has been developed, it can be more easily reused for other, similar changes. As a result, this function consists of a sequence of calls to definition generators. New generators will have to be added as the need arises.
The comments before each set of generator calls identifies the change in the SKIRT 9 code requiring the corresponding ski file modification(s).
|
private |
Move a scalar property and its value from one type to another, optionally using a new property name on the target type (the target type is assumed to exist).
|
private |
Remove a compound property from a given type.
|
private |
Remove a scalar property from a given type.
|
private |
Remove a scalar property with a value starting with a given string from a given type.
def pts.skiupgrade.skiupgrade.upgradeSkiFile | ( | inpath, | |
* | backup = True , |
||
replace = True |
|||
) |
This function upgrades the specified SKIRT 9 parameter file (ski file) so that it becomes appropriate for the latest SKIRT 9 version.
The upgrade process supports all ski files created by the SKIRT project version 9 tools (including the SKIRT command line Q&A and the graphical MakeUp wizard) since SKIRT 9 was publicly released. Ski files created for older SKIRT versions (such as SKIRT 7 and 8) cannot be upgraded to SKIRT 9 automatically. The function logs an appropriate error message when an unsupported file is specified.
The function accepts three arguments: