You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a python package of utility and styling functions used for:
10
9
11
10
<h3style="text-align: center; color: lightblue;"><em>Optimization Techniques for Single Photon Detection and Quantum Optics</em></h3>
12
11
13
-
14
12
<h5style="text-align: center; white-space: pre-line;">A Thesis by
15
13
Andrew Mueller</h5>
16
14
17
15
<h5style="text-align: center; white-space: pre-line;">In Partial Fulfillment of the Requirements for the
18
16
Degree of Doctor of Philosophy in Applied Physics</h5>
19
17
20
-
21
18
This packages is made of 6 parts:
22
19
23
20
## viz
24
-
- Styling related functions and presets. This is used to give matplotlib and bokeh plots a custom style as seen in the thesis.
21
+
22
+
- Styling related functions and presets. This is used to give matplotlib and bokeh plots a custom style as seen in the thesis.
25
23
- the `viz.save_light_dark_all()` function is used to save light-mode and dark-mode compatible figures, as well as a .pdf version of use in latex documents. It does not change color properties via rcParams, and therefore does not require changes to code before or involved with the initialization of a figure. `viz.save_light_dark_all()` just has to run at the end of a script or notebook cell, the same way `plt.savefig()` would be used. It traverses the figure DOM and modifies styling of a number of elements including lines, errorbars, legends, `imshow()` images, and other things.
- Includes the `DataObj` class used for exporting and importing python classes as structured json files. Objects containing numpy arrays are exported using `orjson`, and re-cast into numpy arrays on import. The library follows some basic rules in order to determine what sub-objects should be converted to numpy arrays during import. Complex arrays may not import correctly. The library supports export and import of nested `DataObj` classes. When the json is parsed during import, structures that who's keys include the suffix "_do" are converted to `DataObj` classes in a recursive pattern.
32
29
33
-
-`DataObj` classes are not supported by a rigid schema, which has advantages and disadvantages. The use of the "_do" suffix could lead to unwanted name-collision behavior, and the import process may fail on certain types of nested arrays, especially those that contain datatypes that cannot be converted to numpy arrays.
30
+
-Includes the `DataObj`class used for exporting and importing python classes as structured json files. Objects containing numpy arrays are exported using `orjson`, and re-cast into numpy arrays on import. The library follows some basic rules in order to determine what sub-objects should be converted to numpy arrays during import. Complex arrays may not import correctly. The library supports export and import of nested `DataObj` classes. When the json is parsed during import, structures that who's keys include the suffix "\_do" are converted to `DataObj` classes in a recursive pattern.
34
31
35
-
-For more rigid control of datatypes and object schema, a library like [pydantic](https://docs.pydantic.dev/latest/) in concert with [datamodel code generator](https://github.com/koxudaxi/datamodel-code-generator)may be more useful.
32
+
-`DataObj` classes are not supported by a rigid schema, which has advantages and disadvantages. The use of the "\_do" suffix could lead to unwanted name-collision behavior, and the import process may fail on certain types of nested arrays, especially those that contain datatypes that cannot be converted to numpy arrays.
36
33
34
+
- For more rigid control of datatypes and object schema, a library like [pydantic](https://docs.pydantic.dev/latest/) in concert with [datamodel code generator](https://github.com/koxudaxi/datamodel-code-generator) may be more useful.
37
35
38
36
## layout
39
-
- Contains the `bisect()` function and related utilities that are used to define complex matplotlib figure layouts. More information is included in the main thesis.
37
+
38
+
- Contains the `bisect()` function and related utilities that are used to define complex matplotlib figure layouts. More information is included in the main thesis.
40
39
41
40
## hist
42
-
- A collection of various utilities that help with the analysis of histograms and instrument response functions, like the jitter profile of Superconducting Nanowire Single Photon Detectors. These include tools for fitting histograms to curves, and finding their width at different percentages of maximum height.
41
+
42
+
- A collection of various utilities that help with the analysis of histograms and instrument response functions, like the jitter profile of Superconducting Nanowire Single Photon Detectors. These include tools for fitting histograms to curves, and finding their width at different percentages of maximum height.
43
43
44
44
## help
45
+
45
46
- Various utility functions of general usefulness. The `prinfo` functions is handy for easy debugging:
46
47
47
48
```python
48
49
my_variable =3
49
50
my_other_variable ="hello"
50
51
prinfo(my_variable, my_other_variable)
51
52
```
53
+
52
54
prints:
53
55
54
-
my_variable = 3,
56
+
my_variable = 3,
55
57
my_other_variable = "hello"
56
-
57
-
## clock
58
-
- Contains various versions of numba-accelerated clock analysis functions. These apply phase locked loops to a series of clock time measurements in order to cancel clock jitter.
0 commit comments