This repository contains code and resources related to power electronics applications, potentially leveraging Artificial Intelligence techniques.
This project likely includes:
- Power Electronics Simulations: Based on the presence of
.plecsfiles, the repository seems to contain simulations, possibly using PLECS software. - AI/ML Models: The presence of
.ipynbfiles suggests the use of Python and associated libraries (e.g., scikit-learn, PyTorch) to develop machine learning models for power electronics related tasks. - Data Analysis: The inclusion of files like
Performance.csvindicates data analysis related to power electronics system performance. - Dependency Management: Uses
requirements.txtfor managing Python package dependencies. - Automated Package Installation: Includes
parse_imports.pyto assist with identifying and installing necessary packages.
Before running the code in this repository, ensure you have the following installed:
- Python: Version 3.6 or higher is recommended.
- PLECS (Potentially): Needed to run the
.plecssimulation files. - Python Packages: Install the required packages using pip (see instructions below).
-
Clone the repository:
git clone https://github.com/aliasofsyn/Ai_PowerElectronics.git cd Ai_PowerElectronics -
Install Python dependencies:
You can use the
requirements.txtfile to install the necessary packages:pip install -r requirements.txt
Alternatively, if you've made changes to the package list, you can regenerate
requirements.txtand then install using the same command. To regenerate, you can runparse_imports.pyif the notebook names have remained the same. -
PLECS Setup (if applicable):
If you intend to run the PLECS simulations (
.plecsfiles), ensure you have PLECS software installed and configured correctly. Refer to the PLECS documentation for installation instructions.
To run the Jupyter Notebooks (.ipynb files):
-
Start a Jupyter Notebook server:
jupyter notebook
-
Navigate to the directory containing the notebooks and open the desired notebook (e.g.,
Time-series challenge.ipynb). -
Run the cells in the notebook to execute the code.
Open the .plecs files (e.g., Buck_sample1.plecs) in the PLECS software to view and run the simulations.
import json
import re
with open("package_install.ipynb", 'r', encoding='utf-8') as f:
notebook = json.load(f)
imports = set()
pattern = re.compile(r'^\s*(?:import|from)\s+([a-zA-Z_][\w\.]*)')
for cell in notebook['cells']:
if cell['cell_type'] == 'code':
for line in cell['source']:
match = pattern.match(line)
if match:
root_pkg = match.group(1).split('.')[0]
imports.add(root_pkg)
with open("requirements.txt", "w") as f:
for package in sorted(imports):
f.write(f"{package}\n")This script parses a Jupyter Notebook file, extracts all import statements, and writes the unique package names to a requirements.txt file.
The configuration options depend on the specific notebook or script you are using. Check the individual files for configurable parameters. For example, within the Jupyter Notebooks, parameters for model training or simulation settings can typically be adjusted.
We welcome contributions to this project! To contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with descriptive commit messages.
- Push your changes to your forked repository.
- Submit a pull request to the main repository.
License information is not explicitly specified in the repository details. Please contact the repository owner to clarify the licensing terms. Assuming no explicit license, all rights are reserved.
- We would like to acknowledge the developers of the Python packages listed in
requirements.txtfor their valuable contributions to the open-source community.