Python model example
Model API name: thirdparty-python-model
Example model
Version: v1
Input group: flux_inputs / multiplicity: one
| Input | Description | Valid values | Default | Quantity | 
|---|---|---|---|---|
| energies | Energies to use |  | [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] | energy | 
| flux_scale | Scale the flux |  | 1 | number | 
Input group: function_coeficients / multiplicity: many
| Input | Description | Valid values | Default | Quantity | 
|---|---|---|---|---|
| A_param | Parameter A |  | 5 | number | 
| C_param | Parameter c |  | 15 | number | 
| 
 | 
                        
    None
                    
                    
                    
from os import path
from nom_client.nom_client import NoMClient
here = path.abspath(path.dirname(__file__))
nom_client = NoMClient("My model example", default_server_id="local_server", debug_output=False)
my_model = nom_client.get_model(model_name='thirdparty-python-model')
my_model_result = nom_client.run_model(my_model)
print(my_model_result)
"""
List all of the model results from this model. This can be used to get the appropriate model result 
from the results returned by the model
"""
print(my_model_result.get_result_names())
# Lets get the 'shielded_trapped_proton_spectrum'
my_model_result_data = my_model_result.get_model_result_by_name(result_name="flux_data")
print(my_model_result_data)
# List all the data variable names for the 'particle_spectrum' result
print(my_model.get_result_data_names(result_name="flux_data"))
         No references
