Skip to content
Snippets Groups Projects

set matplotlib cache directory

Merged Cort Posnansky requested to merge master-matplotlib-lockfile into master
All threads resolved!
1 file
+ 9
8
Compare changes
  • Side-by-side
  • Inline
# Copyright (C) 2013-2016 Kipp Cannon
# Copyright (C) 2015 Chad Hanna
# Copyright (C) 2023 Cort Posnansky
# Copyright (C) 2023 Cort Posnansky
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@@ -20,9 +18,12 @@
import os
# set matplotlib cache location to local tmp directory
if os.getenv("_CONDOR_SCRATCH_DIR"):
os.environ['MPLCONFIGDIR'] = os.getenv("_CONDOR_SCRATCH_DIR")
else:
os.environ['MPLCONFIGDIR'] = os.getenv("TMPDIR")
def set_matplotlib_cache_directory():
"""
Change the matplotlib cache directory to a local temporary location.
"""
if os.getenv("_CONDOR_SCRATCH_DIR"):
os.environ['MPLCONFIGDIR'] = os.getenv("_CONDOR_SCRATCH_DIR")
else:
os.environ['MPLCONFIGDIR'] = os.getenv("TMPDIR")
Loading