-
Notifications
You must be signed in to change notification settings - Fork 6
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
Refactor the internals of analyze #194
base: master
Are you sure you want to change the base?
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.
elif config["sims"][args.dir[:-1]]["builds"]: | ||
elif config["sims"][args.dir]["builds"]: |
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.
wont this fail? Since args.dir
is talents/
but we need to lookup based on talents
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 since we now normalise the path, so a user could do ./talents
or ./talents/
it would be normalised to talents
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