The ra_api.py module#

Summary#

RockyApiError

Exception class representing an error generated in the API layer.

CheckCanModify

Helper function that checks if a property can be changed by evaluating two conditions:

CheckPropAffectsSimulation

Helper function to check if the property (given by prop_name) affects the simulation results.

IsObjectUsedByRestart

IsFreeflow

Helper method to be used to ensure the app is in freeflow variant.

Module detail#

ra_api.CheckCanModify(ra_object) → None#

Helper function that checks if a property can be changed by evaluating two conditions:

1) If the project has simulation results, raises an error with a helpful message. Should be called by API methods that would invalidate simulation results; 2) If we are in a blocked context, i.e. the ValidateModuleInput, no property should be changed.

ra_api.CheckPropAffectsSimulation(prop_owner, prop_name) → bool#

Helper function to check if the property (given by prop_name) affects the simulation results.

ra_api.IsObjectUsedByRestart(subject) → bool#
ra_api.IsFreeflow(raise_error: bool = True) → bool#

Helper method to be used to ensure the app is in freeflow variant.