Code Overview¶
Code Operation¶
Let’s walk through how the code is structured and how it operates.
The user starts by creating a new instance of the
Example_Diagnosticclass. This class is a subclass of theDataclass from themodules/generic_get_data.py.The
Example_Diagnosticclass has a method calledExample_Diagnostic.example_value(). This attribute is really a property that is a wrapper around theExample_Diagnostic._example_value()method. When this method is called, it will then call theData.get()method which has different options.If the user has previously called the
Example_Diagnostic.example_value()method, then the data is already loaded into theExample_Diagnostic._example_valueattribute and is returned.Try to load the data that is already on the computer. When the
Example_Diagnosticinstance is created, aload_filepathattribute can be set. If so, a dictionary is loaded in from that file. If that file contains the correct call string then the data is loaded in. If not, then the data is loaded in from the MDSPlus.Try to load the data from MDSPlus. If a connection has not yet been made to the MDSPlus server, then a connection is made. Once the connection is made then we can just do the normal MDSPlus syntax for getting data from a node.
Once the data is loaded in, it is packaged into an array and returned to the
Example_Diagnosticinstance. This sets theExample_Diagnostic._example_valueattribute. Any future calls will use this value.