Skip to main content

一个为 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:

  1. Use the right-click context menu in the editor
  2. Select "Run Python File" to execute the current file
  3. Debug configurations are available in .vscode settings

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 temp directory
  • The temp directory 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:

  1. 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
  2. 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

Test Configuration

  1. Configure test settings using Ctrl+Shift+P
  2. Select "Python: Configure Tests"
  3. Choose "unittest" (not pytest) as the test framework
  4. Select the tests folder
  5. Test files should follow the *_test.py naming convention

Example Test Structure

The add_test.py demonstrates:

  • Basic unittest setup with unittest.TestCase
  • Test case structure with setUp and tearDown methods
  • 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 Distribution

iget_config-0.1.2.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iget_config-0.1.2-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file iget_config-0.1.2.tar.gz.

File metadata

  • Download URL: iget_config-0.1.2.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for iget_config-0.1.2.tar.gz
Algorithm Hash digest
SHA256 da2cd63c127d90943fe137b4b084af35d31022668a235b026aaee935cbe7bfeb
MD5 c722d487313ca25db9f8e780ee46c3db
BLAKE2b-256 8ef75010a7d1306de239e45e2b14e788c0905029995fb922288f9c4cbe0f21e4

See more details on using hashes here.

File details

Details for the file iget_config-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: iget_config-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for iget_config-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e23373bf0433875c439149841d6aaa3f5e69531bbd934211dad6a755eef4470e
MD5 2b5c2684d309d9266031611375b02d88
BLAKE2b-256 5d122d1a9f3d803813473a303def4ce3207d22c2917b61ff0f7f14442f20654a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page