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
DataObjclass 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 nestedDataObjclasses. When the json is parsed during import, structures that who's keys include the suffix "_do" are converted toDataObjclasses in a recursive pattern. -
DataObjclasses 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
prinfofunctions 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"
Metadata
Release files for snsphd 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| snsphd-0.2.5.tar.gz | 20.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| snsphd-0.2.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.9 kB
Release files / snsphd-0.2.5.tar.gz
| Download URL | snsphd-0.2.5.tar.gz |
|---|---|
| Size | 20.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
490b59ae5f2590bdc0cb2db599f2e0cb846c4b3276ca7adf32e6a9fbdfa0d0c1
|
|
BLAKE2b-256 checksum How to use checksums |
7ef1c151b814986906e85acb0d9b9e5eb322b41df7a6430d660179b0962c4d8c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2025.
Transparency logRelease files / snsphd-0.2.5-py3-none-any.whl
| Download URL | snsphd-0.2.5-py3-none-any.whl |
|---|---|
| Size | 21.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0e354c273d36ec8946f89fc9657fd37cd8fcce2618ecca10027e597ce622ace6
|
|
BLAKE2b-256 checksum How to use checksums |
43a7162321367a07c2632c838651e35b99de8b11da04df5f0ca646148f1bb7b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2025.
Transparency log