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

Add Option to Export CSV #1438

Merged
merged 4 commits into from
Aug 10, 2023
Merged

Add Option to Export CSV #1438

merged 4 commits into from
Aug 10, 2023

Conversation

gitttt-1234
Copy link
Contributor

Description

Add an option to export the analysis file in CSV format

Types of changes

  • Bugfix
  • New feature
  • Refactor / Code style update (no logical changes)
  • Build / CI changes
  • Documentation Update
  • Other (explain)

Does this address any currently open issues?

[list open issues here]

Outside contributors checklist

  • Review the guidelines for contributing to this repository
  • Read and sign the CLA and add yourself to the authors list
  • Make sure you are making a pull request against the develop branch (not main). Also you should start your branch off develop
  • Add tests that prove your fix is effective or that your feature works
  • Add necessary documentation (if appropriate)

Thank you for contributing to SLEAP!

❤️

@gitttt-1234 gitttt-1234 marked this pull request as draft August 5, 2023 04:40
Copy link
Collaborator

@roomrys roomrys left a comment

Choose a reason for hiding this comment

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

Possible to combine ExportAnalysisFile and ExportCSVFile?

sleap/gui/commands.py Outdated Show resolved Hide resolved
sleap/gui/commands.py Outdated Show resolved Hide resolved
sleap/gui/app.py Outdated Show resolved Hide resolved
tests/io/test_formats.py Outdated Show resolved Hide resolved
tests/io/test_formats.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Aug 9, 2023

Codecov Report

Merging #1438 (d7f2ef1) into develop (1151a95) will increase coverage by 0.03%.
Report is 4 commits behind head on develop.
The diff coverage is 74.02%.

@@             Coverage Diff             @@
##           develop    #1438      +/-   ##
===========================================
+ Coverage    73.03%   73.06%   +0.03%     
===========================================
  Files          133      134       +1     
  Lines        23768    23855      +87     
===========================================
+ Hits         17358    17429      +71     
- Misses        6410     6426      +16     
Files Changed Coverage Δ
sleap/gui/commands.py 61.39% <41.17%> (-0.04%) ⬇️
sleap/io/format/csv.py 68.00% <68.00%> (ø)
sleap/info/write_tracking_h5.py 91.44% <93.75%> (+0.53%) ⬆️
sleap/gui/app.py 75.50% <100.00%> (+0.11%) ⬆️

... and 5 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@gitttt-1234 gitttt-1234 marked this pull request as ready for review August 9, 2023 18:08
Copy link
Collaborator

@roomrys roomrys left a comment

Choose a reason for hiding this comment

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

Good job on condensing the classes.

For the following:
P = positive
N = negative

P1. I feel like we can condense even further though and use some of the variable for user selection downstream in the FileDialog... ie. instead of having a two buttons for Export Analysis CSV and Export Analysis HDF5, we have one button Export Analysis and allow the user to select the export format as csv downstream in the FileDialog....

N1. The only trouble would be specifying the default extension to use when exporting analysis for all files (and only selecting a folder via the FileDialog...).

P2. This would also allow us to multipurpose the export command Ctrl + Alt+ E.
N2. Another discrepancy would be calling the CSV export an analysis file....
N3. Even though we would be reusing code, are we layering user options too deep? Would it be easier to have the options in plain sight?

What do you think?

image

image

image

image

