Rational
- class pyarts3.arts.Rational(*args, **kwargs)
Holds a rational number as two
Index\[x = \frac{a}{b}\]where \(a\) is the numerator and \(b\) is the denominator.
Overview
Method
Read variable from file.
Method
Saves variable to file.
Static Method
Create variable from file.
Denominator
Numerator
Operator
__add__(self, arg: pyarts3.arts.Rational, /) -> pyarts3.arts.RationalOperator
__eq__(self, arg: pyarts3.arts.Rational, /) -> boolOperator
__format__(self, arg: str, /) -> strOperator
__ge__(self, arg: pyarts3.arts.Rational, /) -> boolOperator
__gt__(self, arg: pyarts3.arts.Rational, /) -> boolOperator
Return hash(self).
Operator
__iadd__(self, arg: pyarts3.arts.Rational, /) -> pyarts3.arts.RationalOperator
__imul__(self, arg: pyarts3.arts.Rational, /) -> pyarts3.arts.RationalOperator
__init__(self, arg: pyarts3.arts.Rational) -> NoneOperator
__isub__(self, arg: pyarts3.arts.Rational, /) -> pyarts3.arts.RationalOperator
__itruediv__(self, arg: pyarts3.arts.Rational, /) -> pyarts3.arts.RationalOperator
__le__(self, arg: pyarts3.arts.Rational, /) -> boolOperator
__lt__(self, arg: pyarts3.arts.Rational, /) -> boolOperator
__mul__(self, arg: pyarts3.arts.Rational, /) -> pyarts3.arts.RationalOperator
__ne__(self, arg: pyarts3.arts.Rational, /) -> boolOperator
__radd__(self, arg: int, /) -> pyarts3.arts.RationalOperator
__repr__(self) -> strOperator
__rmul__(self, arg: int, /) -> pyarts3.arts.RationalOperator
__rsub__(self, arg: int, /) -> pyarts3.arts.RationalOperator
__rtruediv__(self, arg: int, /) -> pyarts3.arts.RationalOperator
__str__(self) -> strOperator
__truediv__(self, arg: pyarts3.arts.Rational, /) -> pyarts3.arts.RationalConstructors
- __init__(self, n: int = 0, d: int = 1) None
- __init__(self, arg: str, /) None
- __init__(self) None
- __init__(self, arg: Rational) None
Methods
- readxml(self, file: str) str
Read variable from file.
- Parameters:
file (str) – A file that can be read.
- Raises:
RuntimeError – For any failure to read.
- Returns:
file – The file path found (may differ from input due to environment variables).
- Return type:
- savexml(self, file: str, type: str = 'ascii', clobber: bool = True) str
Saves variable to file.
- Parameters:
file (str) – The path to which the file is written. Note that several of the options might modify the name or write more files.
type (str, optional) – Type of file to save. See
FileTypefor options. Defaults is “ascii”.clobber (bool, optional) – Overwrite existing files or add new file with modified name? Defaults is True.
- Raises:
RuntimeError – For any failure to write.
- Returns:
file – The file saved. May differ from input.
- Return type:
Static Methods
- fromxml(file: str) Rational
Create variable from file.
- Parameters:
file (str) – A file that can be read
- Raises:
RuntimeError – For any failure to read.
Attributes
Operators
- __eq__(self, arg: int, /) bool
- __eq__(self, arg: int, /) bool
- __eq__(self, arg: Rational, /) bool
- __eq__(self, arg: Rational, /) bool
- __ge__(self, arg: int, /) bool
- __ge__(self, arg: int, /) bool
- __ge__(self, arg: Rational, /) bool
- __ge__(self, arg: Rational, /) bool
- __gt__(self, arg: int, /) bool
- __gt__(self, arg: int, /) bool
- __gt__(self, arg: Rational, /) bool
- __gt__(self, arg: Rational, /) bool
- __hash__()
Return hash(self).
- __init__(self, n: int = 0, d: int = 1) None
- __init__(self, arg: str, /) None
- __init__(self) None
- __init__(self, arg: Rational) None
- __le__(self, arg: int, /) bool
- __le__(self, arg: int, /) bool
- __le__(self, arg: Rational, /) bool
- __le__(self, arg: Rational, /) bool
- __lt__(self, arg: int, /) bool
- __lt__(self, arg: int, /) bool
- __lt__(self, arg: Rational, /) bool
- __lt__(self, arg: Rational, /) bool