viroconwebcontour.validators module

Validators to check e.g. uploaded data or calculated contours.

contour.validators.validate_contour_coordinates(contour_coordinates)[source]

Validates contour coordinates.

They are not allowed to contain NaN or inf.

Parameters:contour_coordinates (list of list of numpy.ndarray,) – The coordinates of the environmental contour. The format is defined by compute_interface.iform() and compute_interface.hdc().
Raises:ValidationError, – If the contour coordinates contain unsupported values like NaN or inf.
contour.validators.validate_csv_upload(value)[source]
Parameters:value (django.core.files.File,) – The file that the user wants to upload.
Raises:ValidationError, – If the file is too large ot does not have the right format.