Skip to content

Commit

Permalink
Added check for relative package imports
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlaw committed Jan 21, 2025
1 parent 70e4e70 commit b6d9bce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stumpy/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3689,7 +3689,7 @@ def check_ignore_trivial(T_A, T_B, ignore_trivial):
Notes
-----
These warnings may be supresse by using a context manager
These warnings may be supressed by using a context manager
```
import stumpy
import numpy as np
Expand Down
11 changes: 11 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ check_fastmath()
check_errs $?
}

check_pkg_imports()
{
echo "Checking Package Imports"
if [[ `grep '^from stumpy' stumpy/*py | wc -l` -gt "0" ]]; then
grep '^from stumpy' stumpy/*py
echo 'Error: please change "from stumpy" to "from ." '
exit 1
fi
}

check_naive()
{
# Check if there are any naive implementations not at start of test file
Expand Down Expand Up @@ -337,6 +347,7 @@ check_isort
check_flake
check_docstrings
check_print
check_pkg_imports
check_naive
check_ray

Expand Down

2 comments on commit b6d9bce

@NimaSarajpoor
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seanlaw
Thanks for adding this check!!

Btw, noticed the error in tests/test_precision.py. Probably because the latest numba version is now 0.61.0.

@seanlaw
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I hope that your PR will address this.

Please sign in to comment.