expose a preconfigured dirfs
instance on mapper objects
#1302
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.
I'm pretty happy with the way
dirfs
instances help working with mapper objects, but constructing one that uses the same parameters as the mapper is a bit more work than I would wish:As suggested in #1269, this exposes a
dirfs
instance as a cached property, which means that anyone who doesn't need thedirfs
instance doesn't have to wait the (very) little time it takes to construct one. With that, the above snipped would become:I'm not particularly attached to the name of the property, so I'm happy to change that.
Also, I didn't discuss this change before implementing it, so feel free to close if you don't think growing the mapper API makes sense in this case.