Skip to main content

Several small functions for classroom instruction.

Project description

Classroom Gizmos

This is a collection of functions for classroom instruction in introductory physics.

handies

classroom_gizmos.handies is a collection of small functions that are useful from an ipython prompt. the mine() function lists all the user functions defined in handies.py

handies defines:

    nowMJD(); mjd2date(), date2mjd()     cdbn(); cdWD(), cdpy1d(),     osname(), hostname(), call(), select_file( timeout=65)     rad(), deg(), sinD(), cosD(), tanD(), asinD(),     acosD(), atanD(), atan2D(), atan2P()           'D' and 'P' functions work with degrees.           'P' inverse functions return only positive angles. Defines nCr AKA comb or imports from math if available.     greek ➞ string with greek alphabet.     pltsize( w, h) ➞ resizes plots in matplotlib, units are inches     select_file() ➞ uses file browser to select a file.     mine() ➞ lists what handies.py defines. From math imports:     pi, sqrt, degrees, radians,     cos, sin, tan, atan2, asin, acos, atan, and     log, log10, exp From astropy units as "u", i.e. u.cm or u.GHz

import_install

This function tries to import a specified package and if that fails, it tries to install the package and then import it. import_install was written so that python programs can be distributed to students without detailed instructions on checking and installing the needed packages. This capability seems especially important for using Google's Colab which deletes installed packages after a short period of non-use.

Warning: import_install can not install all packages. It is less likely to install a package that is not pure python.

All functions should have doc strings that give more information about usage and parameters.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

classroom_gizmos-0.0b1.dev5.tar.gz (8.5 kB view hashes)

Uploaded Source

Built Distribution

classroom_gizmos-0.0b1.dev5-py3-none-any.whl (22.0 kB view hashes)

Uploaded Python 3

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