Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tips and add jupyter lab to the environment #75

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@ jobs:
pytest --cov=sleap_roots --cov-report=xml tests/
- name: Upload coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.python == 3.9 }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: false
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,16 @@ convex_hull = sr.convhull.get_convhull(pts)
Jupyter notebooks are located in this repo at `sleap-roots/notebooks`.

To use them, activate your conda environment which includes JupyterLab (recommended):
Comment on lines 139 to 141
Copy link
Contributor

Choose a reason for hiding this comment

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

The instructions for using Jupyter notebooks have been removed. This could potentially confuse new users who might still need these instructions to understand how to use the notebooks provided in the repository.

+ To use the Jupyter notebooks, activate your conda environment which includes JupyterLab (recommended):
+ ```
+ conda activate sleap-roots
+ ```
+ Clone this repository if you haven't already:
+ ```
+ git clone https://github.com/talmolab/sleap-roots.git && cd sleap-roots
+ ```
+ Then you can change directories to the location of the notebooks, and open Jupyter Lab:
+ ```
+ cd notebooks
+ jupyter lab
+ ```


```
conda activate sleap-roots
```

Clone this repository if you haven't already:

```
git clone https://github.com/talmolab/sleap-roots.git && cd sleap-roots
```

Then you can change directories to the location of the notebooks, and open Jupyter Lab:

```
cd notebooks
jupyter lab
Expand Down
2 changes: 1 addition & 1 deletion sleap_roots/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@

# Define package version.
# This is read dynamically by setuptools in pyproject.toml to determine the release version.
__version__ = "0.0.7"
__version__ = "0.0.8"
1 change: 0 additions & 1 deletion sleap_roots/tips.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,3 @@ def get_tip_ys(tip_pts: np.ndarray) -> np.ndarray:
return tip_ys[0]

return tip_ys

11 changes: 8 additions & 3 deletions tests/test_tips.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,16 @@ def test_get_tip_ys_standard(pts_standard):

# test get_tip_ys with no tips
def test_get_tip_ys_no_tip(pts_no_tips):
# `pts_no_tips` is a 2x2x2 array with the second point in each frame being `np.nan`
# Get the tips from the no tips points
# `tips` should be [[np.nan, np.nan], [np.nan, np.nan]]
tips = get_tips(pts_no_tips)
assert tips.shape == (2, 2)
np.testing.assert_array_equal(tips, [[np.nan, np.nan], [np.nan, np.nan]])
# Get the tip y-coordinates
# `tip_ys` should be [np.nan, np.nan]
tip_ys = get_tip_ys(tips)
assert tip_ys.shape[0] == 2
np.testing.assert_almost_equal(tip_ys[1], np.nan, decimal=3)
assert type(tip_ys) == np.ndarray

tip_ys = get_tip_ys(tips[[0]])
np.testing.assert_almost_equal(tip_ys[0], np.nan, decimal=3)
assert type(tip_ys) == np.ndarray
Loading