Skip to content

copy of main branch (Sourcery refactored)#34

Closed
sourcery-ai[bot] wants to merge 1 commit into
mainfrom
sourcery/main
Closed

copy of main branch (Sourcery refactored)#34
sourcery-ai[bot] wants to merge 1 commit into
mainfrom
sourcery/main

Conversation

@sourcery-ai
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot commented Aug 7, 2023

Pull Request #33 refactored by Sourcery.

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

NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.

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 main branch, then run:

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

Help us improve this pull request!


This change is Reviewable

@sourcery-ai sourcery-ai Bot requested a review from mrayanasim09 August 7, 2023 19:44
@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
python-projects ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2023 7:44pm


# Set the title
plt.title("Quadratic Equation: y = {}x^2 + {}x + {}".format(a, b, c))
plt.title(f"Quadratic Equation: y = {a}x^2 + {b}x + {c}")
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Lines 137-137 refactored with the following changes:

Comment thread Calculator/bmi.py
"""
bmi = weight / (height ** 2)
return bmi
return weight / (height ** 2)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function calculate_bmi refactored with the following changes:

Comment thread Calculator/bmi.py
Comment on lines -51 to +61
weight = float(input("Enter your weight in {}: ".format(weight_unit)))
weight = float(input(f"Enter your weight in {weight_unit}: "))

height_unit = input("Enter height unit (feet or meters): ")
height = float(input("Enter your height in {}: ".format(height_unit)))
height = float(input(f"Enter your height in {height_unit}: "))

# Convert weight to kg if entered in lbs
if weight_unit.lower() == "lbs":
weight = weight * 0.453592
weight *= 0.453592

# Convert height to meters if entered in feet
if height_unit.lower() == "feet":
height = height * 0.3048
height *= 0.3048
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function main refactored with the following changes:

if number % i == 0:
factors.append(i)
return factors
return [i for i in range(1, number + 1) if number % i == 0]
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function calculate_factors refactored with the following changes:

Comment on lines -292 to +288
for i in range(2, int(number ** 0.5) + 1):
if number % i == 0:
return False
return True
return all(number % i != 0 for i in range(2, int(number ** 0.5) + 1))
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function is_prime refactored with the following changes:

Comment on lines -469 to -471
else:
pass

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Lines 469-507 refactored with the following changes:

Comment on lines -540 to +525
derivative_equation = sympy.diff(equation, x)
return derivative_equation
return sympy.diff(equation, x)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function differentiate_equation refactored with the following changes:

gamma = 1 / (1 - (velocity ** 2 / 299792458 ** 2)) # Lorentz factor
time_dilated = time * gamma
return time_dilated
return time * gamma
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function time_dilation refactored with the following changes:

Comment on lines -12 to +11
length_contracted = length / gamma
return length_contracted
return length / gamma
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function length_contraction refactored with the following changes:

Comment on lines -19 to +17
energy = mass * c ** 2
return energy
return mass * c ** 2
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function energy refactored with the following changes:

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Aug 7, 2023

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@sourcery-ai sourcery-ai Bot closed this Aug 7, 2023
@sourcery-ai sourcery-ai Bot deleted the sourcery/main branch August 7, 2023 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants