Debugging Locally with VSCode
While models can be developed directly in Akumen’s code editor, we recognise that everybody has their own workflow that they like to follow, and software that they like to use. In this section, we teach you how to set up your model in VSCode so that it executes in exactly the same manner as Akumen, giving you the interactivity and richness of VSCode combined with the confidence that your code will run as-expected in Akumen.
The basic steps to enable local debugging in VSCode is as follows (note the first 6 steps are the same as PyCharm):
- Create your application, either new or from Git, in Akumen.
- Set up your research inputs for at least one scenario.
- Execute the scenario.
- Right-click on the scenario and select
Artifacts
to download the model artifact zip. - Extract the zipfile onto your local computer.
- Open VSCode and open the extracted zip folder.
- Click the Run icon in the toolbar to the left
- Click “create a launch.json file” and paste in the following JSON
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Module",
"type": "python",
"request": "launch",
"module": "akumen",
"args": [ "main.py" ]
}
]
}
This sets the akumen module to launch, accepting the main.py file as the argument to run