Skip to content

Guidelines: Native Model Code to FSKX

Thomas edited this page Apr 9, 2024 · 5 revisions

Assuming a model creator has a project that contains the code and all files to run the model successfully. In order to create a valid FSKX model file, one needs to compartmentalize the code as follows:

INPUT & CONSTANT Parameters

  • identify which parameters can be considered as INPUT or CONSTANT parameters
  • all INPUT and CONSTANT parameters need to be removed from the script
  • INPUT and CONSTANT parameters are defined in the model metadata.json, including their default values.
  • parameter id is the name of the variable in the code

Model Script

  • the model script contains the "starting" code to run the model. Even if the model contains multiple source files, the model script will start the execution of the entire workflow.
  • if the model is python, remove if __name__ == '__main__':
  • make sure, if there are OUTPUT parameters, they are accessible in the global scope

Visualization Script

  • contains the creation of a plot
  • only one plot

OUTPUT Parameters

  • those are the results that a model generates
  • in the model script, those parameters need to be global,
  • OUTPUT parameters are defined in the model metadata.json, but without values (since they are generated)

README

  • optional
  • will be provided by creator app if not given

Resource files

  • any other files that the model needs to run

/create_fskx

{ "metadata" : "https://nextcloud.rakip.io/s/YP4gzkm36ALbtW3/download/metaData.json",

"modelscript": "https://nextcloud.rakip.io/s/qE5KcoXoonJJGjZ/download/model.r",

"visualization":"https://nextcloud.rakip.io/s/bMbJmtCTm2j4Dfy/download/visualization.r",

"readme":"https://nextcloud.rakip.io/s/RYkrQK9DdabKsdi/download/README.txt",

"packages":"https://nextcloud.rakip.io/s/qdFX2kCpdnjoPbq/download/packages.json",

"workspace":"https://nextcloud.rakip.io/s/CLDzNoCgTMqipPR/download/workspace.RData" }