-
Notifications
You must be signed in to change notification settings - Fork 1
Added logic to support recursive searching of upstream visits #725
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #725 +/- ##
==========================================
+ Coverage 46.01% 46.02% +0.01%
==========================================
Files 91 91
Lines 9625 9633 +8
Branches 1256 1259 +3
==========================================
+ Hits 4429 4434 +5
- Misses 4977 4978 +1
- Partials 219 221 +2 🚀 New features to boost your workflow:
|
| if partial_match | ||
| else search_string == entry.name | ||
| ): | ||
| current_upstream_visits[entry.name] = Path(entry.path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not keen on this as it is modifying something from outside the scope of the function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fair. I've re-written it so that it creates a dictionary within the scope of the function, updates it recursively, before returning it to the outer function.
| partial_match=partial_match, | ||
| max_depth=max_depth - 1, | ||
| ) | ||
| continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the continue needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's not needed. I think I had it there as a visual reminder that the if-block logic ended here. Will remove it.
…t recursively, and return it instead of using a variable from outside the function scope
The current logic for
find_upstream_visitslooks only in the folder specified. This is a problem as it means that, in the event the data is saved by year, the machine config will have to be updated with the new year, and access to the old year's data will be lost.To circumvent this, we implement recursive searching logic, such that Murfey will recursively search through the a specified number of layers in the stated data directory to find matches for the current visit. This solution allows for the current
upstream_data_directorieskey format to be kept as-is, while future-proofing the code as the years go by, allowing past visits to continue to be exposed until they are deleted from the system.