Skip to content

Commit

Permalink
make pre-commit happy
Browse files Browse the repository at this point in the history
  • Loading branch information
johannct committed Jan 9, 2025
1 parent faf6eb1 commit 33f8240
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/lib/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ double blackbody(double T, double lambda);

int bdincl(int n, long cont, int max);

//! Return the vector of indexes of values in `vec` that match `value` to the required `precision`.
//! Return the vector of indexes of values in `vec` that match `value` to the
//! required `precision`.
/*!
\param value input to be compared to the content of `vector`
\param vec the input vector of values to be compared to `value`
\param precision the precision with which `value` must compare to the entries in `vector`
\param precision the precision with which `value` must compare to the entries
in `vector`
\return the vector of indexes in `vector` of the matching values.
*/
vector<size_t> indexes_in_vec(const double &value, const vector<double> &vec,
Expand Down
2 changes: 1 addition & 1 deletion tests/lephare/test_globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ def test_globals_first_char():
def test_globals_blackbody():
assert np.isclose(blackbody(10000, 500), 1.018807e-26)


def test_indexes_in_vec():
v = [0.5, 0.9, 2.9, 3.5]
val = 0.8
assert indexes_in_vec(val, v, 0.1) == [1]
assert indexes_in_vec(val, v, 0.01) == []
assert indexes_in_vec(val, v, 0.3) == [0, 1]

0 comments on commit 33f8240

Please sign in to comment.