EasyPlotLib 0.0.8__tar.gz → 0.0.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. {easyplotlib-0.0.8 → easyplotlib-0.0.10}/EasyPlotLib/__init__.py +17 -4
  2. easyplotlib-0.0.10/EasyPlotLib/fonts/texgyreadventor-bold.ttf +0 -0
  3. easyplotlib-0.0.10/EasyPlotLib/fonts/texgyreadventor-bolditalic.ttf +0 -0
  4. easyplotlib-0.0.10/EasyPlotLib/fonts/texgyreadventor-italic.ttf +0 -0
  5. easyplotlib-0.0.10/EasyPlotLib/fonts/texgyreadventor-regular.ttf +0 -0
  6. easyplotlib-0.0.10/EasyPlotLib/fonts/texgyrechorus-mediumitalic.ttf +0 -0
  7. easyplotlib-0.0.10/EasyPlotLib/fonts/texgyrecursor-bold.ttf +0 -0
  8. easyplotlib-0.0.10/EasyPlotLib/fonts/texgyrecursor-bolditalic.ttf +0 -0
  9. easyplotlib-0.0.10/EasyPlotLib/fonts/texgyrecursor-italic.ttf +0 -0
  10. easyplotlib-0.0.10/EasyPlotLib/fonts/texgyrecursor-regular.ttf +0 -0
  11. easyplotlib-0.0.10/EasyPlotLib/fonts/texgyreheros-bold.ttf +0 -0
  12. easyplotlib-0.0.10/EasyPlotLib/fonts/texgyreheros-bolditalic.ttf +0 -0
  13. easyplotlib-0.0.10/EasyPlotLib/fonts/texgyreheros-italic.ttf +0 -0
  14. easyplotlib-0.0.10/EasyPlotLib/fonts/texgyreheros-regular.ttf +0 -0
  15. easyplotlib-0.0.10/EasyPlotLib/fonts/texgyreschola-bold.ttf +0 -0
  16. easyplotlib-0.0.10/EasyPlotLib/fonts/texgyreschola-bolditalic.ttf +0 -0
  17. easyplotlib-0.0.10/EasyPlotLib/fonts/texgyreschola-italic.ttf +0 -0
  18. easyplotlib-0.0.10/EasyPlotLib/fonts/texgyreschola-regular.ttf +0 -0
  19. {easyplotlib-0.0.8 → easyplotlib-0.0.10}/EasyPlotLib.egg-info/PKG-INFO +1 -1
  20. easyplotlib-0.0.10/EasyPlotLib.egg-info/SOURCES.txt +27 -0
  21. {easyplotlib-0.0.8 → easyplotlib-0.0.10}/PKG-INFO +1 -1
  22. {easyplotlib-0.0.8 → easyplotlib-0.0.10}/setup.py +4 -1
  23. easyplotlib-0.0.8/EasyPlotLib.egg-info/SOURCES.txt +0 -10
  24. {easyplotlib-0.0.8 → easyplotlib-0.0.10}/EasyPlotLib/cartopy_helper.py +0 -0
  25. {easyplotlib-0.0.8 → easyplotlib-0.0.10}/EasyPlotLib/figsizes_set.py +0 -0
  26. {easyplotlib-0.0.8 → easyplotlib-0.0.10}/EasyPlotLib/styles/nature.mplstyle +0 -0
  27. {easyplotlib-0.0.8 → easyplotlib-0.0.10}/EasyPlotLib.egg-info/dependency_links.txt +0 -0
  28. {easyplotlib-0.0.8 → easyplotlib-0.0.10}/EasyPlotLib.egg-info/top_level.txt +0 -0
  29. {easyplotlib-0.0.8 → easyplotlib-0.0.10}/README.md +0 -0
  30. {easyplotlib-0.0.8 → easyplotlib-0.0.10}/setup.cfg +0 -0
@@ -1,20 +1,33 @@
1
1
  import os
2
+
3
+ import matplotlib as mpl
2
4
  import matplotlib.font_manager as fm
3
5
  import matplotlib.pyplot as plt
4
6
 
7
+ import EasyPlotLib
8
+
5
9
  from .cartopy_helper import cartopy_plot_tickmarks
6
10
  from .figsizes_set import figsizes, subplot_labels
7
- import EasyPlotLib
8
11
 
9
12
  # register the bundled stylesheets in the matplotlib style library
10
13
  EasyPlotLib_path = EasyPlotLib.__path__[0]
11
14
  font_dir = os.path.join(EasyPlotLib_path, "fonts")
