Utility and styling functions for A. Mueller's phd thesis
Project description
This is a python package of utility and styling functions used for:
Optimization Techniques for Single Photon Detection and Quantum Optics
A Thesis by Andrew Mueller
In Partial Fulfillment of the Requirements for the Degree of Doctor of Philosophy in Applied Physics
This packages is made of 6 parts:
viz
- Styling related functions and presets. This is used to give matplotlib and bokeh plots a custom style as seen in the thesis.
- 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 wayplt.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.
obj
-
Includes the
DataObj
class used for exporting and importing python classes as structured json files. Objects containing numpy arrays are exported usingorjson
, 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 nestedDataObj
classes. When the json is parsed during import, structures that who's keys include the suffix "_do" are converted toDataObj
classes in a recursive pattern. -
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. -
For more rigid control of datatypes and object schema, a library like pydantic in concert with datamodel code generator may be more useful.
layout
- Contains the
bisect()
function and related utilities that are used to define complex matplotlib figure layouts. More information is included in the main thesis.
hist
- 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.
help
- Various utility functions of general usefulness. The
prinfo
functions is handy for easy debugging:
my_variable = 3
my_other_variable = "hello"
prinfo(my_variable, my_other_variable)
prints:
my_variable = 3,
my_other_variable = "hello"
clock
- 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.
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
Built Distribution
File details
Details for the file snsphd-0.1.3.tar.gz
.
File metadata
- Download URL: snsphd-0.1.3.tar.gz
- Upload date:
- Size: 24.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/23.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2623a2a11423da54e04f300def7793cdb9d97ec3581c0c8a7f4271fb279480c6 |
|
MD5 | 0889f8bebe650857a9ab919c34f7120a |
|
BLAKE2b-256 | f53debc8a9bcb648f89637d8ecb5ef3d7159caf9acdf1c47e403b25f7609d55f |
File details
Details for the file snsphd-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: snsphd-0.1.3-py3-none-any.whl
- Upload date:
- Size: 24.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/23.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5e7f6b48dd1393a613e7f7ae2bb6b75bb696c0649927dcaae35582c1ad96b06 |
|
MD5 | eeff808c5cd4429ef1c31719fb41bc3e |
|
BLAKE2b-256 | 2b657fd3eca840f3dd490f0cbbb2a71d60df3516ca887cf6133324413b600d81 |