Recognize DARTS_CONFIGURE_MATPLOTLIB=0 #924
Merged
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.
Fixes #892.
Summary
This PR makes it possible to import darts without changing the global matplotlib configuration.
Other Information
Normally it would be best to add tests of the new behavior, but it's difficult to test behavior in the root
__init__.py
. Both the pre-existing behavior and the adjustment here would be easier to test if the plotting configuration were factored out into some helper module. That would be a larger (though still fairly small) change.A larger question would be: should darts change the global matplotlib configuration by default? Making this opt-in would obviously cause an aesthetic mismatch for anyone following documentation produced prior to that change. But it would arguably be cleaner (and more testable) to require e.g.
darts.apply_u8plots_mplstyle()
or otherwise respect users' matplotlibrc.