diffinytrace 2.1__tar.gz → 2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. diffinytrace-2.2/PKG-INFO +125 -0
  2. {diffinytrace-2.1 → diffinytrace-2.2}/README.md +1 -1
  3. diffinytrace-2.2/diffinytrace.egg-info/PKG-INFO +125 -0
  4. {diffinytrace-2.1 → diffinytrace-2.2}/setup.py +6 -1
  5. diffinytrace-2.1/PKG-INFO +0 -26
  6. diffinytrace-2.1/diffinytrace.egg-info/PKG-INFO +0 -26
  7. {diffinytrace-2.1 → diffinytrace-2.2}/LICENSE +0 -0
  8. {diffinytrace-2.1 → diffinytrace-2.2}/MANIFEST.in +0 -0
  9. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/__init__.py +0 -0
  10. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/basis_functions/__init__.py +0 -0
  11. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/basis_functions/bspline.py +0 -0
  12. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/basis_functions/chebyshev.py +0 -0
  13. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/basis_functions/legendre.py +0 -0
  14. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/basis_functions/zernike.py +0 -0
  15. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/config.py +0 -0
  16. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/constraints.py +0 -0
  17. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/element.py +0 -0
  18. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/export/__init__.py +0 -0
  19. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/export/cad.py +0 -0
  20. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/gaussian_smoother.py +0 -0
  21. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/hat_smoother.py +0 -0
  22. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/integrators.py +0 -0
  23. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/intersection.py +0 -0
  24. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/optimize.py +0 -0
  25. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/physical_object.py +0 -0
  26. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/plotting/__init__.py +0 -0
  27. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/plotting/core.py +0 -0
  28. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/plotting/quantity2D.py +0 -0
  29. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/plotting/system2D.py +0 -0
  30. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/plotting/system3D.py +0 -0
  31. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/plotting/wavelength.py +0 -0
  32. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/refractive_index.py +0 -0
  33. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/render.py +0 -0
  34. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/source.py +0 -0
  35. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/spectrum.py +0 -0
  36. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/surface.py +0 -0
  37. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/target_grid.py +0 -0
  38. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/transforms.py +0 -0
  39. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/utils/__init__.py +0 -0
  40. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/utils/autograd.py +0 -0
  41. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace/utils/irradiance_importer.py +0 -0
  42. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace.egg-info/SOURCES.txt +0 -0
  43. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace.egg-info/dependency_links.txt +0 -0
  44. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace.egg-info/requires.txt +0 -0
  45. {diffinytrace-2.1 → diffinytrace-2.2}/diffinytrace.egg-info/top_level.txt +0 -0
  46. {diffinytrace-2.1 → diffinytrace-2.2}/requirements.txt +0 -0
  47. {diffinytrace-2.1 → diffinytrace-2.2}/setup.cfg +0 -0
