Refactor the internals of analyze - #194
Open
psykzz wants to merge 9 commits into
Open
Conversation
This removes path generation from string concat, this is instead replaced with os.path.join, which takes care to handle the differences between OS. Additionally removes os.chdir since this makes it harder to understand what is happening in the script, since the current directory in the loop is important, but difficult to reason. Additionally splits out the csv, json and markdown file writers into their own files. (We may want to consider a single interface, but i didn't want to touch that yet). Lastly avoids multiple reads to the config file by putting it into its own module where the file is cached (via imports). Tests are still coming, but this is just to highlight the progress so far.
psykzz
marked this pull request as draft
November 22, 2020 07:35
Comment on lines
-13
to
+12
| elif config["sims"][args.dir[:-1]]["builds"]: | ||
| elif config["sims"][args.dir]["builds"]: |
Contributor
There was a problem hiding this comment.
wont this fail? Since args.dir is talents/ but we need to lookup based on talents
Contributor
Author
There was a problem hiding this comment.
No since we now normalise the path, so a user could do ./talents or ./talents/ it would be normalised to talents
psykzz
marked this pull request as ready for review
December 5, 2020 19:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
This removes path generation from string concat, this is instead replaced with os.path.join, which takes care to handle the differences between OS.
Additionally removes os.chdir since this makes it harder to understand what is happening in the script, since the current directory in the loop is important, but difficult to reason.
Additionally splits out the csv, json and markdown file writers into their own files.
(We may want to consider a single interface, but i didn't want to touch that yet).
Lastly avoids multiple reads to the config file by putting it into its own module where the file is cached (via imports).
Tests are still coming, but this is just to highlight the progress so far.
Benefits
This should make things easier to maintain.
Applicable Issues
N/A