-
Notifications
You must be signed in to change notification settings - Fork 0
Home
The wiki is a place for sharing examples of the many things PythonQOL makes easier.
(To get started with downloading & using the code, check out the README and/or the PythonQOL repository homepage.)
PythonQOL is intended to tackle the many small and tedious things that can frequently slow you down while coding in Python, and provide simple calls for things the computer "should just know how to do!"
Assists in use of matplotlib.pyplot. The goal of this code is to turn intuitively simple tasks into simple, well-documented, single-function calls that do something sensible by default, and can be customized via optional parameters. Examples include:
- Annotation:
- Colors & Colorbars:
- save your plot without worrying about overwriting an existing file.
- set ylim based on custom-picked xlim and the data shown in the plot.
- plot all variables in a dict() and labeling each plot by keys.
Assists in storing your data via h5py. The goal of this code is to allow for single-line calls to store and read information, without requiring the user to navigate through tiers of directories. The main quality of life improvements from this code are:
- a default save-location for your h5 files saved via this module.
- write data by just choosing a filename (without worrying about folders/paths).
- read data by just choosing a filename (without worrying about folders/paths).
- write or read a dictionary (possibly whose elements are dictionaries) object into/from h5 format.
Assists with other miscellaneous bits of code. Some functions here are just short snippets of code that are quick to reproduce but easy to forget. Other functions perform miscellaneous helpful tasks. Examples include:
- remove one 'layer' from a list of lists.
- list attributes of a class.
- determine if two strings match, allowing for leading and/or trailing asterisks as wildcards.