Skip to content

Commit e97f925

Browse files
committed
deepsource
1 parent c9ad1d7 commit e97f925

File tree

8 files changed

+15
-19
lines changed

8 files changed

+15
-19
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,13 @@ jobs:
3636
# Run coverage analysis on pytest tests
3737
run: |
3838
pip install .
39-
py.test --cov-report=xml --cov=./
39+
py.test --cov-report=xml --cov=./
40+
- name: Upload coverage to Deepsource
41+
if: ${{ matrix.python-version == '3.13' }}
42+
uses: deepsourcelabs/test-coverage-action@master
43+
with:
44+
key: python
45+
coverage-file: coverage.xml
46+
dsn: ${{ secrets.DEEPSOURCE_DSN }}
47+
env:
48+
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}

littlecv/littlecv/analyze_size.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""Analyzes the shape and size of objects and outputs data."""
2-
import os
32
import cv2
43
import numpy as np
54
from littlecv.littlecv.outputs import Outputs
@@ -53,8 +52,6 @@ def _analyze_size(img, mask, label):
5352
total_edge_length = 0
5453
width = 0
5554
height = 0
56-
caliper_length = 0
57-
longest_path = 0
5855
cmx = 0
5956
cmy = 0
6057
hull_vertices = 0

littlecv/littlecv/fill.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Object fill device
22

3-
import numpy as np
43
import numpy as np
54
from littlecv.littlecv.plot_image import plot_image
65
from skimage.morphology import remove_small_objects

littlecv/littlecv/outputs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def __init__(self):
77
self.observations = {}
88
self.metadata = {}
99

10-
# Method to add observation to outputs
10+
# Method to add observation to outputs
1111
def add_observation(self, sample, variable, trait, method, scale, datatype, value, label):
1212
"""Keyword arguments/parameters:
1313
sample = Sample name. Used to distinguish between multiple samples

littlecv/littlecv/plot_image.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55
from matplotlib import pyplot as plt
66

77

8-
def plot_image(img, cmap=None, plot=True, **kwargs):
9-
"""
10-
Plot an image to the screen.
8+
def plot_image(img, plot=True, **kwargs):
9+
"""Plot an image to the screen.
1110
1211
:param img: numpy.ndarray, ggplot, xarray.core.dataarray.DataArray
13-
:param cmap: str
1412
:param plot: bool, make a plot
1513
(defaults True, only used internally in place of pcv.params.debug)
1614
:param kwargs: key-value arguments to xarray.plot method

littlecv/littlecv/readimage.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Read image
22
import os
33
import cv2
4-
import numpy as np
54
from littlecv.littlecv.plot_image import plot_image
65

76

@@ -19,11 +18,10 @@ def readimage(filename, plot=True):
1918
path = str, path to image file
2019
img_name = str, name of image file
2120
"""
22-
2321
img = cv2.imread(filename, -1)
2422
# Split path from filename
2523
path, img_name = os.path.split(filename)
2624
# we are always going to debug in this dummy version
2725
plot_image(img, plot=plot)
28-
26+
2927
return img, path, img_name

littlecv/littlecv/rgb2gray_lab.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21
import cv2
32
from littlecv.littlecv.plot_image import plot_image
43

@@ -16,7 +15,7 @@ def rgb2gray_lab(rgb_img, channel, plot=True):
1615
color subchannel (l = lightness, a = green-magenta, b = blue-yellow)
1716
plot : bool
1817
lazy version of pcv.params.debug
19-
18+
2019
Returns
2120
-------
2221
numpy.ndarray
@@ -25,9 +24,6 @@ def rgb2gray_lab(rgb_img, channel, plot=True):
2524
# Convert RGB to LAB and return the specified subchannel as a gray image
2625
gray_img = _rgb2lab(rgb_img=rgb_img, channel=channel)
2726

28-
# The allowable channel inputs are l, a or b
29-
names = {"l": "lightness", "a": "green-magenta", "b": "blue-yellow"}
30-
3127
plot_image(gray_img, plot=plot)
3228

3329
return gray_img

tests/test_littlecv.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import cv2
32
import matplotlib
43
import numpy as np
54
from littlecv import littlecv as lcv

0 commit comments

Comments
 (0)