sleap/gui/commands.py Outdated Show resolved Hide resolved
sleap/info/write_tracking_h5.py Outdated Show resolved Hide resolved
sleap/io/format/csv.py Outdated Show resolved Hide resolved
sleap/io/format/csv.py Outdated Show resolved Hide resolved
sleap/info/write_tracking_h5.py Outdated Show resolved Hide resolved
@roomrys roomrys merged commit 47f8096 into develop Aug 10, 2023
9 checks passed
@roomrys roomrys deleted the divya/add-export-csv branch August 10, 2023 23:29
roomrys pushed a commit that referenced this pull request Sep 10, 2023
commit 734283a
Author: Liezl Maree <38435167+roomrys@users.noreply.github.com>
Date:   Sun Sep 10 08:19:36 2023 -0700

    Bump to 1.3.2 (#1482)

    * Bump to 1.3.2

    * Run manual build w/o pip upload

    * Use `importlib.resources` if available

    * Rebuild mac conda package

    * Lint

    * Build/upload pip wheel

    * Reset build_manual and up build number

commit e424501
Author: Liezl Maree <38435167+roomrys@users.noreply.github.com>
Date:   Sat Sep 9 10:32:29 2023 -0700

    Add pip extras (#1481)

    * Rename pip to pypi, add tensorflow

    * Move out jupyter requirements from dev

    * Add extras for conda/pip jupyter and dev

    * Rename `pip` extra to `pypi`

    * Add build_ci workflow

    * Install pip package using extras

    * Rerun notebooks with new pip wheel

    * Internal import after adding relative path to sys

    * Build develop docs on this branch

    * Add comments to setup.py extras

    * Update installation docs

    * Add wget bypass for apple silicon mambaforge

    * Create func to combine req

    * Italicize jupyter instead of bold

    ---------

    Co-authored-by: modularizer <modularizer@gmail.com>
    Co-authored-by: roomrys <>

commit 93ef288
Author: Shrivaths Shyam <52810689+shrivaths16@users.noreply.github.com>
Date:   Sat Sep 9 03:12:58 2023 +0530

    Limit max tracks via track-local queues (#1447)

    * Initial commit

    * format files

    * [wip] adding local deque for tracks

    * format files

    * [wip] adding local deque for tracks

    * [wip] Add max tracking for simpletracker

    * [wip] Add max tracking for simple tracker

    * [wip] add missing argument

    * [wip] Add and modify test functions

    * [wip] Add and modify test functions

    * Bug fix and refactoring code

    * [wip] Add max tracking for flow tracker.

    * [wip] Including suggested changes

    * [wip] refactor code

    * Add test function to check max tracks

    * Added suggestions and feedback

    * Prevent the creation of more than max tracks when we have unmatched detections

    * Add tests

    * Use maximum tracking by default when loading model via high level API

    * Lint

    * Fix integration test

    * Refactor max tracker tests

    * Add integration test for CLI

    * typo

    * Add max tracks to the tracking GUI

    * Update CLI docs and add examples

    ---------

    Co-authored-by: Talmo Pereira <talmo@princeton.edu>
    Co-authored-by: Talmo Pereira <talmo@salk.edu>

commit 64655d6
Author: DivyaSesh <64513125+gitttt-1234@users.noreply.github.com>
Date:   Wed Sep 6 09:50:35 2023 -0700

    Fix Auto-select GPU (#1474)

    * Fix Auto-select GPU

    * Format file

    * Add variable in init

    * Format files

    * Add small test to ensure environment variable is set

    * Make linter happy

    ---------

    Co-authored-by: roomrys <lmaree@ucsd.edu>

commit 0ef52cd
Author: Liezl Maree <38435167+roomrys@users.noreply.github.com>
Date:   Thu Aug 17 11:03:51 2023 -0700

    Migrate to `importlib_resources` backport (#1458)

    * Switch to  backport

    * Remove `pkg_resources`

    * Clean-up function (non-logical)

    * Make linter happy

    * Fix-up path for last few stragglers

    * Use `Path.as_posix` method instead of `str`

commit e0eebb2
Author: Liezl Maree <38435167+roomrys@users.noreply.github.com>
Date:   Tue Aug 15 13:10:06 2023 -0700

    Handle error message edge case when finding yaml paths (#1456)

commit 6858563
Author: Liezl Maree <38435167+roomrys@users.noreply.github.com>
Date:   Fri Aug 11 11:33:14 2023 -0700

    Add message if drag drop fails (#1451)

    * Fix drag and drop

    * Feedback when user drops invalid file type

    * Change wording on message

commit 88fdb68
Author: Liezl Maree <38435167+roomrys@users.noreply.github.com>
Date:   Fri Aug 11 11:27:57 2023 -0700

    Pin `tensorflow-hub<0.14.0` (#1446)

    * Pin pynwb 2.3.3

    * Remove pynwb pin, add comments

commit 4730788
Author: Talmo Pereira <talmo@salk.edu>
Date:   Fri Aug 11 10:52:09 2023 -0700

    Fix drag and drop (#1449)

commit 47f8096
Author: DivyaSesh <64513125+gitttt-1234@users.noreply.github.com>
Date:   Thu Aug 10 16:29:39 2023 -0700

    Add Option to Export CSV (#1438)

    * Add Option to Export CSV

    * Add Test Functions

    * Fomat Files

    * Change FormatID

commit 5ba6bc1
Author: Liezl Maree <38435167+roomrys@users.noreply.github.com>
Date:   Thu Aug 10 10:17:45 2023 -0700

    Add model folder to the unzip path (#1445)

    * Add model folder to the unzip path

    * Handle cases where zipped model either has no extra directory

    * Add test

    * Fix-up test and implementation

    * Manually lint

commit d61a184
Author: KevinZ0217 <96039456+KevinZ0217@users.noreply.github.com>
Date:   Wed Aug 9 14:47:21 2023 -0700

    Change the hotkey for exporting h5 analysis (#1444)

    * Change the hotkey for export h5 files to Ctrl+Alt+E

commit ad7529e
Author: KevinZ0217 <96039456+KevinZ0217@users.noreply.github.com>
Date:   Wed Aug 9 14:46:09 2023 -0700

    Add a button for copying model config to clipboard (#1433)

    * Add shortcur for export_analysis_current

    * Fix the linting issue

    * Add the button without copy method'

    * Add button for copying model config to clipboard

    * Fix linting by reformatting

    * Use Qtpy for clipboard rather than pyperclip

    * Pretty print model config json to clipboard and fix missing command

    * Fix the overwriting problem for dict object

    * Delete unnecessary print statement

    * Add a few comments & Remove unnecessary variables & remove unused function

commit 2611e7d
Author: Liezl Maree <38435167+roomrys@users.noreply.github.com>
Date:   Wed Aug 9 11:52:57 2023 -0700

    Improve error message for detecting video backend (#1441)

    * Improve error message for detecting video backend

    * Lint

    * Add small test

commit 1151a95
Author: Shrivaths Shyam <52810689+shrivaths16@users.noreply.github.com>
Date:   Wed Aug 2 17:08:38 2023 -0700

    Fix error thrown when last video is deleted  (#1421)

    * Handle None Video case during callbacks

    * format files

    * remove unused comments

    * Disable remove video button when there are no videos

    * Display default background when all videos are removed

    * Format files

    * Remove overlay error after removing last video

    * Redraw overlays on plot change (#1435)

    * Redraw overlays after changedPlot, changedPlot on reset

    * Update instance state on player reset

    ---------

    Co-authored-by: Liezl Maree <38435167+roomrys@users.noreply.github.com>

commit 6002332
Author: Shrivaths Shyam <52810689+shrivaths16@users.noreply.github.com>
Date:   Mon Jul 31 13:28:53 2023 -0700

    Update status message on status bar (#1411)

    * Update status message on status bar

    * Update statusbar to show correct video count

    * remove additional conditional check

commit 3a01ef3
Author: Liezl Maree <38435167+roomrys@users.noreply.github.com>
Date:   Mon Jul 31 12:09:50 2023 -0700

    Correct GUI state emulation (#1422)

commit e94b516
Author: Liezl Maree <38435167+roomrys@users.noreply.github.com>
Date:   Thu Jul 27 12:11:41 2023 -0700

    Add video path and frame indices to metrics (#1396)

    * Add `Instance`s and `PredictedInstance`s to metrics

    * Add tests

    * Add frame/video info to metrics, wip: test writing

    * Fix metrics save test

commit b2ad203
Author: Liezl Maree <38435167+roomrys@users.noreply.github.com>
Date:   Thu Jul 27 12:08:19 2023 -0700

    Fix labels export for json (#1410)

    * wip: fix labels export for json

    * Add test for json.zip labels pkg

    * Add test for .slp labels pkg

    * Make linter happy

commit 90c012d
Author: KevinZ0217 <96039456+KevinZ0217@users.noreply.github.com>
Date:   Wed Jul 26 13:30:22 2023 -0700

    Add shortcut to export analysis for current video (#1414)

    * Add shortcur for export_analysis_current

    * Fix the linting issue

commit f9d0a22
Author: Shrivaths Shyam <52810689+shrivaths16@users.noreply.github.com>
Date:   Tue Jul 25 09:37:52 2023 -0700

    Modify compute OKS function (#1399)

    * Update compute OKS function

    * Update compute OKS function

    * Modify compute OKS function

    * Added suggested changes

    * Added further suggestions and comments

    * Added the permalink to the cocoeval function

    * Added permalink to cocoeval function

    ---------

    Co-authored-by: Liezl Maree <38435167+roomrys@users.noreply.github.com>
    Co-authored-by: Talmo Pereira <talmo@salk.edu>

commit 904338c
Author: Liezl Maree <38435167+roomrys@users.noreply.github.com>
Date:   Tue Jul 25 06:34:25 2023 -0700

    Add `Video` to cache when adding `Track` (#1407)

    * Add `Video` to cache when adding `Track`

    * Use methods instead of rewriting code

    * Simplify code

commit 845214c
Author: DivyaSesh <64513125+gitttt-1234@users.noreply.github.com>
Date:   Mon Jul 24 21:20:02 2023 -0700

    Fix Remove Videos in Batch (#1406)

    * Fix Remove Videos in Batch

    * Remove Unused Testing Code

commit 0afbb9b
Author: Liezl Maree <38435167+roomrys@users.noreply.github.com>
Date:   Mon Jul 24 17:37:42 2023 -0700

    Add `Track` when add `Instance` (#1408)

commit d173303
Author: Liezl Maree <38435167+roomrys@users.noreply.github.com>
Date:   Mon Jul 24 08:25:09 2023 -0700

    Fix skeleton templates (#1404)

commit 0e7a372
Author: DivyaSesh <64513125+gitttt-1234@users.noreply.github.com>
Date:   Fri Jul 21 09:49:51 2023 -0700

    Fix panning bounding box (#1398)

commit fb61b6c
Author: Liezl Maree <38435167+roomrys@users.noreply.github.com>
Date:   Wed Jul 19 15:30:43 2023 -0700

    Fix `Filedialog` to work across (mac)OS (#1393)

    * Always use dir instead of directory

    * Wrap `FileDialog` methods for OS-specific calls

    * Clean-up os-specific wrapper to check for linux only

    * Lint

    * Fix test for non native `FileDialog`

commit 19cd2b5
Author: DivyaSesh <64513125+gitttt-1234@users.noreply.github.com>
Date:   Mon Jul 17 17:55:29 2023 -0700

    Add option to remove videos in batch (#1382)

    * add option to remove videos in batch

    * Add option to remove videos in batch

    * Add option to remove videos in batches

    * Modify Lint format

    * Add Test cases

    * Modify Test Cases for Removing Videos in Batch

    * Add Comment to test_docks

    * Remove commented line

    * Format files

commit 3b5c4ff
Author: Shrivaths Shyam <52810689+shrivaths16@users.noreply.github.com>
Date:   Fri Jul 14 17:06:58 2023 -0700

    Minor fix in computation of OKS (#1383)

    * fix compute oks

    * Update the oks fix

commit 1c2be11
Author: Liezl Maree <38435167+roomrys@users.noreply.github.com>
Date:   Thu Jul 6 14:44:01 2023 -0700

    Pin micromamba version (#1376)

    * Pin micromamba version

    * Add build number to pin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants