Moved input files for tests to simulation database.
[gromacs.git] / tests / physicalvalidation / physical_validation / util / error.py
blob5198babca96fe462359ee35bc5a28dcfdf640f74
1 ###########################################################################
2 # #
3 # physical_validation, #
4 # a python package to test the physical validity of MD results #
5 # #
6 # Written by Michael R. Shirts <michael.shirts@colorado.edu> #
7 # Pascal T. Merz <pascal.merz@colorado.edu> #
8 # #
9 # Copyright (C) 2012 University of Virginia #
10 # (C) 2017 University of Colorado Boulder #
11 # #
12 # This library is free software; you can redistribute it and/or #
13 # modify it under the terms of the GNU Lesser General Public #
14 # License as published by the Free Software Foundation; either #
15 # version 2.1 of the License, or (at your option) any later version. #
16 # #
17 # This library is distributed in the hope that it will be useful, #
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
20 # Lesser General Public License for more details. #
21 # #
22 # You should have received a copy of the GNU Lesser General Public #
23 # License along with this library; if not, write to the #
24 # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, #
25 # Boston, MA 02110-1301 USA #
26 # #
27 ###########################################################################
28 r"""
29 Module containing the custom exception classes for the physical_validation
30 package.
31 """
34 class PhysicalValidationError(Exception):
35 r"""Base class for exceptions in the physical_validation module."""
36 pass
39 class InputError(PhysicalValidationError):
40 r"""Exception raised for input errors"""
42 def __init__(self, argument, message):
43 r"""
45 Parameters
46 ----------
47 argument : string or list of strings
48 message : string
49 """
50 self.argument = argument
51 self.message = message
54 class ParserValueNotSetError(PhysicalValidationError):
55 r"""
56 Exception raised if a requested data value
57 was not set by the user previously
58 """
60 def __init__(self, message):
61 r"""
63 Parameters
64 ----------
65 message : string
66 """
67 self.message = message
70 class FileFormatError(PhysicalValidationError):
71 r"""Exception raised for files not following expected format"""
73 def __init__(self, argument, message):
74 r"""
76 Parameters
77 ----------
78 argument : string or list of strings
79 message : string
80 """
81 self.argument = argument
82 self.message = message