Skip to main content

Utility and styling functions for A. Mueller's phd thesis

Project description

SNSPHD

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 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.

light_dark

obj

  • 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.

  • 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

snsphd-0.2.2.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snsphd-0.2.2-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file snsphd-0.2.2.tar.gz.

File metadata

  • Download URL: snsphd-0.2.2.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for snsphd-0.2.2.tar.gz
Algorithm Hash digest
SHA256 d48b28fc99985205ce270471b57634277a2e061b56bce86f1b2acfc4e9a293b2
MD5 b67a6076faa8a1473aea11e2e39738f7
BLAKE2b-256 13a81d111baf9d2450ce3bc4c5505196529e5f5e3c17d2b069a0a56d77bc9c43

See more details on using hashes here.

Provenance

The following attestation bundles were made for snsphd-0.2.2.tar.gz:

Publisher: publish_pypi.yml on sansseriff/snsphd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file snsphd-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: snsphd-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for snsphd-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3b056ef79519ba02145f2d34d3661688237a14dc09db2f26434e2b920c56235d
MD5 bf19e65651befa58061c5298d098ee27
BLAKE2b-256 a28f23b84209f1f501dc874d65f6569a929ed26d7838638bdda956c98b15292a

See more details on using hashes here.

Provenance

The following attestation bundles were made for snsphd-0.2.2-py3-none-any.whl:

Publisher: publish_pypi.yml on sansseriff/snsphd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page