Skip to content

Tabs --> spaces in quine_mc_cluskey.py #1426

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

Merged
merged 3 commits into from
Nov 21, 2019
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
48 changes: 24 additions & 24 deletions boolean_algebra/quine_mc_cluskey.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
def compare_string(string1, string2):
"""
>>> compare_string('0010','0110')
'0_10'
>>> compare_string('0010','0110')
'0_10'

>>> compare_string('0110','1101')
-1
"""
>>> compare_string('0110','1101')
-1
"""
l1 = list(string1)
l2 = list(string2)
count = 0
Expand All @@ -21,9 +21,9 @@ def compare_string(string1, string2):

def check(binary):
"""
>>> check(['0.00.01.5'])
['0.00.01.5']
"""
>>> check(['0.00.01.5'])
['0.00.01.5']
"""
pi = []
while 1:
check1 = ["$"] * len(binary)
Expand All @@ -45,9 +45,9 @@ def check(binary):

def decimal_to_binary(no_of_variable, minterms):
"""
>>> decimal_to_binary(3,[1.5])
['0.00.01.5']
"""
>>> decimal_to_binary(3,[1.5])
['0.00.01.5']
"""
temp = []
s = ""
for m in minterms:
Expand All @@ -61,12 +61,12 @@ def decimal_to_binary(no_of_variable, minterms):

def is_for_table(string1, string2, count):
"""
>>> is_for_table('__1','011',2)
True
>>> is_for_table('__1','011',2)
True

>>> is_for_table('01_','001',1)
False
"""
>>> is_for_table('01_','001',1)
False
"""
l1 = list(string1)
l2 = list(string2)
count_n = 0
Expand All @@ -81,12 +81,12 @@ def is_for_table(string1, string2, count):

def selection(chart, prime_implicants):
"""
>>> selection([[1]],['0.00.01.5'])
['0.00.01.5']
>>> selection([[1]],['0.00.01.5'])
['0.00.01.5']

>>> selection([[1]],['0.00.01.5'])
['0.00.01.5']
"""
>>> selection([[1]],['0.00.01.5'])
['0.00.01.5']
"""
temp = []
select = [0] * len(chart)
for i in range(len(chart[0])):
Expand Down Expand Up @@ -128,9 +128,9 @@ def selection(chart, prime_implicants):

def prime_implicant_chart(prime_implicants, binary):
"""
>>> prime_implicant_chart(['0.00.01.5'],['0.00.01.5'])
[[1]]
"""
>>> prime_implicant_chart(['0.00.01.5'],['0.00.01.5'])
[[1]]
"""
chart = [[0 for x in range(len(binary))] for x in range(len(prime_implicants))]
for i in range(len(prime_implicants)):
count = prime_implicants[i].count("_")
Expand Down
5 changes: 3 additions & 2 deletions data_structures/queue/circular_queue.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Implementation of Circular Queue (using Python lists)


class CircularQueue:
"""Circular FIFO queue with a fixed capacity"""

Expand Down Expand Up @@ -59,7 +60,7 @@ def enqueue(self, data):
raise Exception("QUEUE IS FULL")

self.array[self.rear] = data
self.rear = (self.rear+1)%self.n
self.rear = (self.rear + 1) % self.n
self.size += 1
return self

Expand Down Expand Up @@ -88,6 +89,6 @@ def dequeue(self):

temp = self.array[self.front]
self.array[self.front] = None
self.front = (self.front + 1)%self.n
self.front = (self.front + 1) % self.n
self.size -= 1
return temp
8 changes: 4 additions & 4 deletions digital_image_processing/filters/gaussian_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def gaussian_filter(image, k_size, sigma):
# im2col, turn the k_size*k_size pixels into a row and np.vstack all rows
image_array = zeros((dst_height * dst_width, k_size * k_size))
row = 0
for i, j in product(range(dst_height), range(dst_width)):
window = ravel(image[i : i + k_size, j : j + k_size])
image_array[row, :] = window
row += 1
for i, j in product(range(dst_height), range(dst_width)):
window = ravel(image[i : i + k_size, j : j + k_size])
image_array[row, :] = window
row += 1

# turn the kernel into shape(k*k, 1)
gaussian_kernel = gen_gaussian_kernel(k_size, sigma)
Expand Down