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.
Note: Imports from astropy
The mine() function lists all the user functions defined in handies.py.

handies defines:

nowMJD(); mjd2date(), date2mjd(), cdbn(), osname(),
hostname(), call(), rad(), deg(), sinD(), cosD(), tanD(),
asinD(), acosD(), atanD(), atan2D(), atan2P(), nCr(), comb(),
pltsize(), select_file(), select_file_timeout(),
mine()

Trig Functions in Degrees
    'D' and 'P' trig functions work with degrees.
    'P' inverse functions return only positive angles.

greek âžž string with greek alphabet.
pltsize( w, h, dpi=150) âžž resizes plots in matplotlib.
select_file() âžž file browser to select a file.
select_file_timeout( seconds) âžž file browser with timeout
   in seconds. Uses func_timeout package which
   will usually be installed if not already installed.
mine() âžž lists what handies.py defines.

From math imports:

pi, sqrt, cos, sin, tan, acos, asin, atan, atan2, degrees, radians, log, log10, exp

From astropy

astropy.units as "u", i.e. u.cm or u.GHz

classroom_gizmos.import_install.importInstall()

pkg = importInstall( 'pkg_name')
OR
pkg = importInstall( 'pkg_name, 'PyPI_name')

This function tries to import a specified package and if that fails, it tries to install the package and then import it.
importInstall was written so that python programs can be distributed to students without detailed instructions on checking if package is installed and on installing the needed packages.
The function returns the package or None.

Warning: importInstall 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.dev11.tar.gz (9.7 kB view hashes)

Uploaded Source

Built Distribution

classroom_gizmos-0.0b1.dev11-py3-none-any.whl (22.6 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