12
15
  styles_path = os.path.join(EasyPlotLib_path, "styles")
13
16
 
14
- # add fonts
15
17
  font_files = fm.findSystemFonts(fontpaths=[font_dir])
16
- for font_file in font_files:
17
- fm.fontManager.addfont(font_file)
18
+ font_files_set = set(font_files)
19
+
20
+ # 检查是否需要更新缓存
21
+ existing_fonts = {font.fname for font in fm.fontManager.ttflist}
22
+ if not existing_fonts >= font_files_set:
23
+ for font_file in font_files:
24
+ fm.fontManager.addfont(font_file)
25
+
26
+ # 仅当添加了新字体时更新缓存
27
+ cache = os.path.join(
28
+ mpl.get_cachedir(), f"fontlist-v{fm.FontManager.__version__}.json"
29
+ )
30
+ fm.json_dump(fm.fontManager, cache)
18
31
 
19
32
  # Reads styles in /styles folder and all subfolders
20
33
  stylesheets = {} # plt.style.library is a dictionary
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: EasyPlotLib
3
- Version: 0.0.8
3
+ Version: 0.0.10
4
4
  Summary: A simple plotting library
5
5
  Home-page: https://github.com/yourusername/EasyPlotLib
6
6
  Author: HanYuyang
@@ -0,0 +1,27 @@
1
+ README.md
2
+ setup.py
3
+ EasyPlotLib/__init__.py
4
+ EasyPlotLib/cartopy_helper.py
5
+ EasyPlotLib/figsizes_set.py
6
+ EasyPlotLib.egg-info/PKG-INFO
7
+ EasyPlotLib.egg-info/SOURCES.txt
8
+ EasyPlotLib.egg-info/dependency_links.txt
9
+ EasyPlotLib.egg-info/top_level.txt
10
+ EasyPlotLib/fonts/texgyreadventor-bold.ttf
11
+ EasyPlotLib/fonts/texgyreadventor-bolditalic.ttf
12
+ EasyPlotLib/fonts/texgyreadventor-italic.ttf
13
+ EasyPlotLib/fonts/texgyreadventor-regular.ttf
14
+ EasyPlotLib/fonts/texgyrechorus-mediumitalic.ttf
15
+ EasyPlotLib/fonts/texgyrecursor-bold.ttf
16
+ EasyPlotLib/fonts/texgyrecursor-bolditalic.ttf
17
+ EasyPlotLib/fonts/texgyrecursor-italic.ttf
18
+ EasyPlotLib/fonts/texgyrecursor-regular.ttf
19
+ EasyPlotLib/fonts/texgyreheros-bold.ttf
20
+ EasyPlotLib/fonts/texgyreheros-bolditalic.ttf
21
+ EasyPlotLib/fonts/texgyreheros-italic.ttf
22
+ EasyPlotLib/fonts/texgyreheros-regular.ttf
23
+ EasyPlotLib/fonts/texgyreschola-bold.ttf
24
+ EasyPlotLib/fonts/texgyreschola-bolditalic.ttf
25
+ EasyPlotLib/fonts/texgyreschola-italic.ttf
26
+ EasyPlotLib/fonts/texgyreschola-regular.ttf
27
+ EasyPlotLib/styles/nature.mplstyle
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: EasyPlotLib
3
- Version: 0.0.8
3
+ Version: 0.0.10
4
4
  Summary: A simple plotting library
5
5
  Home-page: https://github.com/yourusername/EasyPlotLib
6
6
  Author: HanYuyang
@@ -26,7 +26,10 @@ setuptools.setup(
26
26
  url="https://github.com/yourusername/EasyPlotLib",
27
27
  packages=setuptools.find_packages(),
28
28
  package_data={
29
- "EasyPlotLib": ["styles/**/*.mplstyle"],
29
+ "EasyPlotLib": [
30
+ "styles/**/*.mplstyle",
31
+ "fonts/*.*",
32
+ ],
30
33
  },
31
34
  classifiers=[
32
35
  "Programming Language :: Python :: 3",
@@ -1,10 +0,0 @@
1
- README.md
2
- setup.py
3
- EasyPlotLib/__init__.py
4
- EasyPlotLib/cartopy_helper.py
5
- EasyPlotLib/figsizes_set.py
6
- EasyPlotLib.egg-info/PKG-INFO
7
- EasyPlotLib.egg-info/SOURCES.txt
8
- EasyPlotLib.egg-info/dependency_links.txt
9
- EasyPlotLib.egg-info/top_level.txt
10
- EasyPlotLib/styles/nature.mplstyle
File without changes
File without changes