Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Sourcery refactored master branch #5

Merged
merged 1 commit into from
Nov 27, 2023
Merged

Sourcery refactored master branch #5

merged 1 commit into from
Nov 27, 2023

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Nov 27, 2023

Branch master refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from daedalus November 27, 2023 19:47
Comment on lines -16 to +20
download_url="{}/tarball/{}".format(BASE_CVS_URL, VERSION),
download_url=f"{BASE_CVS_URL}/tarball/{VERSION}",
test_suite="tests",
tests_require=[x.strip() for x in open("requirements_test.txt").readlines()],
tests_require=[
x.strip() for x in open("requirements_test.txt").readlines()
],
Copy link
Author

Choose a reason for hiding this comment

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

Lines 16-18 refactored with the following changes:

str_i += str(i) + " "
str_i += f"{str(i)} "
Copy link
Author

Choose a reason for hiding this comment

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

Function display refactored with the following changes:

sys.stderr.write("BLOOM: HASHID: %s\n" % self.hashid.hexdigest()[0:8])
sys.stderr.write("BLOOM: HASHID: %s\n" % self.hashid.hexdigest()[:8])
Copy link
Author

Choose a reason for hiding this comment

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

Function BloomFilter.calc_hashid refactored with the following changes:

Comment on lines +200 to +206
elif self.data_is_hex:
digest = int(value, 16)
else:
if self.data_is_hex:
digest = int(value, 16)
else:
try:
digest = int(value.hex(), 16)
except:
digest = int(binascii.hexlify(value), 16)
try:
digest = int(value.hex(), 16)
except:
digest = int(binascii.hexlify(value), 16)
Copy link
Author

Choose a reason for hiding this comment

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

Function BloomFilter._hash refactored with the following changes:

Comment on lines -247 to +246
if self.fast:
self.bitset += 1
else:
self.bitset += self.slices
self.bitset += 1 if self.fast else self.slices
Copy link
Author

Choose a reason for hiding this comment

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

Function BloomFilter._add refactored with the following changes:

Comment on lines -307 to +314
if not self.saving:
if filename is None and self.filename is None:
sys.stderr.write("A Filename must be provided\n")
return False
else:
self.saving = True
if filename is not None:
self.filename = filename
compress_pickle(self.filename, self)
self.saving = False
return True
if self.saving:
return
if filename is None and self.filename is None:
sys.stderr.write("A Filename must be provided\n")
return False
else:
self.saving = True
if filename is not None:
self.filename = filename
compress_pickle(self.filename, self)
self.saving = False
return True
Copy link
Author

Choose a reason for hiding this comment

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

Function BloomFilter.save refactored with the following changes:

@daedalus daedalus merged commit 9d290e8 into master Nov 27, 2023
2 of 4 checks passed
@daedalus daedalus deleted the sourcery/master branch November 27, 2023 20:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant