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.Rational
Operator
__eq__(self, arg: pyarts3.arts.Rational, /) -> bool
Operator
__format__(self, arg: str, /) -> str
Operator
__ge__(self, arg: pyarts3.arts.Rational, /) -> bool
Operator
__getstate__(self) -> tuple[int, int]
Operator
__gt__(self, arg: pyarts3.arts.Rational, /) -> bool
Operator
Return hash(self).
Operator
__iadd__(self, arg: pyarts3.arts.Rational, /) -> pyarts3.arts.Rational
Operator
__imul__(self, arg: pyarts3.arts.Rational, /) -> pyarts3.arts.Rational
Operator
__init__(self, arg: pyarts3.arts.Rational) -> None
Operator
__isub__(self, arg: pyarts3.arts.Rational, /) -> pyarts3.arts.Rational
Operator
__itruediv__(self, arg: pyarts3.arts.Rational, /) -> pyarts3.arts.Rational
Operator
__le__(self, arg: pyarts3.arts.Rational, /) -> bool
Operator
__lt__(self, arg: pyarts3.arts.Rational, /) -> bool
Operator
__mul__(self, arg: pyarts3.arts.Rational, /) -> pyarts3.arts.Rational
Operator
__ne__(self, arg: pyarts3.arts.Rational, /) -> bool
Operator
__radd__(self, arg: int, /) -> pyarts3.arts.Rational
Operator
__repr__(self) -> str
Operator
__rmul__(self, arg: int, /) -> pyarts3.arts.Rational
Operator
__rsub__(self, arg: int, /) -> pyarts3.arts.Rational
Operator
__rtruediv__(self, arg: int, /) -> pyarts3.arts.Rational
Operator
__setstate__(self, arg: tuple[int, int], /) -> None
Operator
__str__(self) -> str
Operator
__truediv__(self, arg: pyarts3.arts.Rational, /) -> pyarts3.arts.Rational
Constructors
- __init__(self, n: int = 0, d: int = 1) None
- __init__(self, arg: str, /) None
- __init__(self) None
- __init__(self, arg: pyarts3.arts.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
FileType
for 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) pyarts3.arts.Rational
Create variable from file.
- Parameters:
file (str) – A file that can be read
- Raises:
RuntimeError – For any failure to read.
- Returns:
artstype – The variable created from the file.
- Return type:
T
Attributes
Operators
- __add__(self, arg: int, /) pyarts3.arts.Rational
- __add__(self, arg: pyarts3.arts.Rational, /) pyarts3.arts.Rational
- __eq__(self, arg: int, /) bool
- __eq__(self, arg: int, /) bool
- __eq__(self, arg: pyarts3.arts.Rational, /) bool
- __ge__(self, arg: int, /) bool
- __ge__(self, arg: int, /) bool
- __ge__(self, arg: pyarts3.arts.Rational, /) bool
- __gt__(self, arg: int, /) bool
- __gt__(self, arg: int, /) bool
- __gt__(self, arg: pyarts3.arts.Rational, /) bool
- __hash__()
Return hash(self).
- __iadd__(self, arg: int, /) pyarts3.arts.Rational
- __iadd__(self, arg: pyarts3.arts.Rational, /) pyarts3.arts.Rational
- __imul__(self, arg: int, /) pyarts3.arts.Rational
- __imul__(self, arg: pyarts3.arts.Rational, /) pyarts3.arts.Rational
- __init__(self, n: int = 0, d: int = 1) None
- __init__(self, arg: str, /) None
- __init__(self) None
- __init__(self, arg: pyarts3.arts.Rational) None
- __isub__(self, arg: int, /) pyarts3.arts.Rational
- __isub__(self, arg: pyarts3.arts.Rational, /) pyarts3.arts.Rational
- __itruediv__(self, arg: int, /) pyarts3.arts.Rational
- __itruediv__(self, arg: pyarts3.arts.Rational, /) pyarts3.arts.Rational
- __le__(self, arg: int, /) bool
- __le__(self, arg: int, /) bool
- __le__(self, arg: pyarts3.arts.Rational, /) bool
- __lt__(self, arg: int, /) bool
- __lt__(self, arg: int, /) bool
- __lt__(self, arg: pyarts3.arts.Rational, /) bool
- __mul__(self, arg: int, /) pyarts3.arts.Rational
- __mul__(self, arg: pyarts3.arts.Rational, /) pyarts3.arts.Rational
- __ne__(self, arg: int, /) bool
- __ne__(self, arg: int, /) bool
- __ne__(self, arg: pyarts3.arts.Rational, /) bool
- __radd__(self, arg: int, /) pyarts3.arts.Rational
- __rmul__(self, arg: int, /) pyarts3.arts.Rational
- __rsub__(self, arg: int, /) pyarts3.arts.Rational
- __rtruediv__(self, arg: int, /) pyarts3.arts.Rational
- __truediv__(self, arg: int, /) pyarts3.arts.Rational
- __truediv__(self, arg: pyarts3.arts.Rational, /) pyarts3.arts.Rational