一个为 PyTorch 项目设计的直观的配置管理库。它通过简单的 YAML 文件实现层级化配置,支持 TEST, DEV, PROD 等多种运行模式,并可通过类继承方便地扩展。让管理不同环境和实验的配置变得轻松。 (注意:作为库使用时,请确保运行目录下存在 `temp/mode.txt` 文件和包含 YAML 文件的 `config` 目录以符合当前加载逻辑)。
Project description
Project Setup and Usage Guide
Environment Setup
This project uses the following environment:
- Micromamba as package manager
- Python 3.13
- PyTorch 2.6.0
- PyTorch Lightning
You can use setup.ps1 to install all required dependencies.
Mode Configuration
The project supports different running modes:
- Default mode: test
- Available modes: test, dev, prod
To change the mode, use the following command:
.\set_mode.ps1 -Mode [mode_name]
Example:
.\set_mode.ps1 -Mode prod
.\set_mode.ps1 -Mode dev
.\set_mode.ps1 -Mode test
Running and Debugging
The project is configured for both running and debugging in VS Code:
- Use the right-click context menu in the editor
- Select "Run Python File" to execute the current file
- Debug configurations are available in
.vscodesettings
Environment Information
The project includes an environment information script (src/env.py) that displays:
- Python version
- PyTorch version
- CUDA version and device information (if available)
- Python executable path
To run the environment check:
D:/dev/mamba/envs/pytorch/python.exe src/env.py
Temporary Files
When creating temporary files:
- All temporary files must be created in the
tempdirectory - The
tempdirectory is ignored by git (configured in.gitignore) - This rule applies to all AI-assisted code generation and temporary file creation
Unit Testing
The project includes a sample test file (tests/add_test.py) that demonstrates basic unittest setup and structure. Here's how to work with unit tests:
Running Tests
You can run tests in several ways:
-
In Cursor IDE:
- Open the Testing view in the sidebar
- All test files will be automatically discovered
- You can run individual tests or all tests from the Testing view
- When editing a test file (e.g.,
add_test.py), right-click in the editor and select "Run Python File" to run the test
-
In Editor:
- Open the test file (e.g.,
add_test.py) in the editor - Right-click in the editor
- Select "Run Python File"
- The test will run in the terminal
- Open the test file (e.g.,
Test Configuration
- Configure test settings using
Ctrl+Shift+P - Select "Python: Configure Tests"
- Choose "unittest" (not pytest) as the test framework
- Select the
testsfolder - Test files should follow the
*_test.pynaming convention
Example Test Structure
The add_test.py demonstrates:
- Basic unittest setup with
unittest.TestCase - Test case structure with
setUpandtearDownmethods - Simple assertion testing (1+2=3)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iget_config-0.1.0-py3-none-any.whl.
File metadata
- Download URL: iget_config-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b81536afdad710dae1972f374e7cba9e462fc8f94464c4fe029b47eda985198e
|
|
| MD5 |
270732f92a90822e2f82c7a20f5bb202
|
|
| BLAKE2b-256 |
a71c5bfb1ef8d11f67667f03e4126ee3c954812a3ea53321e95cece365d9380e
|