Skip to content

Commit 46ef534

Browse files
authored
Merge pull request #69 from VektrexElectronicSystems/development-sandbox
Development-sandbox v1.14.0
2 parents 4a7cdfb + 7f3cfc7 commit 46ef534

File tree

175 files changed

+2338
-1428
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+2338
-1428
lines changed

README.md

Lines changed: 38 additions & 170 deletions
Original file line numberDiff line numberDiff line change
@@ -13,195 +13,63 @@ Use these code samples to start learning how to communicate with your SpikeSafe
1313
- [Application-Specific Examples](application_specific_examples) - These folders consist of more advanced sequences to address specific test scenarios, as well as some demonstrations to fine-tune your SpikeSafe current output. These sequences explain how to make light measurements using a SpikeSafe and a spectrometer, how to make in-situ junction temperature measurements on LEDs, and how to take full advantage of all SpikeSafe features.
1414
- [spikesafe-python API Overview](spikesafe_python_lib_docs). These folders contain complete class documentation for the spikesafe-python package used to power all of the aforementioned example directories.
1515

16-
## Usage
17-
18-
### Python
19-
Download from the official [Python](https://www.python.org/downloads/) website.
20-
21-
During Python installation check the box Add Python to PATH when prompted.
22-
- Confirm Python PATH is set in **Command Prompt** by typing `py --version` to verify the Python version
23-
24-
Installing Python will install:
25-
- IDLE
26-
- Python Launcher
27-
- Python3 Interpreter
28-
29-
After Python installation is complete, restart the computer to ensure packages under the [Packages](#packages) Section can be successfully installed.
30-
31-
Vektrex targets working support for versions of Python with the status key of bugfix or higher, see [Python Release Cycle](https://devguide.python.org/versions/#versions).
16+
## Downloading Files
3217

33-
#### Windows Setup
18+
On this page, press **Clone or download** to download all files in this repository. We recommend saving this repository to your working directory with all other GitHub repositories.
3419

35-
##### Use the Standard Console Command Prompt
36-
To open Command Prompt press the key combination Windows + R to open a Run dialog, and then type cmd and hit Enter or click Ok.
20+
If only a specific sequence or folder is needed, right-click the desired file/folder and select **Save link as...**.
3721

38-
##### Add Python to PATH
39-
It is recommended that the path of Python Interpreter is added for easy usage. If this was not done in as part of the [Python](#python) section, it can be manually done afterwards.
22+
## Project Setup
4023

41-
Manually add Python to Windows Path:
42-
- Press the key combination **Windows + R** to open a Run dialog
43-
- Type `sysdm.cpl` to open the System Properties
44-
- Press **Advanced** tab and then press on **Environment Variables…** to open Environment Variables dialog
45-
- Under the **User variables** box, press on **New…** to add the `Path` variable (if your **Path** variable already exists, then press on **Edit…** instead):
46-
- Set the Path **Variable value** to the 1) `Python application path` and 2) `Python Scripts path`. To find these paths and set the value:
47-
- Type `Python` in the Windows Search Bar
48-
- Right-click on the **Python App**, and then press **Open file location**
49-
- Right-click on the **Python shortcut**, and then press **Open file location** (this is the `Python application path`)
50-
- Navigate to the **scripts** folder (this is the `Python Scripts path`)
51-
- Set the Path **Variable value** to `Python application path;Python Scripts path` (paths are separated by a semicolon)
52-
- Press **OK**
53-
- Confirm Python PATH is set in **Command Prompt** by typing `py --version` to verify the Python version
24+
### Setup Steps
5425

55-
#### Mac OS X Setup
26+
1. **Install Python 3.10+**
27+
- Download Python from [python.org](https://www.python.org/downloads/).
28+
- During installation check **Add Python to PATH**.
5629

57-
##### Use the Standard Console Terminal
58-
To open Terminal navigate to Applications, then Utilities, then double-click the Terminal program.
30+
2. **Verify Python**
31+
- Open a terminal and run:
32+
| OS | Command |
33+
| - | - |
34+
| Windows | `py --version` |
35+
| macOS | `python3 --version` |
5936

60-
##### Add Python to PATH
61-
It is recommended that the path of Python Interpreter is added for easy usage. To do this:
37+
3. **Install [pip](https://pypi.org/project/pip/)**
38+
- Run:
39+
| OS | Command |
40+
| - | - |
41+
| Windows | `py -m pip install --upgrade pip` |
42+
| macOS | `python3 -m pip install --upgrade pip` |
6243

63-
- The path for Python interpreter can be found by opening **Python Launcher application** (this is the `Python install directory`)
64-
- Open **Terminal**
65-
- Type `sudo nano /etc/paths`
66-
- Enter path of the `Python install directory` here
67-
- Press `Control + X` to exit
68-
- Press `Y` to save
69-
- Confirm Python PATH is set in **Terminal** by typing `python3 --version` to verify the Python version
44+
4. **Install Dependencies**
45+
- Set terminal to the directory containing `requirements.txt`, run:
46+
```bash
47+
cd <path to directory containing requirements.txt>
48+
```
49+
- Run:
50+
| OS | Command |
51+
| - | - |
52+
| Windows | `py -m pip install --force-reinstall -r requirements.txt` |
53+
| macOS | `python3 -m pip install --force-reinstall -r requirements.txt` |
7054

7155
### IDEs
7256

73-
#### Visual Studio Code and Using a Virtual Environment
74-
To run these sequences a light-weight IDE, or to target cross-platform development, use the free [Visual Studio Code](https://code.visualstudio.com/). See [Getting Started with Python in VS Code](https://code.visualstudio.com/docs/python/python-tutorial) to simply setup your IDE with Python. Optionally, using a [virtual environment](https://docs.python.org/3/tutorial/venv.html) is recommended to successfully meet the installation requirements to run these sequences. To setup your virtual environment run the follow commands and then continue to install the remaining Python packages later in this document:
75-
76-
| OS | Command |
77-
| - | - |
78-
| Windows | `py -m venv .venv` followed by `.venv\scripts\activate` |
79-
| macOS | `python3 -m venv .venv` followed by `.venv\scripts\activate` |
57+
#### Visual Studio Code
58+
To run these sequences a light-weight IDE, or to target cross-platform development, use the free [Visual Studio Code](https://code.visualstudio.com/). See [Getting Started with Python in VS Code](https://code.visualstudio.com/docs/python/python-tutorial) to simply setup your IDE with Python. Optionally, using a [virtual environment](https://docs.python.org/3/tutorial/venv.html) is recommended to successfully meet the installation requirements to run these sequences.
8059

8160
#### Visual Studio Community
82-
To run these sequences in a more feature rich IDE, use the free [Visual Studio Community](https://visualstudio.microsoft.com/vs/community/). See [Python In Visual Studio](https://docs.microsoft.com/en-us/visualstudio/python/tutorial-working-with-python-in-visual-studio-step-00-installation?view=vs-2022) to simply setup your IDE with Python. Optionall, using a [virtual environment](https://docs.microsoft.com/en-us/visualstudio/python/managing-python-environments-in-visual-studio?view=vs-2022) is recommended to successfully meet the installation requirements to run these sequences.
83-
84-
### Packages
85-
SpikeSafePythonSamples requires packages to run all scripts.
86-
87-
There are three ways to install these packages:
88-
1. See Section [Automatically Install Packages with Requirements Text file](#automatically-install-packages-with-python-script)
89-
1. See Section [Automatically Install Packages with Python Script](#automatically-install-packages-with-python-script)
90-
1. See Section [Manually Install Packages](#manually-install-packages)
91-
92-
After all packages are installed, refer to section [Package Helpers](#package-helpers) to verify package details.
93-
94-
#### Automatically Install Packages with Requirements Text file
95-
All necessary SpikeSafePythonSamples packages may be installed automatically using the `requirements.txt` file. Follow these steps:ff
96-
97-
1. Ensure you have `pip` installed and updated. You can check and install `pip` using the following commands:
98-
| OS | Command |
99-
| - | - |
100-
| Windows | `py -m pip install --upgrade pip` |
101-
| macOS | `python3 -m pip install --upgrade pip` |
102-
103-
2. Navigate to the root directory of the SpikeSafePythonSamples project where the `requirements.txt` file is located.
104-
105-
3. Run the following command to install all required packages:
106-
| OS | Command |
107-
| - | - |
108-
| Windows | `py -m pip install -r requirements.txt` |
109-
| macOS | `python3 -m pip install -r requirements.txt` |
110-
111-
After running these commands, all necessary packages will be installed, and you can proceed with running the SpikeSafePythonSamples scripts.
112-
113-
#### Automatically Install Packages with Python Script
114-
All necessary SpikeSafePythonSamples packages may be installed automatically. See [Install SpikeSafePythonSamples Packages](/getting_started/install_spikesafe_python_samples_packages/) and run the python .py script in this directory.
115-
116-
#### Manually Install Packages
117-
All necessary SpikeSafePythonSamples packages may be installed manually. Perform all of the subsections below.
118-
119-
##### Installing pip Package
120-
Installing packages use [pip](https://pypi.org/project/pip/). It is recommended that pip be updated to latest version.
121-
122-
Ensure you have `pip` installed and updated. You can check and install `pip` using the following commands:
123-
| OS | Command |
124-
| - | - |
125-
| Windows | `py -m pip install --upgrade pip` |
126-
| macOS | `python3 -m pip install --upgrade pip` |
127-
128-
##### Installing spikesafe-python Package
129-
The [spikesafe-python](https://pypi.org/project/spikesafe-python/) library will need to be installed. Vektrex recommends always having the latest version of spikesafe-python when running these sequences.
61+
To run these sequences in a more feature rich IDE, use the free [Visual Studio Community](https://visualstudio.microsoft.com/vs/community/). See [Python In Visual Studio](https://docs.microsoft.com/en-us/visualstudio/python/tutorial-working-with-python-in-visual-studio-step-00-installation?view=vs-2022) to simply setup your IDE with Python. Optionally, using a [virtual environment](https://docs.microsoft.com/en-us/visualstudio/python/managing-python-environments-in-visual-studio?view=vs-2022) is recommended.
13062

131-
To install this package, run command:
132-
| OS | Command |
133-
| - | - |
134-
| Windows | `py -m pip install --upgrade spikesafe-python` |
135-
| macOS | `python3 -m pip install --upgrade spikesafe-python` |
136-
137-
Once the spikesafe-python package is installed, each script in this repository can be run independently as a standalone Python file. Run a file in its current state and verify that the expected outputs are obtained, as specified by the file's markdown description.
138-
139-
Complete class documentation is available for spikesafe-python in [spikesafe-python API Overview](spikesafe_python_lib_docs).
140-
141-
##### Installing matplotlib Package
142-
Some sequences involve graphing measurement results. To properly graph results, the [matplotlib](https://matplotlib.org/) library is required (version 3.2.1 or greater). Once the matplotlib library is installed, each sequence that involves graphing can be run as a standalone Python file.
143-
144-
To install this package, run command:
145-
| OS | Command |
146-
| - | - |
147-
| Windows | `py -m pip install --upgrade matplotlib` |
148-
| macOS | `python3 -m pip install --upgrade matplotlib` |
149-
150-
##### Installing PyCLibrary Package
151-
Some sequences require external C resources, and requires the [PyCLibrary](https://pyclibrary.readthedocs.io/en/latest/) library. Once the PyCLibrary library is installed, each sequence that involves external C resources can be run as a standalone Python file.
152-
153-
To install this package, run command:
154-
| OS | Command |
155-
| - | - |
156-
| Windows | `py -m pip install --upgrade pyclibrary` |
157-
| macOS | `python3 -m pip install --upgrade pyclibrary` |
158-
159-
##### Installing pyserial Package
160-
Some sequences involve connecting to a serial interface instrument and requires the [pyserial](https://pypi.org/project/pyserial/) library (version 3.5 or greater). Once the pyserial library is installed, each sequence that involves a serial interface can be run as a standalone Python file.
161-
162-
To install this package, run command:
163-
| OS | Command |
164-
| - | - |
165-
| Windows | `py -m pip install --upgrade pyserial` |
166-
| macOS | `python3 -m pip install --upgrade pyserial` |
167-
168-
#### Package Helpers
169-
170-
##### How to View All Installed Packages
171-
A list of all installed packages can be displayed.
172-
173-
To view all installed packages, run command:
174-
| OS | Command |
175-
| - | - |
176-
| Windows | `py -m pip freeze` |
177-
| macOS | `python3 -m pip freeze` |
178-
179-
##### How to View Details of an Installed Package
180-
After a package is installed the details of a package can be displayed.
63+
## Where Do I Start?
18164

182-
To view details of a package, run command:
183-
| OS | Command |
184-
| - | - |
185-
| Windows | `py -m pip show <package name>` |
186-
| macOS | `python3 -m pip <package name>` |
65+
Start with [TCP Socket Sample](getting_started/tcp_socket_sample) to learn how setup a simple socket to communicate with your SpikeSafe. Then check out the rest of the samples under [Getting Started](getting_started).
18766

188-
### General Usage
189-
For most examples, you may need to modify the specified IP address within a sequence to match the IP address that is physically set on your SpikeSafe's DIP switch. In each sequence, the default IP address of 10.0.0.220 is set in the line `ip_address = '10.0.0.220'`.
67+
You will need to modify the specified IP address within a sequence to match the IP address that is physically set on your SpikeSafe's DIP switch. In each sequence, the default IP address of 10.0.0.220 is set in the line `ip_address = '10.0.0.220'`.
19068
191-
Each file can be modified to include additional settings and commands to fit individual needs. Refer to SpikeSafe documentation for more information on the SpikeSafe API.
69+
Each file can be modified to include additional settings and commands to fit individual needs. Complete class documentation is available in [spikesafe-python API Overview](spikesafe_python_lib_docs).
19270
19371
Most examples will log messages to the SpikeSafePythonSamples.log file under your local SpikeSafePythonSamples\ directory. Please refer to this file to ensure your sequence is running correctly.
19472
195-
## Downloading Files
196-
197-
On this page, press "Clone or download" to download all files in this repository. We recommend saving this repository to your working directory for all other GitHub repositories.
198-
199-
If only a specific sequence or folder is needed, right-click the desired file/folder and select "Save link as...".
200-
201-
## Where Do I Start?
202-
203-
First start with [TCP Socket Sample](getting_started/tcp_socket_sample) to learn how setup a simple socket to communicate with your SpikeSafe. Then check out the rest of the samples under [Getting Started](getting_started).
204-
20573
## Built With
20674
20775
* [Visual Studio Code](https://code.visualstudio.com/)
@@ -232,7 +100,7 @@ The [locale](https://docs.python.org/3/library/locale.html#module-locale) module
232100
233101
If any further assistance is needed beyond the information provided within this repository, email [email protected].
234102
235-
Feature requests and bug reports can be submitted to [the Vektrex website's support page](https://www.vektrex.com/request-support/). Select "Other" as the Product/System and enter "SpikeSafePythonSamples GitHub Repository" as the Subject.
103+
Feature requests and bug reports can be submitted to [the Vektrex website's support page](https://www.vektrex.com/request-support/). Select **Other** as the Product/System and enter **SpikeSafePythonSamples GitHub Repository** as the Subject.
236104

237105
## Contributors
238106

0 commit comments

Comments
 (0)