Skip to content
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

Remove unused functions and classes #2427

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

elazarg
Copy link

@elazarg elazarg commented Aug 2, 2023

Fix #2329.

Some functions may be used. Others can be considered useful to keep; we should mark those as unused.

@codecov-commenter
Copy link

codecov-commenter commented Aug 2, 2023

Codecov Report

Patch coverage: 57.14% and project coverage change: +0.65% 🎉

Comparison is base (812cfc7) 54.20% compared to head (236dc63) 54.85%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2427      +/-   ##
==========================================
+ Coverage   54.20%   54.85%   +0.65%     
==========================================
  Files         115      114       -1     
  Lines        9355     9158     -197     
==========================================
- Hits         5071     5024      -47     
+ Misses       4284     4134     -150     
Flag Coverage Δ
unittests 54.85% <57.14%> (+0.65%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
anyway/globalmaptiles.py 15.06% <ø> (-0.76%) ⬇️
anyway/graphqlSchema.py 0.00% <ø> (ø)
anyway/models.py 88.97% <0.00%> (+0.43%) ⬆️
anyway/parsers/infographics_data_cache_updater.py 35.05% <ø> (+2.91%) ⬆️
anyway/parsers/location_extraction.py 23.13% <ø> (+2.04%) ⬆️
anyway/parsers/news_flash_db_adapter.py 73.68% <ø> (+3.19%) ⬆️
anyway/parsers/registered.py 0.00% <0.00%> (ø)
anyway/parsers/twitter.py 50.00% <ø> (+6.52%) ⬆️
anyway/utilities.py 54.70% <ø> (+0.60%) ⬆️
anyway/widgets/widget.py 85.89% <ø> (+2.36%) ⬆️
... and 4 more

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@atalyaalon atalyaalon requested review from ziv17 and tkalir August 8, 2023 15:11
@atalyaalon atalyaalon marked this pull request as ready for review September 27, 2023 13:29
@atalyaalon
Copy link
Collaborator

@tkalir @ziv17 what do you think? Maybe some deletions are not good for us and we want to keep some of the functions?

raise ValueError(f"{non_urban_intersection_hebrew}: could not find "
f"SuburbanJunction with that name")
return res.non_urban_intersection

Copy link
Collaborator

@atalyaalon atalyaalon Sep 27, 2023

Choose a reason for hiding this comment

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

@ziv17 are we using these functions in future prs?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @atalyaalon I assume they will be used when we will add suburban junction resolution.

@@ -84,52 +84,6 @@ def add_news_flash_to_cache(news_flash: NewsFlash):
return False


def get_infographics_data_from_cache(news_flash_id, years_ago) -> Dict:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be removed.

Copy link
Collaborator

@ziv17 ziv17 left a comment

Choose a reason for hiding this comment

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

Nice work!
I favor removing unused code.
There are a few geo-location functions that look non trivial. Maybe we can keep them on a commit with specific tag that will allow locating them later, or in a specific file with a comment that they are kept just-in-case? I think that such non-perfect solutions are still better than keep it in the code.
The smaller unused functions I think we should remove.
The two suburban junction methods will be probably used when we will support that resolution. On the other hand, they are simple and can be written again if and when they will be needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Potentially unused functions
4 participants