Use already existing cache if found during build#1747
Open
camuthig wants to merge 2 commits intohgrecco:masterfrom
Open
Use already existing cache if found during build#1747camuthig wants to merge 2 commits intohgrecco:masterfrom
camuthig wants to merge 2 commits intohgrecco:masterfrom
Conversation
When building a unit registry using a cache, the read cache data is not getting leveraged. Instead a new cache is getting built, but without the dimensional equivalents. This creates a behavior where you create a new UnitRegistry from already cached files and call `get_compatible_units` it will always fail with a key error.
Owner
|
I don't think this is a good idea without further thoughts. Basically, I am worried that we might be caching objects which are specific to this registry. Remember that certain objects (Quantity/Unit/Context/Measurement) are registry instance specific and should not be cached. That part of the code is not in use to investigate if this was a good idea or not. |
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.
pre-commit run --all-fileswith no errorsThis pull request attempts to update the
PlainRegistryto setself._cacheto the data retrieve from the cached data. Tests are passing, so I believe this change resolves the issue linked, but I'm not confident if it is the correct resolution or not.