-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reading of velocities, forces and charges implemented
- Loading branch information
Showing
13 changed files
with
271 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
""" | ||
A module containing different exceptions which could be useful. | ||
... | ||
Classes | ||
------- | ||
PQException | ||
Base class for exceptions in this module. | ||
ElementNotFoundError | ||
Exception raised if the given element id is not valid | ||
TrajectoryFormatError | ||
Exception raised if the given enum is not valid | ||
""" | ||
|
||
from beartype.typing import Any | ||
|
||
|
||
class PQException(Exception): | ||
""" | ||
Base class for exceptions in this module. | ||
""" | ||
|
||
def __init__(self, message: str) -> None: | ||
self.message = message | ||
super().__init__(self.message) | ||
|
||
|
||
class ElementNotFoundError(PQException): | ||
""" | ||
Exception raised if the given element id is not valid | ||
""" | ||
|
||
def __init__(self, id: Any) -> None: | ||
self.id = id | ||
self.message = f"""Id {self.id} is not a valid element identifier.""" | ||
super().__init__(self.message) | ||
|
||
|
||
class TrajectoryFormatError(PQException): | ||
""" | ||
Exception raised if the given enum is not valid | ||
""" | ||
|
||
def __init__(self, value: object, enum: object) -> None: | ||
self.enum = enum | ||
self.value = value | ||
self.message = f""" | ||
'{self.value}' is not a valid TrajectoryFormat. | ||
Possible values are: {enum.member_repr()} | ||
or their case insensitive string representation: {enum.value_repr()}""" | ||
super().__init__(self.message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.