Skip to content

Code restructure, decouple optics, sensor, and network#108

Merged
singer-yang merged 11 commits intomainfrom
restructure
Feb 21, 2026
Merged

Code restructure, decouple optics, sensor, and network#108
singer-yang merged 11 commits intomainfrom
restructure

Conversation

@singer-yang
Copy link
Copy Markdown
Collaborator

This pull request reorganizes and modernizes the DeepLens codebase, focusing on modularizing the optics components, improving import structure, and enhancing documentation. The most significant changes include moving all optics-related code into a dedicated optics subpackage, introducing a new configuration module, updating imports throughout the codebase, and rewriting documentation to accurately reflect the new structure.

Key changes:

1. Optics Package Refactor and Modularization

  • All optics classes and utilities (e.g., GeoLens, HybridLens, DiffractiveLens, PSFNetLens, DeepObj) are now located in the deeplens/optics/ subpackage, with a new __init__.py that re-exports major classes for easier imports. (deeplens/optics/__init__.py, deeplens/optics/base.py, [1] [2]
  • The previous deeplens/basics.py is renamed and split into deeplens/optics/base.py (for the DeepObj class) and deeplens/optics/config.py (for configuration constants). (deeplens/optics/base.py, deeplens/optics/config.py, [1] [2]

2. Import and Namespace Cleanup

  • All scripts and modules that previously imported optics components from the root or old locations now import from deeplens.optics or its submodules. This affects demo scripts, the main package __init__.py, and lens classes. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

3. Documentation and Readme Updates

  • The main README.md, deeplens/README.md, and deeplens/optics/README.md are rewritten to describe the new modular structure, clarify the purpose of each subpackage, and provide accurate file and class listings. (README.md, deeplens/README.md, deeplens/optics/README.md, [1] [2] Ff92ebd4L1)

4. Device Initialization Utility

  • A new init_device() function is introduced in deeplens/__init__.py to standardize device selection (CUDA, MPS, or CPU) for DeepLens.

5. GeoLens Package Integration

  • The geolens_pkg helper package is now properly namespaced under deeplens.optics, and all references are updated accordingly. [1] [2]

These changes collectively improve the maintainability, clarity, and usability of the DeepLens codebase.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ singer-yang
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

@singer-yang singer-yang merged commit 2cad54e into main Feb 21, 2026
@singer-yang singer-yang deleted the restructure branch February 22, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants