| Name | octal JSON |
| Version |
0.0.2
JSON |
| download |
| home_page | |
| Summary | Automated testing library for a wide range of instruments |
| upload_time | 2023-08-11 12:09:52 |
| maintainer | |
| docs_url | None |
| author | |
| requires_python | >=3.6 |
| license | |
| keywords |
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
matplotlib
numpy
pandas
pyvisa
pyyaml
tqdm
pywin32
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# ORC Optical Chip Test Automation Library
ORC OCTAL is a Python package equipped with all essential sweep tests, analysis tools, and interfaces with existing equipments in ORC group.
<!-- toc -->
- [More About ORC OCTAL](#more-about-orc-octal)
- [Directory Structure](#directory-structure)
- [Installation](#installation)
- [Git Bash](#git-bash)
- [Python Environment](#python-environment)
- [Visual Studio Code (VSCode)](#visual-studio-code-vscode)
- [Install ORC OCTAL](#install-orc-octal)
- [Getting Started](#getting-started)
- [How to Run a Test](#how-to-run-a-test)
- [Test and Setup Instruments](#tests-and-setup-instrument)
- [Debugging Issues](#debugging-issues)
- [Developer Guide](#developer-information)
- [Git Bash](#git-bash-1)
- [Expand this Library](#expand-this-library)
<!-- tocstop -->
## More About ORC OCTAL
This is a tool allowing you to do three things: remotely setup your instruments, run standard sweeps, and analyse the results afterwards which all files should have a specific format. This is still at its infant stage so is still lacking a lot of functions which are widely used by the users. Please suggest and we would love to help!
### Directory Structure
```
.
<folders>
├── config # all configuration files
│ └── ... # read the README.md
├── lib # core library
│ └── ... # read the README.md
├── results # all test results should be stored here
<files>
├── instr_main.py # direct interface with instruments (only for simple setup cases)
├── plot_main.py # plotting graphs
├── requirements.txt # contain all required python packages for this repository <need to be amended>
├── sweep_main.py # interface for running sweeps
└── venv_setup.py # set up virtual environment <not working>
```
## Installation
Before installing any of the software, please make sure that you know exactly the operating system that you are running on and whether it is 32-bit or 64-bit.
### Git Bash (Optional)
If you have not install Git, install the newest correct version of Git for your Windows system. Git is a source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. This is a very useful tool to keep track of the newest information being pushed onto the remote Github repository.
### Environment
This repository only works when two conditions are satisfied:
- Windows OS machine - this is neccessary for pywin32 module
- python version >= 3.6 - this is neccessary for f-string formatting
**Method 1 - Install Anaconda (Preferred)**:
The Anaconda version must
- Support your current Windows OS system
- Able to create a Python 3.6 environment
Install Anaconda version which supports your OS system and make sure all listed packages in `requirements.txt` are installed.
To install packages, go to Enviornments tab, select not installed, and then search up the packages. There are some packages that might not be listed because the channel which contain them are not imported upon installation. If that is the case, search up the python package and find the corresponding channel and include it in Anaconda environment.
If your Anaconda does not use Python 3.6 for its environment, it will fail to install `pyvisa`. Firstly, make sure that the current Anaconda python version is at least 3.6. Once the condition is satisfied, create a new environment with Anaconda Prompt and specify Python version as Python 3.6. After the new environment is successfully created, it can be viewed under Environments tab. The packages can then be installed on this new environment without errors.
```bash
# create a new conda environment
> conda create --name orc_octal python=3.6
```
- `pyvisa` requires "conda-forge" channel
- `pyaml` requires "conda-forge" channel
**NOTE FOR WINDOWS 7 USERS:**
If your system is running on Windows 7, please only install Anaconda versions which are equipped with Python versions older than 3.8. This is very important as versions since Python 3.9 do not support Windows 7. The safe option is install versions before anaconda3-2020-11.
If you attempt to install the later anaconda version on your Windows 7 system, you will get a "Failed to create menus" error. Refer to [Using Anaconda on older operating systems](https://docs.anaconda.com/free/anaconda/install/old-os/) for more information.
**Method 2 - Use Virtual Python Environment**:
Run this in the root-directory of this repository namely `autotesting`.
| Platform | Shell | Command to activate virtual environment
|----------|---------|----------------------------------------|
| Posix | bash/zsh | $ source .venv/bin/activate |
| | fish | $ source .venv/bin/activate.fish |
| | csh/tcsh | $ source .venv/bin/activate.csh |
| | PowerShell | $ .venv/bin/Activate.ps1 |
| Windows | cmd.exe | > .venv\Scripts\activate.bat |
| | PowerShell | > .venv\Scripts\Activate.ps1|
```bash
# This automatically setup your virtual environment
> python3 -m venv_setup
# Windows PS example
# Activate a venv machine.
> .venv\Scripts\Activate.ps1
# Deactivate a venv machine
> deactivate
```
### Visual Studio Code (VSCode)
Install VSCode for code editing or running in python terminal. This software can be opened in Anaconda Navigator under Home tab. Recommend you to setup a Github account if you have not already done so and sign in to the account in VSCode.
Open a new bash terminal in VSCode by going to the top tab bar and Terminal > New Terminal. Now you will have opened a terminal and ready to clone the repository down.
**NOTE:** If you are running Windows 7, alternative code editors, such as Atom, VSCodium, and Texteditor are available.
### Install ORC OCTAL
For users, I recommend to update your current old repository to a newer version by cloning or downloading this repository again and delete the old ones.
**Method 1 - Clone from Git (Preferred)**:
Getting the repository cloned to a local direcotory
```bash
# Create a directory named autotesting
> mkdir autotesting
# Go into that directory
> cd autotesting
# Clone this repository down to your autotesting directory
> git clone https://github.com/christina-chang-tw/ORCOCTAL.git
# move into that directory
> cd ORCOCTAL
```
**Method 2 - Download from Github**:
You can download a zip file containing this repository by navigating to <> Code tab and then select Local and Download ZIP.
## Getting Started
### Launch terminal
Launch the Anaconda prompt either via search result or Anaconda Navigator. Once it is launched, activate the new environment (orc_octal). Now, you are all set to run your tests.
```bash
# activate your new environment
> conda activate orc_octal
# deactivate
> conda deactivate
```
### How to Run a Test?
Everything is this repository should be run as a python module. It uses argparse package to parse command line information to the program.
**Sweeps**
These are the optical tests that are currently implemented by this library. These can be run by running `sweep_main.py` as a module from the root directory.
| Tests | Instruments | Description |
| --------- | ------------ | -------------- |
| passive | ILME, Agilent 8163B | Insertion loss testing using PAS ILME engine |
| | Agilent 8163B | Manual insertion loss testing |
| dc | | dc sweeps |
Before you run a test, please make sure that you set all parameters correctly in the corresponding configuration file! All configuration files should be stored under `config` folder.
```bash
# Example:
# (1) General helper message
> python -m sweep_main -h
# (2) Run a passive test without specifying anything
> python -m sweep_main -t passive
# (3) Run a dc sweep test with logging level as DEBUG and specify the config file path
# -<var>=<str> or -<var> <str> yields the same result
> python -m sweep_main -t dc --log-lvl DEBUG --config=./config/test.yaml
```
**Instrument Setup**
Run `instr_main.py` as a module.
| Test | Instrument | Description |
|---------| ---------- |----------------|
| agilent8163B | Agilent 8163B | Setup the multimeter to the auto-range and desired wavelength and output power |
| h_speed | Setup the clock frequency for both clock signal generator and oscilloscope |
```bash
# Example:
# (1) General helper message
> python -m instr_main -h
# (2) Helper message for specific instrument(s)
> python -m instr_main m_8163b -h
# (3) Setup 8163B wavelength at 1550nm and power at 10dBm
> python -m instr_main m_8163b -w 1550 -p 10
```
### Debugging issues
1. f-string formatting method cannot be used is an issues related to the python version. Only versions after Python 3.6 adopts f-string format.
2. Contact me if need extra help: tyc1g20@soton.ac.uk
## Developer Information
### Git Bash
Git commands related to updating the remote directory. The best practice is
- Create a new branch before making any modifictions to the repository as it isolates out your changes from others
- Always pull the newest update before you push your new changes
- Once you are satisfied and ready to make the final update to the main reponsitory, merge your branch and the main branch together
Create a branch for developing your own code:
```bash
# Example
> git branch new_branch # create a new branch called new_branch
> git checkout new_branch # checkout to new_branch from current branch
```
Pull the newest changes down:
```bash
> git pull
# or
> git pull https://github.com/christina-chang-tw/orcoctal.git
```
Push your local changes to the remote repository:
```bash
> git add .
> git commit -m "message" # commit your local changes with "message" as a comment
> git push # push your changes to the remote branch
```
### Expand this library
To maintain the current structure, place your instrument class in the correct file. If the type of your instrument does not exist yet, please create a class which subclass the `BaseInstrument` class.
Raw data
{
"_id": null,
"home_page": "",
"name": "octal",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "",
"author": "",
"author_email": "Tzu-Yun Chang <tyc1g20@soton.ac.uk>",
"download_url": "https://files.pythonhosted.org/packages/10/1c/4fcb3ef961f8fcce14ca3a6f4f38045b3b4165bb5cfe31121df80b126434/octal-0.0.2.tar.gz",
"platform": null,
"description": "# ORC Optical Chip Test Automation Library\n\nORC OCTAL is a Python package equipped with all essential sweep tests, analysis tools, and interfaces with existing equipments in ORC group.\n\n<!-- toc -->\n- [More About ORC OCTAL](#more-about-orc-octal)\n - [Directory Structure](#directory-structure)\n- [Installation](#installation)\n - [Git Bash](#git-bash)\n - [Python Environment](#python-environment)\n - [Visual Studio Code (VSCode)](#visual-studio-code-vscode)\n - [Install ORC OCTAL](#install-orc-octal)\n- [Getting Started](#getting-started)\n - [How to Run a Test](#how-to-run-a-test)\n - [Test and Setup Instruments](#tests-and-setup-instrument)\n - [Debugging Issues](#debugging-issues)\n- [Developer Guide](#developer-information)\n - [Git Bash](#git-bash-1)\n - [Expand this Library](#expand-this-library)\n<!-- tocstop -->\n\n\n## More About ORC OCTAL\nThis is a tool allowing you to do three things: remotely setup your instruments, run standard sweeps, and analyse the results afterwards which all files should have a specific format. This is still at its infant stage so is still lacking a lot of functions which are widely used by the users. Please suggest and we would love to help!\n\n### Directory Structure\n\n```\n.\n<folders>\n\u251c\u2500\u2500 config # all configuration files\n\u2502 \u2514\u2500\u2500 ... # read the README.md\n\u251c\u2500\u2500 lib # core library\n\u2502 \u2514\u2500\u2500 ... # read the README.md\n\u251c\u2500\u2500 results # all test results should be stored here\n<files>\n\u251c\u2500\u2500 instr_main.py # direct interface with instruments (only for simple setup cases)\n\u251c\u2500\u2500 plot_main.py # plotting graphs\n\u251c\u2500\u2500 requirements.txt # contain all required python packages for this repository <need to be amended>\n\u251c\u2500\u2500 sweep_main.py # interface for running sweeps\n\u2514\u2500\u2500 venv_setup.py # set up virtual environment <not working>\n```\n\n## Installation\n\nBefore installing any of the software, please make sure that you know exactly the operating system that you are running on and whether it is 32-bit or 64-bit.\n\n### Git Bash (Optional)\n\nIf you have not install Git, install the newest correct version of Git for your Windows system. Git is a source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. This is a very useful tool to keep track of the newest information being pushed onto the remote Github repository.\n\n### Environment\n\nThis repository only works when two conditions are satisfied:\n- Windows OS machine - this is neccessary for pywin32 module\n- python version >= 3.6 - this is neccessary for f-string formatting\n\n**Method 1 - Install Anaconda (Preferred)**:\n\nThe Anaconda version must\n- Support your current Windows OS system\n- Able to create a Python 3.6 environment\n\nInstall Anaconda version which supports your OS system and make sure all listed packages in `requirements.txt` are installed.\n\nTo install packages, go to Enviornments tab, select not installed, and then search up the packages. There are some packages that might not be listed because the channel which contain them are not imported upon installation. If that is the case, search up the python package and find the corresponding channel and include it in Anaconda environment. \n\nIf your Anaconda does not use Python 3.6 for its environment, it will fail to install `pyvisa`. Firstly, make sure that the current Anaconda python version is at least 3.6. Once the condition is satisfied, create a new environment with Anaconda Prompt and specify Python version as Python 3.6. After the new environment is successfully created, it can be viewed under Environments tab. The packages can then be installed on this new environment without errors.\n\n```bash\n# create a new conda environment\n> conda create --name orc_octal python=3.6\n```\n\n- `pyvisa` requires \"conda-forge\" channel\n- `pyaml` requires \"conda-forge\" channel\n\n**NOTE FOR WINDOWS 7 USERS:**\nIf your system is running on Windows 7, please only install Anaconda versions which are equipped with Python versions older than 3.8. This is very important as versions since Python 3.9 do not support Windows 7. The safe option is install versions before anaconda3-2020-11. \n\nIf you attempt to install the later anaconda version on your Windows 7 system, you will get a \"Failed to create menus\" error. Refer to [Using Anaconda on older operating systems](https://docs.anaconda.com/free/anaconda/install/old-os/) for more information.\n\n\n\n\n**Method 2 - Use Virtual Python Environment**:\n\nRun this in the root-directory of this repository namely `autotesting`.\n\n| Platform | Shell | Command to activate virtual environment\n|----------|---------|----------------------------------------|\n| Posix | bash/zsh | $ source .venv/bin/activate |\n| | fish | $ source .venv/bin/activate.fish |\n| | csh/tcsh | $ source .venv/bin/activate.csh |\n| | PowerShell | $ .venv/bin/Activate.ps1 |\n| Windows | cmd.exe | > .venv\\Scripts\\activate.bat |\n| | PowerShell | > .venv\\Scripts\\Activate.ps1|\n\n```bash\n# This automatically setup your virtual environment\n> python3 -m venv_setup\n\n# Windows PS example\n# Activate a venv machine.\n> .venv\\Scripts\\Activate.ps1\n\n# Deactivate a venv machine\n> deactivate\n```\n\n### Visual Studio Code (VSCode)\n\nInstall VSCode for code editing or running in python terminal. This software can be opened in Anaconda Navigator under Home tab. Recommend you to setup a Github account if you have not already done so and sign in to the account in VSCode.\n\nOpen a new bash terminal in VSCode by going to the top tab bar and Terminal > New Terminal. Now you will have opened a terminal and ready to clone the repository down.\n\n**NOTE:** If you are running Windows 7, alternative code editors, such as Atom, VSCodium, and Texteditor are available.\n\n\n### Install ORC OCTAL\n\nFor users, I recommend to update your current old repository to a newer version by cloning or downloading this repository again and delete the old ones.\n\n**Method 1 - Clone from Git (Preferred)**:\n\nGetting the repository cloned to a local direcotory\n```bash\n# Create a directory named autotesting\n> mkdir autotesting\n# Go into that directory\n> cd autotesting\n# Clone this repository down to your autotesting directory\n> git clone https://github.com/christina-chang-tw/ORCOCTAL.git\n# move into that directory\n> cd ORCOCTAL\n```\n\n**Method 2 - Download from Github**:\n\nYou can download a zip file containing this repository by navigating to <> Code tab and then select Local and Download ZIP.\n\n## Getting Started\n\n### Launch terminal\n\nLaunch the Anaconda prompt either via search result or Anaconda Navigator. Once it is launched, activate the new environment (orc_octal). Now, you are all set to run your tests.\n\n```bash\n# activate your new environment\n> conda activate orc_octal\n# deactivate\n> conda deactivate\n```\n\n### How to Run a Test?\nEverything is this repository should be run as a python module. It uses argparse package to parse command line information to the program. \n\n**Sweeps**\n\nThese are the optical tests that are currently implemented by this library. These can be run by running `sweep_main.py` as a module from the root directory.\n\n| Tests | Instruments | Description |\n| --------- | ------------ | -------------- |\n| passive | ILME, Agilent 8163B | Insertion loss testing using PAS ILME engine |\n| | Agilent 8163B | Manual insertion loss testing |\n| dc | | dc sweeps |\n\nBefore you run a test, please make sure that you set all parameters correctly in the corresponding configuration file! All configuration files should be stored under `config` folder.\n\n```bash\n# Example: \n# (1) General helper message\n> python -m sweep_main -h\n# (2) Run a passive test without specifying anything\n> python -m sweep_main -t passive\n# (3) Run a dc sweep test with logging level as DEBUG and specify the config file path\n# -<var>=<str> or -<var> <str> yields the same result\n> python -m sweep_main -t dc --log-lvl DEBUG --config=./config/test.yaml\n```\n\n**Instrument Setup**\n\nRun `instr_main.py` as a module.\n| Test | Instrument | Description |\n|---------| ---------- |----------------|\n| agilent8163B | Agilent 8163B | Setup the multimeter to the auto-range and desired wavelength and output power |\n| h_speed | Setup the clock frequency for both clock signal generator and oscilloscope |\n\n```bash\n# Example: \n# (1) General helper message\n> python -m instr_main -h\n# (2) Helper message for specific instrument(s)\n> python -m instr_main m_8163b -h\n# (3) Setup 8163B wavelength at 1550nm and power at 10dBm\n> python -m instr_main m_8163b -w 1550 -p 10\n```\n\n### Debugging issues\n\n1. f-string formatting method cannot be used is an issues related to the python version. Only versions after Python 3.6 adopts f-string format.\n2. Contact me if need extra help: tyc1g20@soton.ac.uk \n\n\n## Developer Information\n\n### Git Bash\n\nGit commands related to updating the remote directory. The best practice is \n- Create a new branch before making any modifictions to the repository as it isolates out your changes from others\n- Always pull the newest update before you push your new changes\n- Once you are satisfied and ready to make the final update to the main reponsitory, merge your branch and the main branch together\n\nCreate a branch for developing your own code:\n```bash\n# Example\n> git branch new_branch # create a new branch called new_branch\n> git checkout new_branch # checkout to new_branch from current branch\n```\n\n\nPull the newest changes down:\n```bash\n> git pull \n# or\n> git pull https://github.com/christina-chang-tw/orcoctal.git\n```\n\nPush your local changes to the remote repository:\n```bash\n> git add .\n> git commit -m \"message\" # commit your local changes with \"message\" as a comment\n> git push # push your changes to the remote branch\n```\n\n### Expand this library\nTo maintain the current structure, place your instrument class in the correct file. If the type of your instrument does not exist yet, please create a class which subclass the `BaseInstrument` class.\n\n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "Automated testing library for a wide range of instruments",
"version": "0.0.2",
"project_urls": {
"Repository": "https://github.com/christina-chang-tw/ORCOCTAL.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5a6fc052a301a9e41c7d52d7278c7095377ca57a6845490654c49cae532cf9fc",
"md5": "ee90efb678959cda6bd9418f2ea4ef84",
"sha256": "8f30dea6e78cf5d015823db4cbdcba33c99221903606194820875720460512dc"
},
"downloads": -1,
"filename": "octal-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ee90efb678959cda6bd9418f2ea4ef84",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 50312,
"upload_time": "2023-08-11T12:09:50",
"upload_time_iso_8601": "2023-08-11T12:09:50.961021Z",
"url": "https://files.pythonhosted.org/packages/5a/6f/c052a301a9e41c7d52d7278c7095377ca57a6845490654c49cae532cf9fc/octal-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "101c4fcb3ef961f8fcce14ca3a6f4f38045b3b4165bb5cfe31121df80b126434",
"md5": "a7af1a8bb60a1bdd84501fc62ebc279d",
"sha256": "6febd1eb2b2fe4f9f795691d5015c0ed5133b6d50e6142a97fabfc0b4e7d5467"
},
"downloads": -1,
"filename": "octal-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "a7af1a8bb60a1bdd84501fc62ebc279d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 43961,
"upload_time": "2023-08-11T12:09:52",
"upload_time_iso_8601": "2023-08-11T12:09:52.801166Z",
"url": "https://files.pythonhosted.org/packages/10/1c/4fcb3ef961f8fcce14ca3a6f4f38045b3b4165bb5cfe31121df80b126434/octal-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-11 12:09:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "christina-chang-tw",
"github_project": "ORCOCTAL",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "matplotlib",
"specs": []
},
{
"name": "numpy",
"specs": []
},
{
"name": "pandas",
"specs": []
},
{
"name": "pyvisa",
"specs": []
},
{
"name": "pyyaml",
"specs": []
},
{
"name": "tqdm",
"specs": []
},
{
"name": "pywin32",
"specs": []
}
],
"lcname": "octal"
}