-
Notifications
You must be signed in to change notification settings - Fork 50
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
Cache files library and CLI tool #266
base: master
Are you sure you want to change the base?
Conversation
…t instead of a filename, added a unit test for cache conversion (although i dont know how to run it)
Quality Gate passedIssues Measures |
I've just tried to convert a Kernel Tuner cache file to the T4 format, but the conversion does not yet handle non-valid configurations. This can be seen in |
invalidity = "constraints" | ||
|
||
result = T4ResultLineJSON( | ||
timestamp=cache_line["timestamp"], |
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.
This line requires the input cachefile to have timestamps, is that something we want to enforce or are we okay with something like cache_line.get("timestamp", None)
?
Quality Gate passedIssues Measures |
This pull request restores the accidentally closed pull request #265 that I can't seem to otherwise restore myself. This time its not from a 'master' branch on a fork, but from a branch of our own repository which makes it easier to work with.
To restore the original text of the pull request by @tdejong00:
This pull request adds an interface for modifying cache files, which is located in the
kernel_tuner/cache
directory. This directory contains the following modules:cache
(main module): contains aCache
class through which cache files can be created, read and written. This should be the only python module that needs to be used for modifying cache files.cli_tools
: contains functions used in thektcache
command.convert
: contains functions for converting (older) cache files to newer cache files.file
: contains functions for reading JSON from and writing JSON to cache files.json
: contains TypeDict type hints for typing code.json_encoder
: contains a custom instance of JSONEncoder that automatically serializes data into JSON in a readable format.paths
: contains useful paths within the project.versions
: exports useful Semver version constants.Furthermore the following test modules have been added:
test_cachefile_class.py
: tests whether the class integrates the functionalities of the other cache modules in the correct way and the additional logic in theCache
class.test_cachefile_encoder.py
: tests whether the JSON is encoded in the right way.test_cachefile_read_write.py
: tests whether cache is read and written in the correct format.test_cachefile_schema.py
: tests the correctness of the schema.test_script_ktcache.py
: tests thektcache
CLI command.We have not yet added an entry to the
CHANGELOG.md
, because we are not sure in what version these changes will be introduced.