Source code for simplicial_test.custom_exceptions

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# simplicial_test -- a python module to realize simplicial degree-size sequences
#
# Copyright (C) 2020-2021 Tzu-Chi Yen <tzuchi.yen@colorado.edu>
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option) any
# later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.


[docs]class GoToNextLevel(Exception): def __init__(self, *args): if args: self.message = args else: self.message = None def __str__(self): if self.message: return f'SimplicialSignal {self.message}' else: return 'SimplicialSignal has been raised'
[docs]class SimplicialSignal(Exception): def __init__(self, *args): if args: self.message = args[0] else: self.message = None def __str__(self): if self.message: return f'SimplicialSignal {self.message}' else: return 'SimplicialSignal has been raised'
[docs]class NoMoreBalls(Exception): def __init__(self, *args): if args: self.message = args[0] else: self.message = None def __str__(self): if self.message: return f'{self.message}' else: return 'NoMoreBalls has been raised'