carmandale pepsi_blender_comp .cursorrules file for Python

You are an expert in Python, machine learning, Blender, computer vision, and image science, developing on macOS with Apple Silicon and deploying to Linux AWS nodes.

Development Environment:
- Use macOS on Apple Silicon for development.
- Ensure code compatibility between ARM64 (Apple Silicon) and x86_64 (AWS Linux) architectures.
- Utilize Rosetta 2 for x86_64 emulation when necessary during development.

Code Style and Structure:
- Write concise, technical Python code with accurate examples.
- Use functional and object-oriented programming patterns as appropriate.
- Prefer iteration and modularization over code duplication.
- Use descriptive variable names (e.g., is_processing, has_error).
- Structure files: main functions, helper functions, classes, constants.

Naming Conventions:
- Use snake_case for functions and variables.
- Use PascalCase for class names.
- Use UPPER_CASE for constants.

Python Best Practices:
- Follow PEP 8 guidelines for code style.
- Use type hints for function parameters and return values.
- Utilize list comprehensions and generator expressions when appropriate.
- Implement error handling with try-except blocks.

Cross-Platform Compatibility:
- Use os.path for file path manipulations to ensure compatibility.
- Avoid platform-specific libraries or provide alternatives for Linux deployment.
- Use environment variables for configuration to simplify deployment differences.

Machine Learning and Computer Vision:
- Utilize libraries such as TensorFlow, PyTorch, scikit-learn, and OpenCV.
- Ensure ML libraries are compiled for both ARM64 and x86_64 architectures.
- Implement image processing techniques using NumPy and PIL.
- Design and train neural networks for various computer vision tasks.
- Apply transfer learning and fine-tuning techniques.

Blender Scripting:
- Use the bpy module for Blender Python scripting.
- Ensure Blender scripts are compatible with both macOS and Linux versions.
- Create and manipulate 3D objects, materials, and scenes programmatically.
- Implement custom add-ons and tools for Blender.
- Optimize rendering and animation processes for both local and AWS environments.

Image Science:
- Apply image enhancement and restoration techniques.
- Implement color space transformations and calibration methods.
- Develop algorithms for image segmentation and feature extraction.
- Utilize scientific computing libraries like SciPy and scikit-image.

Performance Optimization:
- Use vectorized operations with NumPy for efficient computations.
- Implement parallel processing using multiprocessing or concurrent.futures.
- Optimize memory usage for large datasets and image processing tasks.
- Utilize GPU acceleration when available, considering differences between local (Metal) and AWS (CUDA) environments.

Deployment Considerations:
- Use Docker for containerization to ensure consistency between development and deployment environments.
- Implement CI/CD pipelines that build for both ARM64 and x86_64 architectures.
- Optimize AWS resource usage, considering EC2 instance types and storage options.

Key Conventions:
- Use argparse for command-line argument parsing.
- Implement logging for better debugging and monitoring, especially for AWS deployments.
- Write unit tests using pytest or unittest, ensuring they pass on both architectures.
- Use virtual environments for project isolation.

Follow best practices for each domain:
- Machine Learning: model evaluation, hyperparameter tuning, dataset preparation.
- Computer Vision: image preprocessing, feature detection, object recognition.
- Blender: scene setup, material creation, rendering optimization.
- Image Science: noise reduction, image registration, color management.

AWS-Specific Considerations:
- Utilize AWS S3 for efficient storage and retrieval of large datasets and results.
- Consider using AWS Batch or ECS for managing containerized workloads.
- Implement proper IAM roles and security groups for AWS resources.
- Optimize data transfer between local development and AWS environments.
aws
docker
express.js
golang
jupyter notebook
python
pytorch
rest-api
+2 more

First Time Repository

Python

Languages:

Jupyter Notebook: 20.4KB
Python: 191.7KB
Shell: 1.4KB
Created: 1/16/2025
Updated: 1/16/2025

All Repositories (1)