• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vanvalenlab / deepcell-label / 5074034006

pending completion
5074034006

Pull #468

github

GitHub
Merge 7f6b0d199 into 8a49c03f6
Pull Request #468: Export channels on submit/download

445 of 1181 branches covered (37.68%)

Branch coverage included in aggregate %.

3 of 7 new or added lines in 3 files covered. (42.86%)

155 existing lines in 5 files now uncovered.

2376 of 4421 relevant lines covered (53.74%)

661.14 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

36.11
/frontend/src/Project/EditControls/DivisionsControls/divisionUtils.js
1
/** Checks if a division has one daughter. */
2
export function oneDaughter(division) {
3
  const { daughters } = division;
4✔
4
  return daughters?.length === 1;
4✔
5
}
6

7
/** Checks if a division has a parent that appears after the division. */
8
export function parentAfterDivision(division, cells) {
9
  const { parent, t } = division;
4✔
10
  const times = cells.getTimes(parent);
4✔
11
  const afterDivision = times.filter((x) => x >= t);
4✔
12
  return afterDivision.length > 0;
4✔
13
}
14

15
/** Checks if a division has a daughter that before after the division. */
16
export function daughterBeforeDivision(division, cells) {
17
  const { daughters, t } = division;
4✔
18
  for (const d of daughters) {
4✔
19
    const times = cells.getTimes(d);
8✔
20
    const beforeDivision = times.filter((x) => x < t);
8✔
21
    if (beforeDivision.length > 0) {
8!
22
      return true;
×
23
    }
24
  }
25
  return false;
4✔
26
}
27

28
/** Returns the ranges of consecutive integers in an array. */
29
export function getRanges(array) {
UNCOV
30
  let ranges = [];
×
UNCOV
31
  for (let i = 0; i < array.length; i++) {
×
UNCOV
32
    let start = array[i];
×
UNCOV
33
    let end = start;
×
34
    // increment end index while array elements are consecutive
UNCOV
35
    while (array[i + 1] - array[i] === 1) {
×
UNCOV
36
      end = array[i + 1];
×
UNCOV
37
      i++;
×
38
    }
UNCOV
39
    ranges.push(start === end ? start + '' : start + '-' + end);
×
40
  }
UNCOV
41
  return ranges;
×
42
}
43

44
/** Formats a list of times in a readable format. */
45
export function formatTimes(times) {
UNCOV
46
  if (times.length === 1) {
×
UNCOV
47
    return `time ${times[0]}`;
×
48
  }
UNCOV
49
  const ranges = getRanges(times);
×
UNCOV
50
  if (ranges.length === 1) {
×
UNCOV
51
    return `times ${ranges[0]}`;
×
52
  }
UNCOV
53
  return 'times ' + ranges.slice(0, -1).join(', ') + ' and ' + ranges[ranges.length - 1];
×
54
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc