toyplot.require module

Functions used by the Toyplot implementation to validate inputs. These are not intended for end-users.

toyplot.require.filename(value)[source]

Raise an exception if a value isn’t a valid string filename, or None.

Raise an exception if a value isn’t a valid string hyperlink, or None.

toyplot.require.instance(value, types)[source]

Raise an exception if a value isn’t one of the given type(s).

toyplot.require.integer_vector(value, length=None, min_length=None, modulus=None)[source]

Raise an exception if a value isn’t convertable to a 1D array of integers.

toyplot.require.optional_string(value)[source]

Raise an exception if a value isn’t a string, or None.

toyplot.require.scalar(value)[source]

Raise an exception if a value isn’t a number.

toyplot.require.scalar_array(value)[source]

Raise an exception if a value isn’t convertable to an array of numbers.

toyplot.require.scalar_matrix(value, rows=None, columns=None)[source]

Raise an exception if a value isn’t convertable to a 2D array of numbers.

toyplot.require.scalar_vector(value, length=None, min_length=None, modulus=None)[source]

Raise an exception if a value isn’t convertable to a 1D array of numbers.

toyplot.require.string_vector(value, length=None, min_length=None, modulus=None)[source]

Raise an exception if a value isn’t convertable to a 1D array of numbers.

toyplot.require.table_keys(table, keys, length=None, min_length=None, modulus=None)[source]

Raise an exception if any of the given keys fails to match the column keys in the given table.

toyplot.require.value_in(value, choices)[source]

Raise an exception if a value doesn’t match one of the given choices.

toyplot.require.vector(value, length=None, min_length=None, modulus=None)[source]

Raise an exception if a value isn’t convertable to a 1D array.