@@ -0,0 +1,125 @@
1
+ Metadata-Version: 2.4
2
+ Name: diffinytrace
3
+ Version: 2.2
4
+ Author: Martin Pflaum
5
+ Author-email: contact@martinpflaum.com
6
+ Requires-Python: ==3.12
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: colour-science==0.4.7
10
+ Requires-Dist: matplotlib==3.10.8
11
+ Requires-Dist: numpy==2.3.5
12
+ Requires-Dist: pandas==3.0.1
13
+ Requires-Dist: Pillow==12.0.0
14
+ Requires-Dist: plotly==6.6.0
15
+ Requires-Dist: pvlib==0.15.0
16
+ Requires-Dist: scikit_learn==1.8.0
17
+ Requires-Dist: scipy==1.17.1
18
+ Requires-Dist: tqdm==4.67.3
19
+ Requires-Dist: nbformat==5.1.3
20
+ Requires-Dist: ipykernel==7.2.0
21
+ Requires-Dist: cadquery==2.7.0
22
+ Requires-Dist: torchmetrics==1.9.0
23
+ Dynamic: author
24
+ Dynamic: author-email
25
+ Dynamic: description
26
+ Dynamic: description-content-type
27
+ Dynamic: license-file
28
+ Dynamic: requires-dist
29
+ Dynamic: requires-python
30
+
31
+ # DiffinyTrace
32
+
33
+ **DiffinyTrace** is a Python library for differentiable ray tracing and optical system optimization using PyTorch. It enables automatic differentiation through optical systems, making it possible to optimize lens designs, mirror configurations, and other optical components using gradient-based methods.
34
+
35
+ The source code is available at the [GitHub repository](https://github.com/martinpflaum/diffinytrace).
36
+
37
+ ## Key Features
38
+
39
+ <div align="center">
40
+ <img src="docs/_static/system_3D_plot.png" width="60%" alt="Transformation example">
41
+ <p><strong>Flexible Transformations</strong> — apply general transformations such as rotations and translations to optical components, with full control over the parameters and their role in the transformation.</p>
42
+ </div>
43
+
44
+ <div align="center">
45
+ <img src="docs/_static/cad_export.png" width="40%" alt="CAD export example">
46
+ <p><strong>Seamless CAD Export</strong> — generate lenses and mirrors that can be exported to standard CAD file formats.</p>
47
+ </div>
48
+
49
+ <div align="center">
50
+ <img src="docs/_static/bspline_plot1.png" width="80%" alt="B-spline surface example">
51
+ <p><strong>Freeform Surfaces</strong> — design complex optical elements with advanced B-spline representations for maximum flexibility.</p>
52
+ </div>
53
+
54
+ * **Differentiable Ray Tracing**: Full automatic differentiation support through optical systems
55
+ * **Constraint Optimization**: Advanced optimization with PyTorch and SciPy integration
56
+ * **Illumination Design**: Algorithms for computing lens surfaces to achieve desired illumination profiles
57
+ * **GPU Acceleration**: CUDA support for high-performance computations
58
+
59
+ ## Installation
60
+
61
+ 1. **Create a new Enviroment** via conda:
62
+ ```bash
63
+ conda create -n dit python==3.12
64
+ ```
65
+ activate enviroment via
66
+ ```bash
67
+ conda activate dit
68
+ ```
69
+ install pip
70
+ ```bash
71
+ conda install pip
72
+ ```
73
+
74
+
75
+ 2. **Install PyTorch**
76
+
77
+ Check your cuda version with
78
+ ```bash
79
+ nvcc --version
80
+ ```
81
+
82
+ Diffinytrace only has been tested with 2.10.0+cu130. Make sure to install the appropriate version of PyTorch for your system. You can find the installation instructions on the [PyTorch website](https://pytorch.org/get-started/locally/). DiffinyTrace should work for both cpu and cuda versions.
83
+
84
+ 3. **Install DiffinyTrace**
85
+ Install all other dependencies and the library itself via:
86
+ ```bash
87
+ pip install diffinytrace
88
+ ```
89
+ or directly in the folder via
90
+ ```bash
91
+ pip install -r requirements.txt
92
+ ```
93
+
94
+
95
+ ## Basic Usage Example
96
+
97
+ ```python
98
+ import diffinytrace as dit
99
+ import torch
100
+ NBK7 = dit.materials["NBK7"]
101
+
102
+ wave_len = 1.024
103
+ light_transform = dit.transforms.Offset(torch.tensor([0.0,0.0,0.0]))
104
+ source = dit.source.CollimatedMonochromatic(light_transform,8.0,wave_len)
105
+
106
+ plane_surface = dit.Plane()
107
+ surface2 = dit.Aspheric(-1/50.)
108
+ transf1 = dit.transforms.Distance(10.0,parent_transform=source)
109
+ lens1 = dit.Lens(transf1,5.,plane_surface,surface2,NBK7,13.0)
110
+ transf2 = dit.transforms.Distance(15.0,parent_transform=lens1)
111
+ detector = dit.Detector(transf2,plane_surface,8.0)
112
+ system = dit.SequentialOpticalSystem({"source":source, "lens":lens1, "detector":detector})
113
+
114
+ x,weights = source.sample(10)
115
+ O,D,wave_len,_,meta_data = system(x,["source","lens","detector"])
116
+ dit.plotting.system2D.plot(system,meta_data)
117
+ ```
118
+
119
+ ## Documentation
120
+
121
+ For comprehensive documentation, tutorials, and API reference, visit the [full documentation](https://diffinytrace.readthedocs.io/en/latest/index.html).
122
+
123
+ ## License
124
+
125
+ DiffinyTrace is licensed under the MIT License. See the repository for full license details.
@@ -54,7 +54,7 @@ The source code is available at the [GitHub repository](https://github.com/marti
54
54
  3. **Install DiffinyTrace**
55
55
  Install all other dependencies and the library itself via:
56
56
  ```bash
57
- no pip package yet
57
+ pip install diffinytrace
58
58
  ```
59
59
  or directly in the folder via
60
60
  ```bash
@@ -0,0 +1,125 @@
1
+ Metadata-Version: 2.4
2
+ Name: diffinytrace
3
+ Version: 2.2
4
+ Author: Martin Pflaum
5
+ Author-email: contact@martinpflaum.com
6
+ Requires-Python: ==3.12
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: colour-science==0.4.7
10
+ Requires-Dist: matplotlib==3.10.8
11
+ Requires-Dist: numpy==2.3.5
12
+ Requires-Dist: pandas==3.0.1
13
+ Requires-Dist: Pillow==12.0.0
14
+ Requires-Dist: plotly==6.6.0
15
+ Requires-Dist: pvlib==0.15.0
16
+ Requires-Dist: scikit_learn==1.8.0
17
+ Requires-Dist: scipy==1.17.1
18
+ Requires-Dist: tqdm==4.67.3
19
+ Requires-Dist: nbformat==5.1.3
20
+ Requires-Dist: ipykernel==7.2.0
21
+ Requires-Dist: cadquery==2.7.0
22
+ Requires-Dist: torchmetrics==1.9.0
23
+ Dynamic: author
24
+ Dynamic: author-email
25
+ Dynamic: description
26
+ Dynamic: description-content-type
27
+ Dynamic: license-file
28
+ Dynamic: requires-dist
29
+ Dynamic: requires-python
30
+
31
+ # DiffinyTrace
32
+
33
+ **DiffinyTrace** is a Python library for differentiable ray tracing and optical system optimization using PyTorch. It enables automatic differentiation through optical systems, making it possible to optimize lens designs, mirror configurations, and other optical components using gradient-based methods.
34
+
35
+ The source code is available at the [GitHub repository](https://github.com/martinpflaum/diffinytrace).
36
+
37
+ ## Key Features
38
+
39
+ <div align="center">
40
+ <img src="docs/_static/system_3D_plot.png" width="60%" alt="Transformation example">
41
+ <p><strong>Flexible Transformations</strong> — apply general transformations such as rotations and translations to optical components, with full control over the parameters and their role in the transformation.</p>
42
+ </div>
43
+
44
+ <div align="center">
45
+ <img src="docs/_static/cad_export.png" width="40%" alt="CAD export example">
46
+ <p><strong>Seamless CAD Export</strong> — generate lenses and mirrors that can be exported to standard CAD file formats.</p>
47
+ </div>
48
+
49
+ <div align="center">
50
+ <img src="docs/_static/bspline_plot1.png" width="80%" alt="B-spline surface example">
51
+ <p><strong>Freeform Surfaces</strong> — design complex optical elements with advanced B-spline representations for maximum flexibility.</p>
52
+ </div>
53
+
54
+ * **Differentiable Ray Tracing**: Full automatic differentiation support through optical systems
55
+ * **Constraint Optimization**: Advanced optimization with PyTorch and SciPy integration
56
+ * **Illumination Design**: Algorithms for computing lens surfaces to achieve desired illumination profiles
57
+ * **GPU Acceleration**: CUDA support for high-performance computations
58
+
59
+ ## Installation
60
+
61
+ 1. **Create a new Enviroment** via conda:
62
+ ```bash
63
+ conda create -n dit python==3.12
64
+ ```
65
+ activate enviroment via
66
+ ```bash
67
+ conda activate dit
68
+ ```
69
+ install pip
70
+ ```bash
71
+ conda install pip
72
+ ```
73
+
74
+
75
+ 2. **Install PyTorch**
76
+
77
+ Check your cuda version with
78
+ ```bash
79
+ nvcc --version
80
+ ```
81
+
82
+ Diffinytrace only has been tested with 2.10.0+cu130. Make sure to install the appropriate version of PyTorch for your system. You can find the installation instructions on the [PyTorch website](https://pytorch.org/get-started/locally/). DiffinyTrace should work for both cpu and cuda versions.
83
+
84
+ 3. **Install DiffinyTrace**
85
+ Install all other dependencies and the library itself via:
86
+ ```bash
87
+ pip install diffinytrace
88
+ ```
89
+ or directly in the folder via
90
+ ```bash
91
+ pip install -r requirements.txt
92
+ ```
93
+
94
+
95
+ ## Basic Usage Example
96
+
97
+ ```python
98
+ import diffinytrace as dit
99
+ import torch
100
+ NBK7 = dit.materials["NBK7"]
101
+
102
+ wave_len = 1.024
103
+ light_transform = dit.transforms.Offset(torch.tensor([0.0,0.0,0.0]))
104
+ source = dit.source.CollimatedMonochromatic(light_transform,8.0,wave_len)
105
+
106
+ plane_surface = dit.Plane()
107
+ surface2 = dit.Aspheric(-1/50.)
108
+ transf1 = dit.transforms.Distance(10.0,parent_transform=source)
109
+ lens1 = dit.Lens(transf1,5.,plane_surface,surface2,NBK7,13.0)
110
+ transf2 = dit.transforms.Distance(15.0,parent_transform=lens1)
111
+ detector = dit.Detector(transf2,plane_surface,8.0)
112
+ system = dit.SequentialOpticalSystem({"source":source, "lens":lens1, "detector":detector})
113
+
114
+ x,weights = source.sample(10)
115
+ O,D,wave_len,_,meta_data = system(x,["source","lens","detector"])
116
+ dit.plotting.system2D.plot(system,meta_data)
117
+ ```
118
+
119
+ ## Documentation
120
+
121
+ For comprehensive documentation, tutorials, and API reference, visit the [full documentation](https://diffinytrace.readthedocs.io/en/latest/index.html).
122
+
123
+ ## License
124
+
125
+ DiffinyTrace is licensed under the MIT License. See the repository for full license details.
@@ -6,11 +6,16 @@ here = os.path.dirname(os.path.abspath(__file__))
6
6
  with open(os.path.join(here, 'requirements.txt')) as f:
7
7
  install_requires = f.read().splitlines()
8
8
 
9
+ with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
10
+ long_description = f.read()
11
+
9
12
  setup(
10
13
  name='diffinytrace', # Package name
11
- version='2.1', # Version number
14
+ version='2.2', # Version number
12
15
  packages=find_packages(), # Automatically find packages in the directory
13
16
  install_requires=install_requires,
17
+ long_description=long_description,
18
+ long_description_content_type='text/markdown',
14
19
  author='Martin Pflaum',
15
20
  author_email='contact@martinpflaum.com',
16
21
  classifiers=[],
diffinytrace-2.1/PKG-INFO DELETED
@@ -1,26 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: diffinytrace
3
- Version: 2.1
4
- Author: Martin Pflaum
5
- Author-email: contact@martinpflaum.com
6
- Requires-Python: ==3.12
7
- License-File: LICENSE
8
- Requires-Dist: colour-science==0.4.7
9
- Requires-Dist: matplotlib==3.10.8
10
- Requires-Dist: numpy==2.3.5
11
- Requires-Dist: pandas==3.0.1
12
- Requires-Dist: Pillow==12.0.0
13
- Requires-Dist: plotly==6.6.0
14
- Requires-Dist: pvlib==0.15.0
15
- Requires-Dist: scikit_learn==1.8.0
16
- Requires-Dist: scipy==1.17.1
17
- Requires-Dist: tqdm==4.67.3
18
- Requires-Dist: nbformat==5.1.3
19
- Requires-Dist: ipykernel==7.2.0
20
- Requires-Dist: cadquery==2.7.0
21
- Requires-Dist: torchmetrics==1.9.0
22
- Dynamic: author
23
- Dynamic: author-email
24
- Dynamic: license-file
25
- Dynamic: requires-dist
26
- Dynamic: requires-python
@@ -1,26 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: diffinytrace
3
- Version: 2.1
4
- Author: Martin Pflaum
5
- Author-email: contact@martinpflaum.com
6
- Requires-Python: ==3.12
7
- License-File: LICENSE
8
- Requires-Dist: colour-science==0.4.7
9
- Requires-Dist: matplotlib==3.10.8
10
- Requires-Dist: numpy==2.3.5
11
- Requires-Dist: pandas==3.0.1
12
- Requires-Dist: Pillow==12.0.0
13
- Requires-Dist: plotly==6.6.0
14
- Requires-Dist: pvlib==0.15.0
15
- Requires-Dist: scikit_learn==1.8.0
16
- Requires-Dist: scipy==1.17.1
17
- Requires-Dist: tqdm==4.67.3
18
- Requires-Dist: nbformat==5.1.3
19
- Requires-Dist: ipykernel==7.2.0
20
- Requires-Dist: cadquery==2.7.0
21
- Requires-Dist: torchmetrics==1.9.0
22
- Dynamic: author
23
- Dynamic: author-email
24
- Dynamic: license-file
25
- Dynamic: requires-dist
26
- Dynamic: requires-python
File without changes
File without changes
File without changes
File without changes