-
Notifications
You must be signed in to change notification settings - Fork 0
For Developers
This page describes easy ways for a new developer to get their feet wet with making changes to Leakdown Tester (LDT). Read on to learn how to set up a workflow with a simple text editor and console combo, or follow the IDE instructions if you prefer to use an IDE to work on the program.
LDT is of course a python script, a command-line program that can be operated any way that you would normally run a python program from a command line. For the power user, you can use a simple text editor on your local repo copy, change what you want, and run the software from console, which means your workflow can vary immensely based on your operating system and comfort level.
For those of us who don't work with python regularly, are uncomfortable with learning and remembering console commands, or perhaps are using python for the first time, there are luckily other solutions. The one we cover below is called an IDE - Integrated Development Environment. These can significantly improve the process of deploying the software and make it much more approachable!
VSCode and it's open-source equivalent VSCodium are excellent choices for working with LDT, because they are both robust IDEs for all kinds of software development. They simplify many parts of the testing process and let you have a persistent integrated terminal that you can always come home to.
While tools like Pycharm are better optimized for playing with Python, VSCode can be a powerful tool in your software toolkit for developing in other languages, so I think it's worth it to learn while you can!
Let's walk through how to set it up.
You may ask - what's the difference?
VSCode is operated and maintained by Microsoft, and includes user telemetry sharing to MS. VSCodium does everything VSCode can, but has the telemetry removed. I prefer VSCodium for the simple reason that it takes up less space in my hard drive and is less resource intense. They are otherwise funcitonally identical!
Download VSCode here or VSCodium here
- Note: package managers can also download VSCodium easily for Linux, Mac, and Windows users - try it out if you want!
- Once the installer is downloaded, run the installer executable.
Open up the newly downloaded VSC software on your machine
One of the best features of VSCode/VSCodium is its ultra-rich extension ecosystem. To make your experience even more streamlined while working with Leakdown Tester (LDT) and the Precision Feedback Pipeline (PFP), you can install some helpful extensions:
- Open VSC.
- Click on the Extensions icon in the Activity Bar on the side (it looks like three squares).
- Search in the search bar on the top left of the extension pane for the following extensions and install them:
- Python (Microsoft): Provides Python language support, including code highlighting, formatting, and linting.
- (Optional) Python Docstring Generator (Nils Werner): Automatically generates docstrings for your Python functions and classes.
- GitControl: Lets you use source control integrated with GitHub
As mentioned earlier, VSCode/VSCodium has an integrated terminal that will be very useful for running your Python scripts and managing the testing process.
- In VSCode/VSCodium, go to the View menu (top bar!)l.
- Select "Integrated Terminal" to open the integrated terminal at the bottom of the window.
Now you need to open the folder containing your Leakdown Tester project files:
- Click on "File" in the top menu.
- Select "Open Folder" and navigate to the directory where your Leakdown Tester project files are located.
- Click "Open" to open the folder in VSCode/VSCodium.
With your project folder open and the integrated terminal ready, you can start running your Python scripts:
- In the integrated terminal, navigate to the location of your Python script using the
cdcommand. - Run your Python script using the
python script_name.pycommand.
Remember to save your work frequently. To close VSCode/VSCodium, simply click the "X" button in the top-right or top-left corner of the application window. Your terminals will also save, which allows you to skip half the battle of setting up your workflow every time you sit down to test!
Congratulations! You're now ready to test!
PyCharm is another powerful integrated development environment (IDE) for Python. If you prefer using PyCharm, follow these steps to set it up:
-
Install PyCharm
- Download the PyCharm Community Edition here
- Run the installer and follow the on-screen instructions to complete the installation.
-
Open Your Project
- Launch PyCharm once the installation is complete.
- Click on "Open" and navigate to your Leakdown Tester project folder.
- Click "Open" to open the project in PyCharm.
-
Configure Python Interpreter
- PyCharm needs to know which Python interpreter to use for your project.
- Go to "File" > "Settings" (or "PyCharm" > "Preferences" on macOS).
- In the left sidebar, click on "Project: YourProjectName" > "Python Interpreter".
- Click on the gear icon and select "Add..."
- Choose "System Interpreter" or create a virtual environment for your project.
-
Running Python Scripts
- With your project open, you can run your Python scripts directly:
- Right-click on the script in the Project Explorer.
- Select "Run script_name.py" from the context menu.
- With your project open, you can run your Python scripts directly:
-
Closing and Saving
- Remember to save your work regularly. To close PyCharm, click the "X" button in the top-right corner.
You're all set with PyCharm!