Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
pyrootcpp committed Jun 24, 2024
1 parent 4497ead commit 336014c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 109 deletions.
14 changes: 4 additions & 10 deletions highpymath/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
from .highpymath import MathValueError as _mve
from .highpymath import GeometryError as _ge
from .highpymath import MathBaseError as _mbe
from .exceptions import MathTypeError
from .fast import fast_div as fdiv
from .fast import fast_mul as fmul
from .fast import fast_exp as fexp
from .highpymath import MathTypeError as _mte

__all__ = ['sum', 'sub', 'mul', 'div', 'MathValueError', 'exp', 'sqrt', 'log', 'reciprocal', 'factorial', 'calc_pi', 'calc_e', 'MathTypeError', 'fdiv', 'fmul', 'fexp']
__all__ = ['sum', 'sub', 'mul', 'div', 'MathValueError', 'exp', 'sqrt', 'log', 'reciprocal', 'factorial', 'calc_pi', 'calc_e', 'MathTypeError']

class MathBaseError(_mbe):
class MathTypeError(_mte):
"""
Exception Class for Math Base Errors.
Exception Class for Math Type Errors.
"""
def __init__(self, *args: object):
"""
Expand All @@ -20,8 +16,6 @@ def __init__(self, *args: object):
self.args_str = str(args)
super().__init__(*args)

__all__.append('MathBaseError')

class MathValueError(_mve):
"""
Exception Class for Math Value Errors.
Expand Down
13 changes: 0 additions & 13 deletions highpymath/exceptions.py

This file was deleted.

82 changes: 0 additions & 82 deletions highpymath/fast.py

This file was deleted.

8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use pyo3::prelude::*;
use pyo3::exceptions::PyException;
use pyo3::create_exception;

create_exception!(highpymath, MathBaseError, PyException);
create_exception!(highpymath, MathValueError, MathBaseError);
create_exception!(highpymath, MathTypeError, PyException);
create_exception!(highpymath, MathValueError, PyException);
create_exception!(highpymath, GeometryError, MathValueError);

#[cfg(target_pointer_width = "32")]
Expand Down Expand Up @@ -313,8 +313,8 @@ fn highpymath(m: &PyModule) -> PyResult<()> {
m.add_function(wrap_pyfunction!(quadratic_circumference, m)?)?;
m.add_function(wrap_pyfunction!(circle_area, m)?)?;
m.add_function(wrap_pyfunction!(circle_circumference, m)?)?;
m.add("MathValueError", m.py().get_type::<MathValueError>())?;
m.add("MathBaseError", m.py().get_type::<MathBaseError>())?;
m.add("MathTypeError", m.py().get_type::<MathTypeError>())?;
m.add("MathValueError", m.py().get_type::<MathValueError>())?;
m.add("GeometryError", m.py().get_type::<GeometryError>())?;
Ok(())
}

0 comments on commit 336014c

Please sign in to comment.