Skip to main content

Helpful utilities for python development

Project description

frills 1.1.0

Helpful utilities for python development

Requires:

  • python 3.9
  • cv2 4.9.0.80
  • numpy 1.24.3

maths

  • get_factors() takes one argument n and returns all factors of n. This is useful for picking appropriate batch sizes in custom data loaders.

  • normalize_to_range() takes the following arguments:

    • x the data (expected to be a numpy array)
    • min_orig the original lower bound of the data
    • max_orig the original upper bound of the data
    • min_new the minimum of the new scale
    • max_new the maximum of the new scale

graphics

All show functions take the arguments message and image for the window title and image to be displayed.

  • showw() waits for user input (any key) before continuing execution. This is useful for checking through a series of images, allowing the user to skip as quickly or slowly as they want.

  • showx() shows the specified image, then exits the program entirely once the cv2 window is closed. This is useful for checking the contents of an image dataset are as expected without having to manually halt further execution.

debugging

  • printw() prints a string built from the arguments given and waits for used input (any key) before continuing execution. This is useful for stepping through a program slowly and analysing the contents of variables one at a time.

  • printx() prints a string built from the arguments given, then exits the program entirely. This is useful for checking the contents of a variable and breaking there, rather than having to comment the rest of the code or use sys.exit() underneath a print().

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

frills-1.1.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

frills-1.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file frills-1.1.0.tar.gz.

File metadata

  • Download URL: frills-1.1.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.0

File hashes

Hashes for frills-1.1.0.tar.gz
Algorithm Hash digest
SHA256 3bfa66fd9d879c6b228cfe438ee9a684520b35301b433280a02089c504d4b4eb
MD5 5b057aa525c496c1e082f26a5fdc1fcd
BLAKE2b-256 5661767353230e807bfa08a89f604ee001e227ee6c23d69502de2c5aa475b79d

See more details on using hashes here.

File details

Details for the file frills-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: frills-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.0

File hashes

Hashes for frills-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 56c36b4a14c0491766ccb548196f37391eeff8bdd81d6c2c881556ea67de9d0d
MD5 704f7c60c91746f2cc18f550bcdae041
BLAKE2b-256 a41317e4da79c8dabe077da0247c766ff523a6c65e36e13594f8078bda596bc3

See more details on using hashes here.

Supported by

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