Summary
This issue tracks the addition of a basic mathematical calculations utility module (math_utils.py) to the repository.
Motivation
As the codebase grows with seismic processing scripts (PhaseNet, GaMMa), having a shared utility module for common mathematical operations will:
- Reduce code duplication across scripts
- Provide a consistent, tested set of math helpers
- Make future scripts easier to write and maintain
Proposed Implementation
Create a new file math_utils.py at the root of the repository that provides the following functions:
add(a, b) — addition
subtract(a, b) — subtraction
multiply(a, b) — multiplication
divide(a, b) — division (with zero-division guard)
power(base, exp) — exponentiation
square_root(n) — square root (with negative-input guard)
mean(values) — arithmetic mean of a list
median(values) — median of a list
Acceptance Criteria
Summary
This issue tracks the addition of a basic mathematical calculations utility module (
math_utils.py) to the repository.Motivation
As the codebase grows with seismic processing scripts (PhaseNet, GaMMa), having a shared utility module for common mathematical operations will:
Proposed Implementation
Create a new file
math_utils.pyat the root of the repository that provides the following functions:add(a, b)— additionsubtract(a, b)— subtractionmultiply(a, b)— multiplicationdivide(a, b)— division (with zero-division guard)power(base, exp)— exponentiationsquare_root(n)— square root (with negative-input guard)mean(values)— arithmetic mean of a listmedian(values)— median of a listAcceptance Criteria
math_utils.pyis created with all functions listed above