feat: Implement Vision System API Client with comprehensive endpoints and utility functions

- Added VisionApiClient class to interact with the vision system API.
- Defined interfaces for system status, machine status, camera status, recordings, and storage stats.
- Implemented methods for health checks, system status retrieval, camera control, and storage management.
- Introduced utility functions for formatting bytes, durations, and uptime.

test: Create manual verification script for Vision API functionality

- Added a test script to verify utility functions and API endpoints.
- Included tests for health check, system status, cameras, machines, and storage stats.

feat: Create experiment repetitions system migration

- Added experiment_repetitions table to manage experiment repetitions with scheduling.
- Implemented triggers and functions for validation and timestamp management.
- Established row-level security policies for user access control.

feat: Introduce phase-specific draft management system migration

- Created experiment_phase_drafts and experiment_phase_data tables for managing phase-specific drafts and measurements.
- Added pecan_diameter_measurements table for individual diameter measurements.
- Implemented row-level security policies for user access control.

fix: Adjust draft constraints to allow multiple drafts while preventing multiple submitted drafts

- Modified constraints on experiment_phase_drafts to allow multiple drafts in 'draft' or 'withdrawn' status.
- Ensured only one 'submitted' draft per user per phase per repetition.
This commit is contained in:
Alireza Vaezi
2025-07-28 16:30:56 -04:00
parent 0d0c67d5c1
commit d598281164
27 changed files with 4219 additions and 683 deletions

View File

@@ -0,0 +1,61 @@
experiment_id,run_number,soaking_duration_hr,air_drying_time_min,plate_contact_frequency_hz,throughput_rate_pecans_sec,crush_amount_in,entry_exit_height_diff_in,reps,rep
1,0,34,19,53,28,0.05,-0.09,3,1
2,1,24,27,34,29,0.03,0.01,3,3
3,12,28,59,37,23,0.06,-0.08,3,1
4,15,16,60,30,24,0.07,0.02,3,1
5,4,13,41,41,38,0.05,0.03,3,2
6,18,18,49,38,35,0.07,-0.08,3,1
7,11,24,59,42,25,0.07,-0.05,3,1
8,16,20,59,41,14,0.07,0.04,3,1
9,4,13,41,41,38,0.05,0.03,3,1
10,19,11,25,56,34,0.06,-0.09,3,1
11,15,16,60,30,24,0.07,0.02,3,2
12,16,20,59,41,14,0.07,0.04,3,3
13,10,26,60,44,12,0.08,-0.1,3,2
14,1,24,27,34,29,0.03,0.01,3,1
15,17,34,60,34,29,0.07,-0.09,3,2
16,5,30,33,30,36,0.05,-0.04,3,3
17,2,38,10,60,28,0.06,-0.1,3,3
18,2,38,10,60,28,0.06,-0.1,3,1
19,13,21,59,41,21,0.06,-0.09,3,2
20,1,24,27,34,29,0.03,0.01,3,2
21,14,22,59,45,17,0.07,-0.08,3,2
22,6,10,22,37,30,0.06,0.02,3,2
23,11,24,59,42,25,0.07,-0.05,3,2
24,19,11,25,56,34,0.06,-0.09,3,2
25,8,27,12,55,24,0.04,0.04,3,2
26,18,18,49,38,35,0.07,-0.08,3,3
27,5,30,33,30,36,0.05,-0.04,3,1
28,9,32,26,47,26,0.07,0.03,3,1
29,3,11,36,42,13,0.07,-0.07,3,1
30,10,26,60,44,12,0.08,-0.1,3,1
31,8,27,12,55,24,0.04,0.04,3,3
32,5,30,33,30,36,0.05,-0.04,3,2
33,8,27,12,55,24,0.04,0.04,3,1
34,18,18,49,38,35,0.07,-0.08,3,2
35,3,11,36,42,13,0.07,-0.07,3,3
36,10,26,60,44,12,0.08,-0.1,3,3
37,17,34,60,34,29,0.07,-0.09,3,3
38,13,21,59,41,21,0.06,-0.09,3,3
39,12,28,59,37,23,0.06,-0.08,3,2
40,9,32,26,47,26,0.07,0.03,3,3
41,14,22,59,45,17,0.07,-0.08,3,3
42,0,34,19,53,28,0.05,-0.09,3,2
43,7,15,30,35,32,0.05,-0.07,3,1
44,0,34,19,53,28,0.05,-0.09,3,3
45,15,16,60,30,24,0.07,0.02,3,3
46,13,21,59,41,21,0.06,-0.09,3,1
47,11,24,59,42,25,0.07,-0.05,3,3
48,7,15,30,35,32,0.05,-0.07,3,3
49,16,20,59,41,14,0.07,0.04,3,2
50,3,11,36,42,13,0.07,-0.07,3,2
51,7,15,30,35,32,0.05,-0.07,3,2
52,6,10,22,37,30,0.06,0.02,3,1
53,19,11,25,56,34,0.06,-0.09,3,3
54,6,10,22,37,30,0.06,0.02,3,3
55,2,38,10,60,28,0.06,-0.1,3,2
56,14,22,59,45,17,0.07,-0.08,3,1
57,4,13,41,41,38,0.05,0.03,3,3
58,9,32,26,47,26,0.07,0.03,3,2
59,17,34,60,34,29,0.07,-0.09,3,1
60,12,28,59,37,23,0.06,-0.08,3,3
1 experiment_id run_number soaking_duration_hr air_drying_time_min plate_contact_frequency_hz throughput_rate_pecans_sec crush_amount_in entry_exit_height_diff_in reps rep
2 1 0 34 19 53 28 0.05 -0.09 3 1
3 2 1 24 27 34 29 0.03 0.01 3 3
4 3 12 28 59 37 23 0.06 -0.08 3 1
5 4 15 16 60 30 24 0.07 0.02 3 1
6 5 4 13 41 41 38 0.05 0.03 3 2
7 6 18 18 49 38 35 0.07 -0.08 3 1
8 7 11 24 59 42 25 0.07 -0.05 3 1
9 8 16 20 59 41 14 0.07 0.04 3 1
10 9 4 13 41 41 38 0.05 0.03 3 1
11 10 19 11 25 56 34 0.06 -0.09 3 1
12 11 15 16 60 30 24 0.07 0.02 3 2
13 12 16 20 59 41 14 0.07 0.04 3 3
14 13 10 26 60 44 12 0.08 -0.1 3 2
15 14 1 24 27 34 29 0.03 0.01 3 1
16 15 17 34 60 34 29 0.07 -0.09 3 2
17 16 5 30 33 30 36 0.05 -0.04 3 3
18 17 2 38 10 60 28 0.06 -0.1 3 3
19 18 2 38 10 60 28 0.06 -0.1 3 1
20 19 13 21 59 41 21 0.06 -0.09 3 2
21 20 1 24 27 34 29 0.03 0.01 3 2
22 21 14 22 59 45 17 0.07 -0.08 3 2
23 22 6 10 22 37 30 0.06 0.02 3 2
24 23 11 24 59 42 25 0.07 -0.05 3 2
25 24 19 11 25 56 34 0.06 -0.09 3 2
26 25 8 27 12 55 24 0.04 0.04 3 2
27 26 18 18 49 38 35 0.07 -0.08 3 3
28 27 5 30 33 30 36 0.05 -0.04 3 1
29 28 9 32 26 47 26 0.07 0.03 3 1
30 29 3 11 36 42 13 0.07 -0.07 3 1
31 30 10 26 60 44 12 0.08 -0.1 3 1
32 31 8 27 12 55 24 0.04 0.04 3 3
33 32 5 30 33 30 36 0.05 -0.04 3 2
34 33 8 27 12 55 24 0.04 0.04 3 1
35 34 18 18 49 38 35 0.07 -0.08 3 2
36 35 3 11 36 42 13 0.07 -0.07 3 3
37 36 10 26 60 44 12 0.08 -0.1 3 3
38 37 17 34 60 34 29 0.07 -0.09 3 3
39 38 13 21 59 41 21 0.06 -0.09 3 3
40 39 12 28 59 37 23 0.06 -0.08 3 2
41 40 9 32 26 47 26 0.07 0.03 3 3
42 41 14 22 59 45 17 0.07 -0.08 3 3
43 42 0 34 19 53 28 0.05 -0.09 3 2
44 43 7 15 30 35 32 0.05 -0.07 3 1
45 44 0 34 19 53 28 0.05 -0.09 3 3
46 45 15 16 60 30 24 0.07 0.02 3 3
47 46 13 21 59 41 21 0.06 -0.09 3 1
48 47 11 24 59 42 25 0.07 -0.05 3 3
49 48 7 15 30 35 32 0.05 -0.07 3 3
50 49 16 20 59 41 14 0.07 0.04 3 2
51 50 3 11 36 42 13 0.07 -0.07 3 2
52 51 7 15 30 35 32 0.05 -0.07 3 2
53 52 6 10 22 37 30 0.06 0.02 3 1
54 53 19 11 25 56 34 0.06 -0.09 3 3
55 54 6 10 22 37 30 0.06 0.02 3 3
56 55 2 38 10 60 28 0.06 -0.1 3 2
57 56 14 22 59 45 17 0.07 -0.08 3 1
58 57 4 13 41 41 38 0.05 0.03 3 3
59 58 9 32 26 47 26 0.07 0.03 3 2
60 59 17 34 60 34 29 0.07 -0.09 3 1
61 60 12 28 59 37 23 0.06 -0.08 3 3